commit a6277c3386856eba303ec9824c6ff49a5b10e49e Author: Joshua Date: Fri Sep 20 08:14:27 2024 -0400 initial commit 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 0000000..89b204f Binary files /dev/null and b/.gitignore.swp differ 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", + ... + ] +} +```