1 var safe = require('../');
2 var test = require('tape');
6 /\b(Oakland|San Francisco)\b/i,
9 /^\d+(1337|404)*\d+$/i,
10 RegExp(Array(26).join('a?') + Array(26).join('a')),
13 test('safe regex', function (t) {
15 good.forEach(function (re) {
16 t.equal(safe(re), true);
23 RegExp(Array(27).join('a?') + Array(27).join('a')),
31 test('unsafe regex', function (t) {
33 bad.forEach(function (re) {
34 t.equal(safe(re), false);
45 test('invalid regex', function (t) {
46 t.plan(invalid.length);
47 invalid.forEach(function (re) {
48 t.equal(safe(re), false);