From a6277c3386856eba303ec9824c6ff49a5b10e49e Mon Sep 17 00:00:00 2001 From: Joshua Date: Fri, 20 Sep 2024 08:14:27 -0400 Subject: [PATCH] initial commit --- .gitignore | 1 + .gitignore.swp | Bin 0 -> 4096 bytes README.md | 23 +++++++++++++++++++++++ 3 files changed, 24 insertions(+) create mode 100644 .gitignore create mode 100644 .gitignore.swp create mode 100644 README.md diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1377554 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.swp diff --git a/.gitignore.swp b/.gitignore.swp new file mode 100644 index 0000000000000000000000000000000000000000..89b204f7a0b7aec007d67c2a0b9286d289cd834c GIT binary patch literal 4096 zcmYc?2=nw+u+%eP00IFJ0Ranj7#PYjb5l}_U?RBb;>zNZ)Le5j-GXG?ihwe85CioC zit^Ko5_5Ai^V0R*^Yx2L^NLc_Q!5Je_0ls-GSl<&i&F8LGb%Y60;3^7P6+UZ8XFmc uv%0d9qJpqcC^?3V>KP4z(GVC7fzc2c4S~@R7!85Z5Eu=C(GVD-Apii$2ppsU literal 0 HcmV?d00001 diff --git a/README.md b/README.md new file mode 100644 index 0000000..516f7db --- /dev/null +++ b/README.md @@ -0,0 +1,23 @@ +# RUNREGEXP + +`runregexp` is a convenience script for running a series of tests against a regular expression. It is intended for use in testing regular expressions for use with the Golang Standard Library `regexp` module. It compiles a single regular expression from a test config file and calls its `MatchString` method on a number of supplied candidate strings, some of which are expected to match and others of which are not. In any case where the expectation is not met, it displays the offending input string. + +## Use + +Tests are put in a file called `tests.json` in the same directory from which the binary is run. + +This file has the following format: + +```json +{ + "test_expression": "regular_expression_to_test", + "fail_candidates": [ + "string_expected_NOT_to_match", + ... + ], + "succeed_candidates": [ + "string_expected_to_match", + ... + ] +} +```