diff options
Diffstat (limited to 'spec/outputs/test/format_spec.lua')
| -rw-r--r-- | spec/outputs/test/format_spec.lua | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/spec/outputs/test/format_spec.lua b/spec/outputs/test/format_spec.lua index 3e98e4a..c9ea3c2 100644 --- a/spec/outputs/test/format_spec.lua +++ b/spec/outputs/test/format_spec.lua | |||
| @@ -113,6 +113,7 @@ local files = { | |||
| 113 | "spec/inputs/test/loops_spec.yue", | 113 | "spec/inputs/test/loops_spec.yue", |
| 114 | "spec/inputs/test/if_assignment_spec.yue", | 114 | "spec/inputs/test/if_assignment_spec.yue", |
| 115 | "spec/inputs/test/tables_advanced_spec.yue", | 115 | "spec/inputs/test/tables_advanced_spec.yue", |
| 116 | "spec/inputs/test/break_multiple_values_spec.yue", | ||
| 116 | "spec/inputs/unicode/macro_export.yue", | 117 | "spec/inputs/unicode/macro_export.yue", |
| 117 | "spec/inputs/unicode/attrib.yue", | 118 | "spec/inputs/unicode/attrib.yue", |
| 118 | "spec/inputs/unicode/macro.yue", | 119 | "spec/inputs/unicode/macro.yue", |
| @@ -182,11 +183,14 @@ return describe("format", function() | |||
| 182 | local f = io.open(file) | 183 | local f = io.open(file) |
| 183 | local code = f:read("a*") | 184 | local code = f:read("a*") |
| 184 | f:close() | 185 | f:close() |
| 185 | local original_ast = yue.to_ast(code) | 186 | local original_ast, err = yue.to_ast(code) |
| 187 | assert.is_nil(err) | ||
| 186 | assert.is_not_nil(original_ast) | 188 | assert.is_not_nil(original_ast) |
| 187 | rewriteLineCol(original_ast) | 189 | rewriteLineCol(original_ast) |
| 188 | local formated = yue.format(code, 0, true) | 190 | local formated = yue.format(code, 0, true) |
| 189 | local ast = yue.to_ast(formated) | 191 | local ast |
| 192 | ast, err = yue.to_ast(formated) | ||
| 193 | assert.is_nil(err) | ||
| 190 | assert.is_not_nil(ast) | 194 | assert.is_not_nil(ast) |
| 191 | rewriteLineCol(ast) | 195 | rewriteLineCol(ast) |
| 192 | return assert.same(original_ast, ast) | 196 | return assert.same(original_ast, ast) |
