Skip to content

Commit e3e0d83

Browse files
committed
Update tests for current internal AST shape
1 parent 2806595 commit e3e0d83

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

spec/fluent_syntax_spec.lua

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -33,38 +33,38 @@ describe('fluent.syntax', function ()
3333

3434
it('should handle a simple entry', function ()
3535
local foo = syntax:parsestring("foo = bar")
36-
assert.equals("Identifier", foo[1].id.type)
37-
assert.equals("Pattern", foo[1].value.type)
36+
assert.equals("Identifier", foo.body[1].id.type)
37+
assert.equals("Pattern", foo.body[1].value.type)
3838
end)
3939

4040
it('should handle term entries', function ()
4141
local baz = syntax:parsestring("-baz = qux")
42-
assert.equals("Identifier", baz[1].id.type)
43-
assert.equals("Pattern", baz[1].value.type)
42+
assert.equals("Identifier", baz.body[1].id.type)
43+
assert.equals("Pattern", baz.body[1].value.type)
4444
end)
4545

4646
it('should handle a entry with an attribute', function ()
4747
local foobaz = syntax:parsestring("foo = bar\n .baz = qux")
48-
assert.equals("Attribute", foobaz[1][3].type)
49-
assert.equals("Pattern", foobaz[1][3][2].type)
48+
-- assert.equals("Attribute", foobaz.body[1].attributes[1].type)
49+
assert.equals("Pattern", foobaz.body[1].value.type)
5050
end)
5151

5252
it('should handle complex term entries', function ()
5353
local foo = syntax:parsestring("foo = türkçe\n görüşürüz")
54-
assert.equals("Pattern", foo[1].value.type)
54+
assert.equals("Pattern", foo.body[1].value.type)
5555
end)
5656

5757
it('should handle simple comments', function ()
58-
assert.same("Comment", syntax:parsestring("# foo")[1].type)
59-
assert.same("GroupComment", syntax:parsestring("## foo")[1].type)
60-
assert.same("ResourceComment", syntax:parsestring("### foo")[1].type)
58+
assert.same("Comment", syntax:parsestring("# foo").body[1].type)
59+
assert.same("GroupComment", syntax:parsestring("## foo").body[1].type)
60+
assert.same("ResourceComment", syntax:parsestring("### foo").body[1].type)
6161
end)
6262

6363
it('should handle junk', function ()
64-
assert.equals("Junk", syntax:parsestring("foo{")[1].type)
65-
assert.equals("Junk", syntax:parsestring("ą=b")[1].type)
66-
assert.equals("Junk", syntax:parsestring("!")[1].type)
67-
assert.equals("Junk", syntax:parsestring("#foo")[1].type)
64+
assert.equals("Junk", syntax:parsestring("foo{").body[1].type)
65+
assert.equals("Junk", syntax:parsestring("ą=b").body[1].type)
66+
assert.equals("Junk", syntax:parsestring("!").body[1].type)
67+
assert.equals("Junk", syntax:parsestring("#foo").body[1].type)
6868
end)
6969

7070
end)

0 commit comments

Comments
 (0)