X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tests%2Flanguage%2Flexer%2Flexer.at;h=bd960710c47686a3ade9a2a02715dbef06829691;hb=0603f7c31318c7f9e765aefac7613d0011912d0f;hp=af6de0c904cccef117e7c5abce282f21e1f4c105;hpb=fc6fccc92a47c4bb4e03bd39600234da7cf7ba55;p=pspp diff --git a/tests/language/lexer/lexer.at b/tests/language/lexer/lexer.at index af6de0c904..bd960710c4 100644 --- a/tests/language/lexer/lexer.at +++ b/tests/language/lexer/lexer.at @@ -67,11 +67,17 @@ AT_SETUP([lexer crash due to null byte]) # Intentionally leave out the new-line and add a null byte: printf "datA dist list notable file='input.txt'/a b c. lis|.\0" > lexer.sps -AT_CHECK([pspp -O format=csv lexer.sps], [1], [dnl -lexer.sps: error: Bad character U+0000 in input. +# We sort the output into a predictable order because the lexer finds +# and reports null bytes as soon as it reads them into its input +# buffer, as opposed to when it encounters them during tokenization. +# This also means that null bytes might be reported as part of one +# command or another or none, hence removing the LIST: prefix. +AT_CHECK([pspp -O format=csv lexer.sps > lexer.csv], [1]) +AT_CHECK([sed '/^$/d +s/LIST: //' lexer.csv | sort], [0], [dnl +lexer.sps: error: Bad character U+0000 in input. lexer.sps:1: error: Unknown command `datA dist'. - -lexer.sps:2: error: LIST: LIST is allowed only after the active dataset has been defined. +lexer.sps:2: error: LIST is allowed only after the active dataset has been defined. ]) AT_CLEANUP