mirror of
https://github.com/Kugelschieber/asl.git
synced 2026-01-18 12:00:25 +00:00
@@ -35,7 +35,7 @@ func TestParserIf(t *testing.T) {
|
||||
|
||||
func TestParserWhile(t *testing.T) {
|
||||
got := getCompiled(t, "../../test/tokenizer_while.asl")
|
||||
want := "while {true} do {\r\n};"
|
||||
want := "while {true} do {\r\n};\r\n"
|
||||
|
||||
equal(t, got, want)
|
||||
}
|
||||
@@ -195,6 +195,14 @@ func TestParserExpressionArray(t *testing.T) {
|
||||
equal(t, got, want)
|
||||
}
|
||||
|
||||
// bugfix: unary function parsing (e.g. "format")
|
||||
func TestBugfixParserUnaryFunction(t *testing.T) {
|
||||
got := getCompiled(t, "../../test/bugfix_unary_func_format.asl")
|
||||
want := "format [\"%1 %2\", \"value1\", \"value2\"];\r\n[\"a\", \"b\", \"c\"] call someFunc;\r\n"
|
||||
|
||||
equal(t, got, want)
|
||||
}
|
||||
|
||||
func getCompiled(t *testing.T, file string) string {
|
||||
code, err := ioutil.ReadFile(file)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user