Skip to content

Exhaustive testing & validation #18

@PacificBird

Description

@PacificBird

While writing new cookbook items, I realized that not only were our doctests incomplete, but that we cannot ship 1.0.0 as a truly stable and reliable crate for making 100% compile-checked regex if we do not exhaustively test every function which makes an assumption about the contents of it's input. Every function must be absolutely guaranteed to produce valid regex if it's inputs are valid regex, and we have a small enough list of functions that this is a feasible thing to do.

Again, for any function which makes an assumption about it's inputs (such as the negation functions), we can simply write tests to check every possible case, since the number of cases are limited to the constructor functions we have (like digit(), the ASCII classes, etc.). For the functions which make no assumptions about their inputs it's enough to show that the operation cannot possibly transform valid regex into invalid regex.

Transformer functions:

  • or
  • bitor
  • xor
  • and
  • bitand
  • subtract
  • not for SymbolClass<Standard>
  • not for SymbolClass<Custom>
  • not for SymbolClass<Ascii>
  • not for LiteralSymbolChain
  • capture
  • named_capture
  • case_insensitive
  • multi_line_mode
  • dot_matches_newline_too
  • Quantifier::lazy
  • add
  • at_least
  • between
  • one_or_more
  • zero_or_more
  • zero_or_one
  • exactly

Constructor functions (trivial, just double check that all are correct):

  • any
  • none
  • digit
  • non_digit
  • whitespace
  • non_whitespace
  • word
  • non_word
  • unicode_category
  • unicode_script
  • within_range
  • without_range
  • alphanumeric
  • alphabetic
  • ascii
  • blank
  • control
  • graphical
  • uppercase
  • lowercase
  • printable
  • punctuation
  • hexdigit
  • beginning
  • end
  • beginning_of_text
  • end_of_text
  • word_boundary
  • non_word_boundary
  • text
  • escape_all

Metadata

Metadata

Assignees

Labels

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions