@@ -7,6 +7,7 @@ _ = require 'underscore'
7
7
CoffeeScript = require ' ./lib/coffeescript'
8
8
helpers = require ' ./lib/coffeescript/helpers'
9
9
{ setupConsole } = require ' ./build-support/console'
10
+ { PatternSet } = require ' ./build-support/patterns'
10
11
11
12
# ANSI Terminal Colors.
12
13
bold = red = green = yellow = reset = ' '
@@ -428,27 +429,6 @@ task 'bench', 'quick benchmark of compilation time', ->
428
429
console .log " total #{ fmt total } "
429
430
430
431
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
-
452
432
# Run the CoffeeScript test suite.
453
433
runTests = (CoffeeScript , {filePatterns , negFilePatterns , descPatterns , negDescPatterns } = {}) ->
454
434
CoffeeScript .register () unless global .testingBrowser
@@ -457,7 +437,7 @@ runTests = (CoffeeScript, {filePatterns, negFilePatterns, descPatterns, negDescP
457
437
negFilePatterns ?= PatternSet .empty {negated : yes }
458
438
descPatterns ?= PatternSet .empty ()
459
439
negDescPatterns ?= PatternSet .empty {negated : yes }
460
- console .dir {filePatterns, negFilePatterns, descPatterns, negDescPatterns}
440
+ console .dir . debug {filePatterns, negFilePatterns, descPatterns, negDescPatterns}
461
441
462
442
# These are attached to `global` so that they’re accessible from within
463
443
# `test/async.coffee`, which has an async-capable version of
@@ -577,9 +557,9 @@ option null, '--negDesc [REGEXP*]', 'test description patterns to negatively mat
577
557
578
558
task ' test' , ' run the CoffeeScript language test suite' , ({
579
559
file = [],
580
- negFile = [' sourcemap ' ],
560
+ negFile = [],
581
561
desc = [],
582
- negDesc = [' #4418 ' , ' #4558 ' , ' dynamic import assertion ' , ' assert keyword ' ],
562
+ negDesc = [],
583
563
} = {}) ->
584
564
testOptions =
585
565
filePatterns : new PatternSet file
0 commit comments