File tree 2 files changed +31
-1
lines changed
2 files changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -644,8 +644,16 @@ class TapParser extends Transform {
644
644
}
645
645
646
646
const planEnd = this . #next( ) ;
647
- if ( planEnd ? .kind !== TokenKind . NUMERIC ) {
647
+ if ( ! planEnd || planEnd . kind !== TokenKind . NUMERIC ) {
648
648
this . #error( 'Expected a plan end count' ) ;
649
+ const node = {
650
+ kind : TokenKind . UNKNOWN ,
651
+ node : {
652
+ value : this . #currentChunkAsString,
653
+ } ,
654
+ } ;
655
+
656
+ return node ;
649
657
}
650
658
651
659
const plan = {
Original file line number Diff line number Diff line change @@ -17,6 +17,28 @@ const cases = [
17
17
} ,
18
18
] ,
19
19
} ,
20
+ {
21
+ input : '123' ,
22
+ expected : [
23
+ {
24
+ kind : 'Unknown' ,
25
+ node : { value : '123' } ,
26
+ nesting : 0 ,
27
+ lexeme : '123' ,
28
+ } ,
29
+ ] ,
30
+ } ,
31
+ {
32
+ input : '# 123' ,
33
+ expected : [
34
+ {
35
+ kind : 'Comment' ,
36
+ node : { comment : '123' } ,
37
+ nesting : 0 ,
38
+ lexeme : '# 123' ,
39
+ } ,
40
+ ] ,
41
+ } ,
20
42
{
21
43
input : 'invalid tap' ,
22
44
expected : [
You can’t perform that action at this time.
0 commit comments