From 1ee89811c7bf8fc124e318ca01a605d3dfff1589 Mon Sep 17 00:00:00 2001 From: murphy Date: Thu, 5 Feb 2009 23:45:16 +0000 Subject: Ruby scanner: Fixed rarely used \c, \C-, and \M- escape sequences. * JavaScript scanner: elaborate a comment * SimpleRegexpScanner: Just some testing with the Ruby stack. * coderay-lib.tmproj: I should just remove it from the repo... --- test/scanners/ruby/regexp.in.rb | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'test/scanners/ruby/regexp.in.rb') diff --git a/test/scanners/ruby/regexp.in.rb b/test/scanners/ruby/regexp.in.rb index 956e6b8..e10e7a8 100644 --- a/test/scanners/ruby/regexp.in.rb +++ b/test/scanners/ruby/regexp.in.rb @@ -2,4 +2,17 @@ some_string.to_i /\s+/ some_string.split / +/ this is a regexp after a division / some_string.split / + / this one, too / -some_string.split /- / # and this one is a regexp without division \ No newline at end of file +some_string.split /- / # and this one is a regexp without division + +it "allows substitution to interact with other Regexp constructs" do + str = "foo)|(bar" + /(#{str})/.should == /(foo)|(bar)/ + + str = "a" + /[#{str}-z]/.should == /[a-z]/ + + not_compliant_on(:ruby) do + str = "J" + re = /\c#{str}/.should == /\cJ/ + end +end \ No newline at end of file -- cgit v1.2.1