You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
869 B
Markdown
24 lines
869 B
Markdown
# 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",
|
|
...
|
|
]
|
|
}
|
|
```
|