Skip to content

Commit

Permalink
[Tests] GetSubstitution: add cases
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Aug 8, 2021
1 parent 63382b5 commit bcf0fd2
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -2294,6 +2294,18 @@ var es2015 = function ES2015(ES, ops, expectedMissing, skips) {
'supports $` at position > 0'
);

// https://github.com/tc39/ecma262/pull/2484#discussion_r684725247
t.equal(
ES.GetSubstitution('1234567', 'abc', 0, [], ">$'<"),
'><',
'match is longer than the input string'
);
t.equal(
ES.GetSubstitution('x', 'abc', 3, [], ">$'<"),
'><',
'nonempty match at the end pf the input string'

This comment has been minimized.

Copy link
@jmdyck

jmdyck Sep 15, 2021

s/pf/of/

This comment has been minimized.

Copy link
@ljharb

ljharb Sep 15, 2021

Author Owner

oops, thanks, fixed in 42d903e

);

t.equal(
ES.GetSubstitution('def', 'abcdefghi', 7, [], ">$'<"),
'><',
Expand Down

0 comments on commit bcf0fd2

Please sign in to comment.