Skip to content

Commit

Permalink
Add more testing details to README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
JosephTLyons committed Nov 14, 2024
1 parent 9225c7a commit 9e4a9e2
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 7 deletions.
24 changes: 17 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,23 @@ pub fn main() {

## [Rigorous Testing](https://github.com/JosephTLyons/lenient_parse/tree/main/test/data)

`lenient_parse`'s testing is extensive. Each test input is also processed using
Python's (3.13) `float()` and `int()` functions. We verify that `lenient_parse`
produces the same output as Python. If Python's built-ins succeed,
`lenient_parse` should also succeed with identical results. If Python's
built-ins fail to parse, `lenient_parse` should also fail. This ensures that
`lenient_parse` behaves consistently with Python's built-ins for all supplied
test data.
`lenient_parse`'s testing is extensive. We test the tokenization step, the
overall parse procedure, as well as various intermediate layers. We currently
have 460+ passing tests. Regressions are **not** welcome here.

### Backed by Python

Each test input is also processed using Python's (3.13) `float()` and `int()`
functions. We verify that `lenient_parse` produces the same output as Python. If
Python's built-ins succeed, `lenient_parse` should also succeed with identical
results. If Python's built-ins fail to parse, `lenient_parse` should also fail.
This ensures that `lenient_parse` behaves consistently with Python's built-ins
for all supplied test data.

If you run into a case where `lenient_parse` and Python's built-ins disagree,
please open an [issue](https://github.com/JosephTLyons/lenient_parse/issues) -
we aim to be 100% consistent with Python's built-ins and we will fix any
reported discrepancies.

## Development

Expand Down
6 changes: 6 additions & 0 deletions test/data/integer/valid_integer_data.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ const valid_simple: List(IntegerTestData) = [
expected_program_output: Ok(-10),
expected_python_output: Ok("-10"),
),
IntegerTestData(
input: "01_32",
base: 4,
expected_program_output: Ok(30),
expected_python_output: Ok("30"),
),
IntegerTestData(
input: "+0",
base: 10,
Expand Down

0 comments on commit 9e4a9e2

Please sign in to comment.