Added preprocessor line.

This commit is contained in:
Marvin Blum
2015-10-31 16:20:04 +01:00
parent dc4eaf4b0f
commit 276ab86668
5 changed files with 69 additions and 7 deletions

View File

@@ -86,6 +86,14 @@ func TestTokenizerInlineCode(t *testing.T) {
compareTokens(t, &got, &want)
}
func TestTokenizerPreprocessor(t *testing.T) {
got := getTokens(t, "test/tokenizer_preprocessor.asl")
want := []string{"#define HELLO_WORLD \"Hello World!\"", "hint", "(", ")", "(", "HELLO_WORLD", ")", ";"}
compareLength(t, &got, &want)
compareTokens(t, &got, &want)
}
func compareLength(t *testing.T, got *[]tokenizer.Token, want *[]string) {
if len(*got) != len(*want) {
t.Error("Length of tokens got and expected tokens not equal, was:")