Reorganize tests into a real spec suite

This commit is contained in:
2024-08-04 19:18:43 -03:00
parent 57c160173c
commit e7c2053222
693 changed files with 136 additions and 116 deletions

View File

@ -0,0 +1,108 @@
---input---
Code fence:
```
foo
```
Code fence with language:
```python
import this
```
Code fence with unknown language:
```invalid-lexer
foo
```
Code fence with extra stuff after the language name:
```shell-session $?
$ unknown
```
---tokens---
'Code' Text
' ' Text
'fence:' Text
'\n' Text.Whitespace
'\n```\nfoo\n```\n' Literal.String.Backtick
'\n' Text.Whitespace
'Code' Text
' ' Text
'fence' Text
' ' Text
'with' Text
' ' Text
'language:' Text
'\n' Text.Whitespace
'\n```' Literal.String.Backtick
'python' Literal.String.Backtick
'\n' Text.Whitespace
'import' Keyword.Namespace
' ' Text
'this' Name.Namespace
'\n' Text.Whitespace
'```\n' Literal.String.Backtick
'\n' Text.Whitespace
'Code' Text
' ' Text
'fence' Text
' ' Text
'with' Text
' ' Text
'unknown' Text
' ' Text
'language:' Text
'\n' Text.Whitespace
'\n```' Literal.String.Backtick
'invalid-lexer' Literal.String.Backtick
'\n' Text.Whitespace
'foo\n' Literal.String
'```\n' Literal.String.Backtick
'\n' Text.Whitespace
'Code' Text
' ' Text
'fence' Text
' ' Text
'with' Text
' ' Text
'extra' Text
' ' Text
'stuff' Text
' ' Text
'after' Text
' ' Text
'the' Text
' ' Text
'language' Text
' ' Text
'name:' Text
'\n' Text.Whitespace
'\n```' Literal.String.Backtick
'shell-session' Literal.String.Backtick
' ' Text.Whitespace
'$?' Text
'\n' Text.Whitespace
'$ ' Generic.Prompt
'unknown' Text
'\n' Text.Whitespace
'```\n' Literal.String.Backtick

View File

@ -0,0 +1,81 @@
---input---
Headings:
#Heading
# Heading
# Another heading
# Another # heading
# Heading #
These are NOT parsed as headings:
#
a #
*#
---tokens---
'Headings:' Text
'\n' Text.Whitespace
'\n' Text.Whitespace
'#Heading' Generic.Heading
'\n' Text
'\n' Text.Whitespace
'# Heading' Generic.Heading
'\n' Text
'\n' Text.Whitespace
'# Another heading' Generic.Heading
'\n' Text
'\n' Text.Whitespace
'# Another # heading' Generic.Heading
'\n' Text
'\n' Text.Whitespace
'# Heading #' Generic.Heading
'\n' Text
'\n' Text.Whitespace
'These' Text
' ' Text
'are' Text
' ' Text
'NOT' Text
' ' Text
'parsed' Text
' ' Text
'as' Text
' ' Text
'headings:' Text
'\n' Text.Whitespace
'\n' Text.Whitespace
'#' Text
'\n' Text.Whitespace
'\n' Text.Whitespace
'a' Text
' ' Text
'#' Text
'\n' Text.Whitespace
'\n' Text.Whitespace
'*#' Text
'\n' Text.Whitespace

View File

@ -0,0 +1,52 @@
---input---
Invalid code blocks:
```code```
prefix not allowed before ```
code block
```
code
---tokens---
'Invalid' Text
' ' Text
'code' Text
' ' Text
'blocks:' Text
'\n' Text.Whitespace
'\n' Text.Whitespace
'```code```' Text
'\n' Text.Whitespace
'\n' Text.Whitespace
'prefix' Text
' ' Text
'not' Text
' ' Text
'allowed' Text
' ' Text
'before' Text
' ' Text
'```' Text
'\n' Text.Whitespace
'code' Text
' ' Text
'block' Text
'\n' Text.Whitespace
'```' Text
'\n' Text.Whitespace
'\n' Text.Whitespace
' ' Text
' ' Text
' ' Text
'code' Text
'\n' Text.Whitespace

View File

@ -0,0 +1,121 @@
---input---
Setext headings:
Heading
=
Heading
=======
Heading
==============
These are NOT Setext headings:
Heading
Heading
_
Heading
=====
Heading
a======
=
Heading
=======Text
---tokens---
'Setext' Text
' ' Text
'headings:' Text
'\n' Text.Whitespace
'\n' Text.Whitespace
'Heading' Generic.Heading
'\n' Text
'=' Generic.Heading
'\n' Text
'\n' Text.Whitespace
'Heading' Generic.Heading
'\n' Text
'=======' Generic.Heading
'\n' Text
'\n' Text.Whitespace
'Heading' Generic.Heading
'\n' Text
'==============' Generic.Heading
'\n' Text
'\n' Text.Whitespace
'\n' Text.Whitespace
'These' Text
' ' Text
'are' Text
' ' Text
'NOT' Text
' ' Text
'Setext' Text
' ' Text
'headings:' Text
'\n' Text.Whitespace
'\n' Text.Whitespace
'Heading' Text
'\n' Text.Whitespace
'\n' Text.Whitespace
'Heading' Text
'\n' Text.Whitespace
'_' Text
'\n' Text.Whitespace
'\n' Text.Whitespace
'Heading' Text
'\n' Text.Whitespace
' ' Text
'=====' Text
'\n' Text.Whitespace
'\n' Text.Whitespace
'Heading' Text
'\n' Text.Whitespace
'a======' Text
'\n' Text.Whitespace
'\n' Text.Whitespace
'\n' Text.Whitespace
'=' Text
'\n' Text.Whitespace
'\n' Text.Whitespace
'Heading' Text
'\n' Text.Whitespace
'=======Text' Text
'\n' Text.Whitespace

View File

@ -0,0 +1,128 @@
---input---
Setext subheadings:
Subheading
-
Subheading
----------
Subheading
-----------
These are NOT Setext subheadings:
Subheading
Subheading
_
Subheading
---------
Subheading
a---------
---------
-
Subheading
----------Text
---tokens---
'Setext' Text
' ' Text
'subheadings:' Text
'\n' Text.Whitespace
'\n' Text.Whitespace
'Subheading' Generic.Subheading
'\n' Text
'-' Generic.Subheading
'\n' Text
'\n' Text.Whitespace
'Subheading' Generic.Subheading
'\n' Text
'----------' Generic.Subheading
'\n' Text
'\n' Text.Whitespace
'Subheading' Generic.Subheading
'\n' Text
'-----------' Generic.Subheading
'\n' Text
'\n' Text.Whitespace
'\n' Text.Whitespace
'These' Text
' ' Text
'are' Text
' ' Text
'NOT' Text
' ' Text
'Setext' Text
' ' Text
'subheadings:' Text
'\n' Text.Whitespace
'\n' Text.Whitespace
'\n' Text.Whitespace
'Subheading' Text
'\n' Text.Whitespace
'\n' Text.Whitespace
'Subheading' Text
'\n' Text.Whitespace
'_' Text
'\n' Text.Whitespace
'\n' Text.Whitespace
'Subheading' Text
'\n' Text.Whitespace
' ' Text
'---------' Text
'\n' Text.Whitespace
'\n' Text.Whitespace
'Subheading' Text
'\n' Text.Whitespace
'a---------' Text
'\n' Text.Whitespace
'\n' Text.Whitespace
'---------' Text
'\n' Text.Whitespace
'\n' Text.Whitespace
'-' Text
'\n' Text.Whitespace
'\n' Text.Whitespace
'Subheading' Text
'\n' Text.Whitespace
'----------Text' Text
'\n' Text.Whitespace

View File

@ -0,0 +1,115 @@
---input---
Subheadings:
##Subheading
## Subheading
### Subheading
#### Subheading
##### Subheading
## Another subheading
## Another ## subheading
##### Subheading #
##### Subheading #####
These are NOT subheadings:
##
a ##
*##
###### too many hashes
---tokens---
'Subheadings:' Text
'\n' Text.Whitespace
'\n' Text.Whitespace
'##Subheading' Generic.Subheading
'\n' Text
'\n' Text.Whitespace
'## Subheading' Generic.Subheading
'\n' Text
'\n' Text.Whitespace
'### Subheading' Generic.Subheading
'\n' Text
'\n' Text.Whitespace
'#### Subheading' Generic.Subheading
'\n' Text
'\n' Text.Whitespace
'##### Subheading' Generic.Subheading
'\n' Text
'\n' Text.Whitespace
'## Another subheading' Generic.Subheading
'\n' Text
'\n' Text.Whitespace
'## Another ## subheading' Generic.Subheading
'\n' Text
'\n' Text.Whitespace
'##### Subheading #' Generic.Subheading
'\n' Text
'\n' Text.Whitespace
'##### Subheading #####' Generic.Subheading
'\n' Text
'\n' Text.Whitespace
'\n' Text.Whitespace
'These' Text
' ' Text
'are' Text
' ' Text
'NOT' Text
' ' Text
'subheadings:' Text
'\n' Text.Whitespace
'\n' Text.Whitespace
'##' Text
'\n' Text.Whitespace
'\n' Text.Whitespace
'a' Text
' ' Text
'##' Text
'\n' Text.Whitespace
'\n' Text.Whitespace
'*##' Text
'\n' Text.Whitespace
'\n' Text.Whitespace
'###### too many hashes' Generic.Subheading
'\n' Text