fix: firstof
This commit is contained in:
parent
655bed4c8f
commit
14e307f3dc
1 changed files with 3 additions and 2 deletions
|
|
@ -453,6 +453,7 @@ test "parse simple firstof" {
|
||||||
try testing.expectEqualStrings("var1", fo[0]);
|
try testing.expectEqualStrings("var1", fo[0]);
|
||||||
try testing.expectEqualStrings("var2", fo[1]);
|
try testing.expectEqualStrings("var2", fo[1]);
|
||||||
try testing.expectEqualStrings("var3", fo[2]);
|
try testing.expectEqualStrings("var3", fo[2]);
|
||||||
|
try testing.expectEqualStrings("", nodes[1].tag.?.body.firstof.fallback);
|
||||||
}
|
}
|
||||||
|
|
||||||
test "parse firstof with fallback" {
|
test "parse firstof with fallback" {
|
||||||
|
|
@ -471,10 +472,10 @@ test "parse firstof with fallback" {
|
||||||
try testing.expectEqual(@as(usize, 1), nodes.len);
|
try testing.expectEqual(@as(usize, 1), nodes.len);
|
||||||
try testing.expect(nodes[0].type == .tag);
|
try testing.expect(nodes[0].type == .tag);
|
||||||
const fo = nodes[0].tag.?.body.firstof.values;
|
const fo = nodes[0].tag.?.body.firstof.values;
|
||||||
try testing.expectEqual(@as(usize, 3), fo.len);
|
try testing.expectEqual(@as(usize, 2), fo.len);
|
||||||
try testing.expectEqualStrings("var1", fo[0]);
|
try testing.expectEqualStrings("var1", fo[0]);
|
||||||
try testing.expectEqualStrings("var2", fo[1]);
|
try testing.expectEqualStrings("var2", fo[1]);
|
||||||
try testing.expectEqualStrings("Nenhum valor", fo[2]);
|
try testing.expectEqualStrings("Nenhum valor", nodes[0].tag.?.body.firstof.fallback);
|
||||||
}
|
}
|
||||||
|
|
||||||
test "parse for block whithout empty" {
|
test "parse for block whithout empty" {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue