Skip to content

Commit

Permalink
feat: update tests accordingly, add highlight assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
amaanq committed Feb 23, 2023
1 parent 21cbe63 commit 341c73d
Show file tree
Hide file tree
Showing 2 changed files with 164 additions and 108 deletions.
221 changes: 113 additions & 108 deletions test/corpus/main.txt
Original file line number Diff line number Diff line change
@@ -1,68 +1,62 @@
================================================================================
Meta1
Meta
================================================================================

<"foo":"bar", 1:<2:"baz">"baz">1

--------------------------------------------------------------------------------
---

(document
(meta
(mpair
(string
(string_content))
(string
(string_content)))
(mpair
(number)
(meta
(mpair
(number)
(string
(string_content)))
)
(string
(string_content))))
(number)
)
(meta_map
(string
(string_content))
(string
(string_content))
(number)
(meta_map
(number)
(string
(string_content)))
(string
(string_content)))
(number))



================================================================================
Meta2
Meta with weird spacing
================================================================================

<
"foo": "bar"
"foo": "bar"
1:<
2: "baz"
>
"baz"
>1

--------------------------------------------------------------------------------
---

(document
(meta
(mpair
(string
(string_content))
(string
(string_content)))
(mpair
(number)
(meta
(mpair
(number)
(string
(string_content)))
)
(string
(string_content))))
(number)
)
(meta_map
(string
(string_content))
(string
(string_content))
(number)
(meta_map
(number)
(string
(string_content)))
(string
(string_content)))
(number))



=================================================================================
Array
================================================================================
=================================================================================

[
345,
Expand All @@ -84,54 +78,51 @@ Array
},
]

--------------------------------------------------------------------------------
---

(document
(array
(number)
(number)
(float)
(number)
(number)
(number)
(number)
(number)
(number)
(null)
(true)
(false)
(boolean)
(boolean)
(map
(pair
(string (string_content))
(string (string_content))))
(imap
(ipair
(number)
(number)
)
(number))
(ipair
(number)
(string (string_content))
)
)
)
)

(string (string_content))))))



=================================================================================
Array with comment
================================================================================

[1,/*2,*/3]

--------------------------------------------------------------------------------
---

(document
(array
(number)
(comment)
(number)
)
)
(number)))



=================================================================================
DateTime
================================================================================
Expand All @@ -146,7 +137,7 @@ DateTime
d"2020-01-23T12:13:14Z"
]

--------------------------------------------------------------------------------
---

(document
(array
Expand All @@ -156,9 +147,9 @@ DateTime
(datetime)
(datetime)
(datetime)
(datetime)
)
)
(datetime)))



================================================================================
String content
Expand All @@ -172,36 +163,40 @@ String content
"jkl\f"
]

--------------------------------------------------------------------------------
---

(document
(array
(string)
(string
(string_content))
(string
(string_content
(escape_sequence)))
(string
(string_content
(escape_sequence)))
(string
(string_content
(escape_sequence)))))
(string)
(string
(string_content))
(string
(string_content)
(escape_sequence))
(string
(string_content)
(escape_sequence))
(string
(string_content)
(escape_sequence))))



================================================================================
Top-level number
================================================================================

-1

--------------------------------------------------------------------------------
---

(document
(number))



================================================================================
array of numbers
Array of numbers
================================================================================

[
Expand All @@ -210,15 +205,15 @@ array of numbers
1e23
]

--------------------------------------------------------------------------------
---

(document
(array
(number)
(number)
(number)
)
)
(float)))



================================================================================
Array of blobs
Expand All @@ -231,28 +226,38 @@ Array of blobs
x"616231"
]

--------------------------------------------------------------------------------
---

(document
(array
(escblob)
(escblob)
(escblob)
(hexblob)
)
)
(esc_blob
(string_content)
(escape_sequence)
(escape_sequence)
(string_content))
(comment)
(esc_blob
(string_content))
(esc_blob
(string_content)
(escape_sequence))
(hex_blob)))



================================================================================
Top-level null
================================================================================

null

--------------------------------------------------------------------------------
---

(document
(null))



================================================================================
Comments
================================================================================
Expand All @@ -271,24 +276,24 @@ Comments
"c": 3
}

--------------------------------------------------------------------------------
---

(document
(map
(pair
(string
(string_content))
(number))
(comment)
(comment)
(comment)
(pair
(string
(string_content))
(string
(string_content)))
(comment)
(pair
(string
(string_content))
(number))))
(pair
(string
(string_content))
(number))
(comment)
(comment)
(comment)
(pair
(string
(string_content))
(string
(string_content)))
(comment)
(pair
(string
(string_content))
(number))))
Loading

0 comments on commit 341c73d

Please sign in to comment.