Skip to content

Commit

Permalink
test: rendering calls
Browse files Browse the repository at this point in the history
  • Loading branch information
R-unic committed Jan 7, 2025
1 parent 0755d94 commit fbb186b
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion RobloxCS.Tests/RenderingTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public void Renders_ScopedBlock()
var statements = Enumerable.Repeat(new ExpressionStatement(AstUtility.PrintCall(AstUtility.String("bruh"))), 5).ToList<Statement>();
var block = new ScopedBlock(statements);
var output = Render(block);
var expectedOutput = """
const string expectedOutput = """
do
print("bruh")
print("bruh")
Expand All @@ -53,6 +53,8 @@ public void Renders_ScopedBlock()
end
""";

Assert.Equal(expectedOutput.Replace("\r", ""), output.Replace("\r", ""));
}

[Fact]
Expand Down Expand Up @@ -192,6 +194,15 @@ public void Renders_If()

Assert.Equal(expectedOutput.Replace("\r", ""), output.Replace("\r", ""));
}

[Fact]
public void Renders_Calls()
{
var arguments = AstUtility.CreateArgumentList([new Literal("69"), new Literal("420"), AstUtility.String("abc")]);
var call = new Call(new IdentifierName("bigMen"), arguments);
var output = Render(call);
Assert.Equal("bigMen(69, 420, \"abc\"", output);
}

[Fact]
public void Renders_MappedTypes()
Expand Down

0 comments on commit fbb186b

Please sign in to comment.