Skip to content
This repository was archived by the owner on Oct 30, 2020. It is now read-only.

Commit dd89ef5

Browse files
committed
Tests: More failing </script> fun
1 parent f2eb86a commit dd89ef5

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

spec/runner.coffee

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ describe 'Runner', ->
366366
chai.expect(err.message).to.contain 'TIMEOUT'
367367
done()
368368

369-
describe 'input data containing </script>', ->
369+
describe 'input data containing <script>...</script>', ->
370370
it 'should succeed', (done) ->
371371
filter = local 'return-input'
372372
input = { 'foo': 'barbaz', 'htmlscript': '<script>alert("Works!")</script>' }
@@ -376,6 +376,26 @@ describe 'Runner', ->
376376
chai.expect(solution).to.eql input
377377
done()
378378

379+
describe 'input data containing </script>...<script>', ->
380+
it 'should succeed', (done) ->
381+
filter = local 'return-input'
382+
input = { 'foo': 'barbaz', 'htmlbogusscript': '</script> <script>alert("Works!")</script> <script>' }
383+
options = {}
384+
solver.runJob filter, input, options, (err, solution, details) ->
385+
chai.expect(err).to.not.exist
386+
chai.expect(solution).to.eql input
387+
done()
388+
389+
describe 'input data containing HTML comment', ->
390+
it 'should succeed', (done) ->
391+
filter = local 'return-input'
392+
input = { 'foo': 'barbaz', 'htmlcomment': '<!-- FFOO -->' }
393+
options = {}
394+
solver.runJob filter, input, options, (err, solution, details) ->
395+
chai.expect(err).to.not.exist
396+
chai.expect(solution).to.eql input
397+
done()
398+
379399
describe 'filter with infinite loop', ->
380400
it 'should timeout and return error', (done) ->
381401
@timeout 9000

0 commit comments

Comments
 (0)