Test.Runner.UnitNode.Glob

A tiny shell-style glob, enough to select tests by name on the CLI.

matches : String -> String -> Bool
  • * matches zero or more characters
  • ? matches exactly one character
  • everything else is literal
matches "Format.*"        "Format.imports"       --> True
matches "*in place*"      "writes file in place" --> True
matches "Format.?mports"  "Format.imports"       --> True
matches "Format.x"        "Format.imports"       --> False

Matching is whole-string (anchored at both ends); wrap a pattern in *…* for a substring search. Implemented as a classic two-cursor backtracking matcher over Array Char — no regex dependency.