From 5adc2fd39c09dcec0545eb4f6ea231cb7abbc3c9 Mon Sep 17 00:00:00 2001 From: Niko Strijbol Date: Wed, 29 Nov 2023 22:02:41 +0100 Subject: [PATCH 1/2] Don't strip leading whitespace --- tested/dsl/schema.json | 2 +- tested/dsl/schema_draft7.json | 2 +- tested/oracles/text.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tested/dsl/schema.json b/tested/dsl/schema.json index 0dc4dc75..663a6a96 100644 --- a/tested/dsl/schema.json +++ b/tested/dsl/schema.json @@ -453,7 +453,7 @@ "type" : "boolean" }, "ignoreWhitespace" : { - "description" : "Ignore leading and trailing whitespace", + "description" : "Ignore and trailing whitespace", "type" : "boolean" }, "roundTo" : { diff --git a/tested/dsl/schema_draft7.json b/tested/dsl/schema_draft7.json index dccd8036..82b6fd8f 100644 --- a/tested/dsl/schema_draft7.json +++ b/tested/dsl/schema_draft7.json @@ -446,7 +446,7 @@ "type" : "boolean" }, "ignoreWhitespace" : { - "description" : "Ignore leading and trailing whitespace", + "description" : "Ignore trailing whitespace", "type" : "boolean" }, "roundTo" : { diff --git a/tested/oracles/text.py b/tested/oracles/text.py index f66affb9..b084a020 100644 --- a/tested/oracles/text.py +++ b/tested/oracles/text.py @@ -46,7 +46,7 @@ def compare_text(options: dict[str, Any], expected: str, actual: str) -> OracleR expected_eval, actual_eval = str(expected), str(actual) if options["ignoreWhitespace"]: - expected_eval, actual_eval = expected_eval.strip(), actual_eval.strip() + expected_eval, actual_eval = expected_eval.rstrip(), actual_eval.rstrip() if options["caseInsensitive"]: expected_eval, actual_eval = expected_eval.lower(), actual_eval.lower() From 433a1c560d4df2dcf8f71c860dccf9acc688e26a Mon Sep 17 00:00:00 2001 From: Niko Strijbol Date: Thu, 30 Nov 2023 09:57:50 +0100 Subject: [PATCH 2/2] Update tested/dsl/schema.json Co-authored-by: Bart Mesuere --- tested/dsl/schema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tested/dsl/schema.json b/tested/dsl/schema.json index 663a6a96..56d7a35f 100644 --- a/tested/dsl/schema.json +++ b/tested/dsl/schema.json @@ -453,7 +453,7 @@ "type" : "boolean" }, "ignoreWhitespace" : { - "description" : "Ignore and trailing whitespace", + "description" : "Ignore trailing whitespace", "type" : "boolean" }, "roundTo" : {