anbt-sql-formatter 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +3 -0
- data/CHANGELOG.md +12 -0
- data/anbt-sql-formatter.gemspec +2 -0
- data/lib/anbt-sql-formatter/coarse-tokenizer.rb +27 -28
- data/lib/anbt-sql-formatter/constants.rb +1 -1
- data/lib/anbt-sql-formatter/parser.rb +1 -1
- data/lib/anbt-sql-formatter/rule.rb +1 -1
- data/lib/anbt-sql-formatter/token.rb +2 -2
- data/lib/anbt-sql-formatter/version.rb +1 -1
- data/misc/anbt-sql-formatter-customize-example +4 -4
- data/test/test_coarse-tokenizer.rb +5 -5
- data/test/test_formatter.rb +506 -529
- data/test/test_in_values.rb +6 -6
- data/test/test_parser.rb +435 -441
- data/test.sh +1 -1
- metadata +18 -8
data/test/test_in_values.rb
CHANGED
@@ -49,7 +49,7 @@ SELECT
|
|
49
49
|
)
|
50
50
|
EOS
|
51
51
|
|
52
|
-
|
52
|
+
assert_equals(msg, expected.strip, @fmt.format(sql))
|
53
53
|
end
|
54
54
|
|
55
55
|
def test_format_num_in_values
|
@@ -78,7 +78,7 @@ SELECT
|
|
78
78
|
)
|
79
79
|
EOS
|
80
80
|
|
81
|
-
|
81
|
+
assert_equals(msg, expected.strip, @fmt.format(sql))
|
82
82
|
end
|
83
83
|
|
84
84
|
def test_format_str_in_values
|
@@ -107,7 +107,7 @@ SELECT
|
|
107
107
|
)
|
108
108
|
EOS
|
109
109
|
|
110
|
-
|
110
|
+
assert_equals(msg, expected.strip, @fmt.format(sql))
|
111
111
|
end
|
112
112
|
|
113
113
|
def test_format_oneline_in_values
|
@@ -127,7 +127,7 @@ SELECT
|
|
127
127
|
)
|
128
128
|
EOS
|
129
129
|
|
130
|
-
|
130
|
+
assert_equals(msg, expected.strip, @fmt.format(sql))
|
131
131
|
end
|
132
132
|
|
133
133
|
def test_format_with_space_after_comma
|
@@ -157,7 +157,7 @@ SELECT
|
|
157
157
|
)
|
158
158
|
EOS
|
159
159
|
|
160
|
-
|
160
|
+
assert_equals(msg, expected.strip, @fmt.format(sql))
|
161
161
|
end
|
162
162
|
|
163
163
|
def test_format_ignore_in_values_compact_when_select
|
@@ -180,7 +180,7 @@ SELECT
|
|
180
180
|
)
|
181
181
|
EOS
|
182
182
|
|
183
|
-
|
183
|
+
assert_equals(msg, expected.strip, @fmt.format(sql))
|
184
184
|
end
|
185
185
|
|
186
186
|
private
|