@@ -7,6 +7,7 @@ _ = require 'underscore'
77CoffeeScript = require ' ./lib/coffeescript'
88helpers = require ' ./lib/coffeescript/helpers'
99{ setupConsole } = require ' ./build-support/console'
10+ { PatternSet } = require ' ./build-support/patterns'
1011
1112# ANSI Terminal Colors.
1213bold = red = green = yellow = reset = ' '
@@ -428,27 +429,6 @@ task 'bench', 'quick benchmark of compilation time', ->
428429 console .log " total #{ fmt total } "
429430
430431
431- class PatternSet
432- constructor : (patternStrings = [], {@negated = no } = {}) ->
433- @matchers = (new RegExp p for p in patternStrings when p isnt ' ' )
434-
435- isEmpty : -> @matchers .length is 0
436-
437- iterMatchers : -> @matchers [Symbol .iterator ]()
438-
439- test_ : (arg ) -> @ iterMatchers ().some (m) -> m .exec arg
440-
441- allows : (arg ) ->
442- return yes if @ isEmpty ()
443- if @negated
444- not @ test_ arg
445- else
446- @ test_ arg
447-
448- @ fromCommaDelimitedList: (commaListStr ) => new @ (commaListStr ? ' ' ).split / ,/
449- @ empty: ({negated = no } = {}) => new @ [], {negated}
450-
451-
452432# Run the CoffeeScript test suite.
453433runTests = (CoffeeScript , {filePatterns , negFilePatterns , descPatterns , negDescPatterns } = {}) ->
454434 CoffeeScript .register () unless global .testingBrowser
@@ -457,7 +437,7 @@ runTests = (CoffeeScript, {filePatterns, negFilePatterns, descPatterns, negDescP
457437 negFilePatterns ?= PatternSet .empty {negated : yes }
458438 descPatterns ?= PatternSet .empty ()
459439 negDescPatterns ?= PatternSet .empty {negated : yes }
460- console .dir {filePatterns, negFilePatterns, descPatterns, negDescPatterns}
440+ console .dir . debug {filePatterns, negFilePatterns, descPatterns, negDescPatterns}
461441
462442 # These are attached to `global` so that they’re accessible from within
463443 # `test/async.coffee`, which has an async-capable version of
@@ -577,9 +557,9 @@ option null, '--negDesc [REGEXP*]', 'test description patterns to negatively mat
577557
578558task ' test' , ' run the CoffeeScript language test suite' , ({
579559 file = [],
580- negFile = [' sourcemap ' ],
560+ negFile = [],
581561 desc = [],
582- negDesc = [' #4418 ' , ' #4558 ' , ' dynamic import assertion ' , ' assert keyword ' ],
562+ negDesc = [],
583563} = {}) ->
584564 testOptions =
585565 filePatterns : new PatternSet file
0 commit comments