File tree Expand file tree Collapse file tree 2 files changed +19
-9
lines changed Expand file tree Collapse file tree 2 files changed +19
-9
lines changed Original file line number Diff line number Diff line change 1
- +--------------+----------------------------------------+
2
- | info_name| info_value|
3
- +--------------+----------------------------------------+
4
- | Catalog Name| spark_catalog|
5
- |Namespace Name| default|
6
- | Comment| default database|
1
+ +--------------+-------------------------------------------- +
2
+ | info_name| info_value|
3
+ +--------------+-------------------------------------------- +
4
+ | Catalog Name| spark_catalog|
5
+ |Namespace Name| default|
6
+ | Comment| default database|
7
7
| Location|*|
8
- | Owner| * |
9
- +--------------+----------------------------------------+
8
+ | Owner| dongjoon |
9
+ +--------------+-------------------------------------------- +
Original file line number Diff line number Diff line change @@ -49,6 +49,10 @@ struct SQLTests {
49
49
return str. replacing ( regexOwner, with: " * " )
50
50
}
51
51
52
+ private func normalize( _ str: String ) -> String {
53
+ return str. replacing ( /[-]+/ , with: " - " ) . replacing ( /[ ]+/ , with: " " )
54
+ }
55
+
52
56
@Test
53
57
func testRemoveID( ) {
54
58
#expect( removeID ( " 123 " ) == " 123 " )
@@ -69,6 +73,12 @@ struct SQLTests {
69
73
#expect( removeOwner ( " 185 " ) == " * " )
70
74
}
71
75
76
+ @Test
77
+ func testNormalize( ) {
78
+ #expect( normalize ( " +------+------------------+ " ) == " +-+-+ " )
79
+ #expect( normalize ( " + + + " ) == " + + + " )
80
+ }
81
+
72
82
let queriesForSpark4Only : [ String ] = [
73
83
" create_scala_function.sql " ,
74
84
" create_table_function.sql " ,
@@ -97,7 +107,7 @@ struct SQLTests {
97
107
fm. createFile ( atPath: path, contents: answer. data ( using: . utf8) !, attributes: nil )
98
108
} else {
99
109
let expected = cleanUp ( try String ( contentsOf: URL ( fileURLWithPath: " \( path) / \( name) .answer " ) , encoding: . utf8) )
100
- #expect( answer == expected. trimmingCharacters ( in: . whitespacesAndNewlines) )
110
+ #expect( normalize ( answer) == normalize ( expected. trimmingCharacters ( in: . whitespacesAndNewlines) ) )
101
111
}
102
112
}
103
113
await spark. stop ( )
You can’t perform that action at this time.
0 commit comments