From 9e4a9e2ec82facfb7938b5b6fb1ea03eca9d3723 Mon Sep 17 00:00:00 2001 From: "Joseph T. Lyons" Date: Thu, 14 Nov 2024 08:49:08 -0500 Subject: [PATCH] Add more testing details to README.md --- README.md | 24 +++++++++++++++------- test/data/integer/valid_integer_data.gleam | 6 ++++++ 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 8a6ff8e..8a1629e 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/test/data/integer/valid_integer_data.gleam b/test/data/integer/valid_integer_data.gleam index e98841e..05f8f49 100644 --- a/test/data/integer/valid_integer_data.gleam +++ b/test/data/integer/valid_integer_data.gleam @@ -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,