Added test for bugfix, cleaned up repo (issue #35 and #36).

This commit is contained in:
Marvin Blum
2016-02-08 15:09:48 +01:00
parent 28fbbd7e10
commit 944b91c16b
7 changed files with 29 additions and 41 deletions

View File

@@ -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)