Skip to content

Commit 130bfba

Browse files
committed
Slightly reorganize tests to match existing structure (#317)
1 parent e0b4403 commit 130bfba

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tests/spec/s-xregexp-methods.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1294,11 +1294,8 @@ describe('XRegExp.replace()', function() {
12941294
});
12951295

12961296
it('should throw an exception for backreferences to unknown group numbers when using named capture', function() {
1297-
expect(function() {XRegExp.replace('test', XRegExp('(?<n>t)'), '$2');}).toThrowError(SyntaxError);
12981297
expect(function() {XRegExp.replace('test', XRegExp('(?<n>t)'), '$<2>');}).toThrowError(SyntaxError);
1299-
13001298
// Native named capture introduced in ES2018
1301-
expect(function() {XRegExp.replace('test', /(?<n>t)/, '$2');}).toThrowError(SyntaxError);
13021299
expect(function() {XRegExp.replace('test', /(?<n>t)/, '$<2>');}).toThrowError(SyntaxError);
13031300
});
13041301

@@ -1351,6 +1348,12 @@ describe('XRegExp.replace()', function() {
13511348
expect(function() {XRegExp.replace('xa(a)a', 'a(a)', '$1b');}).toThrowError(SyntaxError);
13521349
});
13531350

1351+
it('should throw an exception for backreferences to unknown group numbers when using named capture', function() {
1352+
expect(function() {XRegExp.replace('test', XRegExp('(?<n>t)'), '$2');}).toThrowError(SyntaxError);
1353+
// Native named capture introduced in ES2018
1354+
expect(function() {XRegExp.replace('test', /(?<n>t)/, '$2');}).toThrowError(SyntaxError);
1355+
});
1356+
13541357
});
13551358

13561359
});

0 commit comments

Comments
 (0)