Project

General

Profile

Bug #13671 » test.rb

Same test program as in the description - dschweisguth (Dave Schweisguth), 06/22/2017 11:18 PM

 
1
def test(description)
2
  begin
3
    yield
4
    puts "#{description} is OK"
5
  rescue RegexpError
6
    puts "#{description} raises RegexpError"
7
  end
8
end
9

    
10
test("ass, case-insensitive, special") { /(?<!ass)/i =~ '✨' }
11
test("bss, case-insensitive, special") { /(?<!bss)/i =~ '✨' }
12
test("as,  case-insensitive, special") { /(?<!as)/i  =~ '✨' }
13
test("ss,  case-insensitive, special") { /(?<!ss)/i  =~ '✨' }
14
test("ass, case-sensitive,   special") { /(?<!ass)/  =~ '✨' }
15
test("ass, case-insensitive, regular") { /(?<!ass)/i =~ 'x' }