Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Verify character class still non-empty after converting to byte class
For `[^\x00-\xff]`, while it is still treated as a full Unicode character class, it is not empty. For instance `≥` would still be matched. However, when `CharClass::to_byte_class` is called on it (as is done when using `regex::bytes::Regex::new` rather than `regex::Regex::new`), it _is_ now empty, since it excludes all possible bytes. This commit adds a test asserting that `regex::bytes::Regex::new` returns `Err` for this case (in accordance with rust-lang/regex#106) and adds an `is_empty` check to the result of calling `CharClass::to_byte_class`, which allows the test to pass.
- Loading branch information