Skip to content

Commit

Permalink
Missed: added 's' in toString() + test.
Browse files Browse the repository at this point in the history
  • Loading branch information
uhop committed Jun 12, 2022
1 parent d2ed5bf commit 877d044
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/to_string.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ NAN_METHOD(WrappedRE2::ToString)
{
buffer += "m";
}
if (re2->dotAll)
{
buffer += "s";
}
buffer += "u";
if (re2->sticky)
{
Expand Down
1 change: 1 addition & 0 deletions tests/test_toString.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ unit.add(module, [
eval(t.TEST("RE2('^a{2,}', 'mi') + '' === '/^a{2,}/imu'"));
eval(t.TEST("RE2('^a{5}$', 'gim') + '' === '/^a{5}$/gimu'"));
eval(t.TEST("RE2('\\\\u{1F603}/', 'iy') + '' === '/\\\\u{1F603}\\\\//iuy'"));
eval(t.TEST("RE2('^a{2,}', 'smi') + '' === '/^a{2,}/imsu'"));

eval(t.TEST("RE2('c', 'ug').toString() === '/c/gu'"));
eval(t.TEST("RE2('d', 'um').toString() === '/d/mu'"));
Expand Down

0 comments on commit 877d044

Please sign in to comment.