2010-04-03 10:39:32 -04:00
|
|
|
# Regular expression literals.
|
2010-02-27 14:30:14 -05:00
|
|
|
ok 'x'.match(/x/g)
|
|
|
|
ok 'x'.match /x/g
|
|
|
|
ok 'x'.match(/x/)
|
|
|
|
ok 'x'.match /x/
|
|
|
|
|
|
|
|
ok 4 / 2 / 1 is 2
|
|
|
|
|
2010-07-25 01:23:37 -04:00
|
|
|
y = 4
|
|
|
|
x = 2
|
|
|
|
g = 1
|
2010-02-27 14:30:14 -05:00
|
|
|
|
2010-03-08 22:25:06 -05:00
|
|
|
ok y / x/g is 2
|
|
|
|
|
2010-07-25 01:23:37 -04:00
|
|
|
obj = {
|
2010-05-14 09:14:41 -04:00
|
|
|
width: -> 10
|
|
|
|
height: -> 20
|
|
|
|
}
|
2010-07-25 01:23:37 -04:00
|
|
|
id = 2
|
2010-05-14 09:14:41 -04:00
|
|
|
|
|
|
|
ok (obj.width()/id - obj.height()/id) is -5
|
2010-10-03 19:22:42 -04:00
|
|
|
|
2010-10-11 20:35:59 -04:00
|
|
|
eq /\\/.source, "\\\\"
|
|
|
|
|
|
|
|
|
2010-10-03 22:55:49 -04:00
|
|
|
eq /^I'm\s+Heregex?\/\/\//gim + '', ///
|
|
|
|
^ I'm \s+ Heregex? / // # or not
|
2010-10-03 19:22:42 -04:00
|
|
|
///gim + ''
|
2010-10-04 14:30:48 -04:00
|
|
|
eq '\\\\#{}\\\\\\\"', ///
|
2010-10-03 19:22:42 -04:00
|
|
|
#{
|
2010-10-04 08:50:50 -04:00
|
|
|
"#{ '\\' }" # normal comment
|
2010-10-03 19:22:42 -04:00
|
|
|
}
|
2010-10-04 08:50:50 -04:00
|
|
|
# regex comment
|
2010-10-03 19:22:42 -04:00
|
|
|
\#{}
|
2010-10-04 14:30:48 -04:00
|
|
|
\\ \"
|
2010-10-03 19:22:42 -04:00
|
|
|
///.source
|
2010-10-03 22:55:49 -04:00
|
|
|
eq /// /// + '', '/(?:)/'
|
2010-10-05 00:16:55 -04:00
|
|
|
|
|
|
|
|
2010-10-12 06:30:10 -04:00
|
|
|
#584: Unescaped slashes in character classes.
|
|
|
|
ok /:\/[/]goog/.test 'http://google.com'
|
|
|
|
|
|
|
|
|
|
|
|
#764: Should be indexable.
|
|
|
|
eq /0/['source'], ///#{0}///['source']
|