diff --git a/test/index.js b/test/index.js index 553a01a..30d2d4b 100644 --- a/test/index.js +++ b/test/index.js @@ -40,3 +40,14 @@ test ('copy object', (t) => { t.is (copy.foo, 'baz'); t.is (obj.foo, 'bar'); }); + +test ('run regex', (t) => { + const data = 'foobarfoo'; + const regex = /foo/gu; + let count = 0; + util.run_regex(regex,data,(res)=>{ + t.is(res[0], 'foo'); + count++; + }) + t.is(count, 2); +});