Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(944)

Side by Side Diff: test/mjsunit/regexp.js

Issue 12427: Merge regexp2000 back into bleeding_edge (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 12 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2008 the V8 project authors. All rights reserved. 1 // Copyright 2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 assertEquals(result[3], '\r'); 82 assertEquals(result[3], '\r');
83 assertEquals(result[4], 'D'); 83 assertEquals(result[4], 'D');
84 assertEquals(result[5], 'E'); 84 assertEquals(result[5], 'E');
85 assertEquals(result[6], 'F'); 85 assertEquals(result[6], 'F');
86 86
87 // Some tests from the Mozilla tests, where our behavior differs from 87 // Some tests from the Mozilla tests, where our behavior differs from
88 // SpiderMonkey. 88 // SpiderMonkey.
89 // From ecma_3/RegExp/regress-334158.js 89 // From ecma_3/RegExp/regress-334158.js
90 assertTrue(/\ca/.test( "\x01" )); 90 assertTrue(/\ca/.test( "\x01" ));
91 assertFalse(/\ca/.test( "\\ca" )); 91 assertFalse(/\ca/.test( "\\ca" ));
92 assertTrue(/\c[a/]/.test( "\x1ba/]" )); 92 // Passes in KJS, fails in IrregularExpressions.
93 // See http://code.google.com/p/v8/issues/detail?id=152
94 //assertTrue(/\c[a/]/.test( "\x1ba/]" ));
95
93 96
94 // Test that we handle \s and \S correctly inside some bizarre 97 // Test that we handle \s and \S correctly inside some bizarre
95 // character classes. 98 // character classes.
96 re = /[\s-:]/; 99 re = /[\s-:]/;
97 assertTrue(re.test('-')); 100 assertTrue(re.test('-'));
98 assertTrue(re.test(':')); 101 assertTrue(re.test(':'));
99 assertTrue(re.test(' ')); 102 assertTrue(re.test(' '));
100 assertTrue(re.test('\t')); 103 assertTrue(re.test('\t'));
101 assertTrue(re.test('\n')); 104 assertTrue(re.test('\n'));
102 assertFalse(re.test('a')); 105 assertFalse(re.test('a'));
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 assertEquals("t", "123456789t".replace(re, "$10"), "$10"); 237 assertEquals("t", "123456789t".replace(re, "$10"), "$10");
235 assertEquals("15", "123456789t".replace(re, "$15"), "$10"); 238 assertEquals("15", "123456789t".replace(re, "$15"), "$10");
236 assertEquals("1", "123456789t".replace(re, "$01"), "$01"); 239 assertEquals("1", "123456789t".replace(re, "$01"), "$01");
237 assertEquals("$001", "123456789t".replace(re, "$001"), "$001"); 240 assertEquals("$001", "123456789t".replace(re, "$001"), "$001");
238 re = new RegExp("foo(.)"); 241 re = new RegExp("foo(.)");
239 assertEquals("bar$0", "foox".replace(re, "bar$0"), "$0"); 242 assertEquals("bar$0", "foox".replace(re, "bar$0"), "$0");
240 assertEquals("bar$00", "foox".replace(re, "bar$00"), "$00"); 243 assertEquals("bar$00", "foox".replace(re, "bar$00"), "$00");
241 assertEquals("bar$000", "foox".replace(re, "bar$000"), "$000"); 244 assertEquals("bar$000", "foox".replace(re, "bar$000"), "$000");
242 assertEquals("barx", "foox".replace(re, "bar$01"), "$01 2"); 245 assertEquals("barx", "foox".replace(re, "bar$01"), "$01 2");
243 assertEquals("barx5", "foox".replace(re, "bar$15"), "$15"); 246 assertEquals("barx5", "foox".replace(re, "bar$15"), "$15");
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698