Skip to content

Commit

Permalink
Unit test for regexp_escape
Browse files Browse the repository at this point in the history
  • Loading branch information
mvidner committed Mar 21, 2018
1 parent 8cf7878 commit c11c04a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
Empty file.
3 changes: 3 additions & 0 deletions testsuite/tests/regexp_escape.out
@@ -0,0 +1,3 @@
Read .target.tmpdir nil
Log Failed to set temporary directory: nil
Dump regexp_escape
19 changes: 19 additions & 0 deletions testsuite/tests/regexp_escape.ycp
@@ -0,0 +1,19 @@
{
include "testsuite.ycp";
import "Assert";

import "Restore";

DUMP("regexp_escape");

Assert::Equal("",
Restore::regexp_escape(""));
Assert::Equal("nothing 2 escape HERE!",
Restore::regexp_escape("nothing 2 escape HERE!"));
Assert::Equal("\\\\",
Restore::regexp_escape("\\"));
Assert::Equal("\\$foo\\+\\+-3\\.14",
Restore::regexp_escape("$foo++-3.14"));
Assert::Equal("\\.\\^\\$\\*\\+\\?\\(\\)\\[\\]\\{\\}\\|\\\\",
Restore::regexp_escape(".^$*+?()[]{}|\\"));
}

0 comments on commit c11c04a

Please sign in to comment.