You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The language should support a syntactic method for writing tests in the same file as the patterns. I'm not totally sure how this should be, will require some research.
Initial thoughts:
use --- to separate code from tests, multiple --- indicates multiple tests
test blocks are just object property declarations, where the properties are the shape of a test object
or maybe its just yaml?
The test just runs the pattern with the given input, deep equals it to the expected output
The test object may have some other fields to describe expectations like:
throws?: boolean | Pattern
matched?: boolean
done?: boolean
errors?: MachError[]
Letter = "a"-"z"
Main = Letter+
---
input: abc
expected: abc
---
input: abc1
expected: abc
matched: true
done: false
The text was updated successfully, but these errors were encountered:
The language should support a syntactic method for writing tests in the same file as the patterns. I'm not totally sure how this should be, will require some research.
Initial thoughts:
---
to separate code from tests, multiple---
indicates multiple teststhrows?: boolean | Pattern
matched?: boolean
done?: boolean
errors?: MachError[]
The text was updated successfully, but these errors were encountered: