From 2cfe46389d99dfc04d99cfc406296da77cb09554 Mon Sep 17 00:00:00 2001 From: Sam Vervaeck Date: Sat, 13 Jun 2020 19:30:14 +0200 Subject: [PATCH] Update scanner tests to work with new test infrastructure --- test/scan/000-bolt-identifier.md | 58 ++++++++++++-------- test/scan/001-bolt-string-literal.md | 16 ++++-- test/scan/002-bolt-integer-literal.md | 76 ++++++++++++++++----------- 3 files changed, 92 insertions(+), 58 deletions(-) diff --git a/test/scan/000-bolt-identifier.md b/test/scan/000-bolt-identifier.md index de9e373db..fa77f0c72 100644 --- a/test/scan/000-bolt-identifier.md +++ b/test/scan/000-bolt-identifier.md @@ -6,48 +6,64 @@ split-lines: true The most simple identifiers are those made out of ASCII letters: - Foo - Bar - Baz +``` +Foo +Bar +Baz +``` However, they may also contain digits as long as they do not begin with a digit: - Var1 - Var2 - Var10029384 +``` +Var1 +Var2 +Var10029384 +``` Identifiers may be as long as you want: - ThisIsALongAndValidIdentifier - ThisIsAnEvenLongButStilCompletelyValidIdentifier +``` +ThisIsALongAndValidIdentifier +ThisIsAnEvenLongerButStilCompletelyValidIdentifier +``` Moreover, they may have arbitrary underscores (`_`) in their names. - a_valid_identifier - another__0000__valid_identfier - _1 - __2 - ___3 +``` +a_valid_identifier +another__0000__valid_identfier +_1 +__2 +___3 +``` They may even be nothing more than underscores: - _ - __ - ___ +``` +_ +__ +___ +``` All identifiers starting with a `ID_Start` character are valid identifiers, including `Other_ID_Start`: - ℘rototype - ℮llipsis +``` +℘rototype +℮llipsis +``` Likewise, the following code points using `Other_ID_Continue` are also valid: - α·β - ano·teleia +``` +α·β +ano·teleia +``` And, of course, the combination of `ID_Start` and `ID_Continue`: - alfa·beta +``` +alfa·beta +``` diff --git a/test/scan/001-bolt-string-literal.md b/test/scan/001-bolt-string-literal.md index 3ca25cf34..db0a21d78 100644 --- a/test/scan/001-bolt-string-literal.md +++ b/test/scan/001-bolt-string-literal.md @@ -6,15 +6,21 @@ split-lines: true A string may hold arbirary ASCII characters, including spaces: - "Foo!" - "Once upon a time ..." +``` +"Foo!" +"Once upon a time ..." +``` Special ASCII characters have no effect, other than that they are appended to the contents of the string: - "S+me w3!rd @SCII ch@r$" +``` +"S+me w3!rd @SCII ch@r$" +``` Some special escape sequences: - "\n\r" - "\n" +``` +"\n\r" +"\n" +``` diff --git a/test/scan/002-bolt-integer-literal.md b/test/scan/002-bolt-integer-literal.md index 7e0aa0f2a..fb625568f 100644 --- a/test/scan/002-bolt-integer-literal.md +++ b/test/scan/002-bolt-integer-literal.md @@ -6,52 +6,64 @@ split-lines: true All decimal digits are valid integers. - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 0 +``` +1 +2 +3 +4 +5 +6 +7 +8 +9 +0 +``` Any combination of decimal digits are valid integers, including integers prefixed with an abirary amount of zeroes. - 12345 - 99 - 10 - 01 - 000 - 0010 +``` +12345 +99 +10 +01 +000 +0010 +``` In binary mode, integers are read in base-2. - 0b0 - 0b1 - 0b10010 - 0b00100 - 0b00000 +``` +0b0 +0b1 +0b10010 +0b00100 +0b00000 +``` This means the following expressions are invalid in binary mode: - 0b20001 - 0b12345 - 0b00003 +``` +0b20001 +0b12345 +0b00003 +``` In octal mode, integers are read in base-8. - 0o0 - 0o00000 - 0o007 - 0o706 - 0o12345 +``` +0o0 +0o00000 +0o007 +0o706 +0o12345 +``` This means the following expressions are invalid in octal mode: - 0o8 - 0o9 - 0o123456789 +``` +0o8 +0o9 +0o123456789 +```