Update scanner tests to work with new test infrastructure

This commit is contained in:
Sam Vervaeck 2020-06-13 19:30:14 +02:00
parent dd55a6f7ac
commit 2cfe46389d
3 changed files with 92 additions and 58 deletions

View file

@ -6,48 +6,64 @@ split-lines: true
The most simple identifiers are those made out of ASCII letters: The most simple identifiers are those made out of ASCII letters:
```
Foo Foo
Bar Bar
Baz Baz
```
However, they may also contain digits as long as they do not begin with a However, they may also contain digits as long as they do not begin with a
digit: digit:
```
Var1 Var1
Var2 Var2
Var10029384 Var10029384
```
Identifiers may be as long as you want: Identifiers may be as long as you want:
```
ThisIsALongAndValidIdentifier ThisIsALongAndValidIdentifier
ThisIsAnEvenLongButStilCompletelyValidIdentifier ThisIsAnEvenLongerButStilCompletelyValidIdentifier
```
Moreover, they may have arbitrary underscores (`_`) in their names. Moreover, they may have arbitrary underscores (`_`) in their names.
```
a_valid_identifier a_valid_identifier
another__0000__valid_identfier another__0000__valid_identfier
_1 _1
__2 __2
___3 ___3
```
They may even be nothing more than underscores: They may even be nothing more than underscores:
```
_ _
__ __
___ ___
```
All identifiers starting with a `ID_Start` character are valid identifiers, All identifiers starting with a `ID_Start` character are valid identifiers,
including `Other_ID_Start`: including `Other_ID_Start`:
```
℘rototype ℘rototype
llipsis llipsis
```
Likewise, the following code points using `Other_ID_Continue` are also valid: 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`: And, of course, the combination of `ID_Start` and `ID_Continue`:
```
alfa·beta alfa·beta
```

View file

@ -6,15 +6,21 @@ split-lines: true
A string may hold arbirary ASCII characters, including spaces: A string may hold arbirary ASCII characters, including spaces:
```
"Foo!" "Foo!"
"Once upon a time ..." "Once upon a time ..."
```
Special ASCII characters have no effect, other than that they are appended to Special ASCII characters have no effect, other than that they are appended to
the contents of the string: the contents of the string:
```
"S+me w3!rd @SCII ch@r$" "S+me w3!rd @SCII ch@r$"
```
Some special escape sequences: Some special escape sequences:
```
"\n\r" "\n\r"
"\n" "\n"
```

View file

@ -6,6 +6,7 @@ split-lines: true
All decimal digits are valid integers. All decimal digits are valid integers.
```
1 1
2 2
3 3
@ -16,42 +17,53 @@ All decimal digits are valid integers.
8 8
9 9
0 0
```
Any combination of decimal digits are valid integers, including integers Any combination of decimal digits are valid integers, including integers
prefixed with an abirary amount of zeroes. prefixed with an abirary amount of zeroes.
```
12345 12345
99 99
10 10
01 01
000 000
0010 0010
```
In binary mode, integers are read in base-2. In binary mode, integers are read in base-2.
```
0b0 0b0
0b1 0b1
0b10010 0b10010
0b00100 0b00100
0b00000 0b00000
```
This means the following expressions are invalid in binary mode: This means the following expressions are invalid in binary mode:
```
0b20001 0b20001
0b12345 0b12345
0b00003 0b00003
```
In octal mode, integers are read in base-8. In octal mode, integers are read in base-8.
```
0o0 0o0
0o00000 0o00000
0o007 0o007
0o706 0o706
0o12345 0o12345
```
This means the following expressions are invalid in octal mode: This means the following expressions are invalid in octal mode:
```
0o8 0o8
0o9 0o9
0o123456789 0o123456789
```