purebred-mua / tasty-tmux

Terminal user acceptance testing via tmux
GNU Affero General Public License v3.0
6 stars 0 forks source link

switch to ByteString-based regexes #10

Closed frasertweedale closed 5 years ago

frasertweedale commented 5 years ago

regex-posix fails when the haystack (and presumably the pattern) contains high unicode codepoints. This is probably caused by the use of Foreign.C.String.withCAString in the RegexLike instance in Text.Regex.Posix.String (see [1]).

Change the Regex pattern type to be ByteString (this dispels the issue), and change the Regex check to use a ByteString as the haystack too. This change therefore "ripples out" throughout the API - Capture internally stores a ByteString and some of the other types and constructors also change.

[1] https://hackage.haskell.org/package/regex-posix-0.95.2/docs/src/Text-Regex-Posix-String.html#line-76).

Fixes: https://github.com/purebred-mua/tasty-tmux/issues/8