Skip to content

Commit

Permalink
update 'only' output test
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Jun 25, 2017
1 parent dc67c58 commit 802cf70
Show file tree
Hide file tree
Showing 5 changed files with 145 additions and 36 deletions.
44 changes: 35 additions & 9 deletions test/test/only--bail--buffer.tap
Expand Up @@ -11,31 +11,47 @@ ok 1 - ___/.*(node|iojs)(.exe)?.*/~~~only.js child ___/# time=[0-9.]+(ms)?/~~~ {
1..1
}

1..2
# "only" has `only` set but all tests run
ok 3 - only ___/# time=[0-9.]+(ms)?/~~~ {
ok 1 - only do this
1..1
}

1..3
___/# time=[0-9.]+(ms)?/~~~
}

ok 2 - ___/.*(node|iojs)(.exe)?.*/~~~only.js child ___/# time=[0-9.]+(ms)?/~~~ {
ok 1 - normal # SKIP
ok 1 - normal # SKIP filter: only
# Subtest: only
ok 1 - only do this
1..1
ok 2 - only ___/# time=[0-9.]+(ms)?/~~~

1..2
# Subtest: only
ok 1 - only do this
1..1
ok 3 - only ___/# time=[0-9.]+(ms)?/~~~

1..3
# skip: 1
___/# time=[0-9.]+(ms)?/~~~
}

ok 3 - ___/.*(node|iojs)(.exe)?/~~~ ./bin/run.js ___/.*/~~~only.js --test-arg=child ___/# time=[0-9.]+(ms)?/~~~ {
# Subtest: ___/.*/~~~only.js
ok 1 - normal # SKIP
ok 1 - normal # SKIP filter: only
# Subtest: only
ok 1 - only do this
1..1
ok 2 - only ___/# time=[0-9.]+(ms)?/~~~

1..2
# Subtest: only
ok 1 - only do this
1..1
ok 3 - only ___/# time=[0-9.]+(ms)?/~~~

1..3
# skip: 1
___/# time=[0-9.]+(ms)?/~~~
ok 1 - ___/.*/~~~only.js ___/# time=[0-9.]+(ms)?/~~~
Expand All @@ -46,13 +62,18 @@ ok 3 - ___/.*(node|iojs)(.exe)?/~~~ ./bin/run.js ___/.*/~~~only.js --test-arg=ch

ok 4 - ___/.*(node|iojs)(.exe)?/~~~ ./bin/run.js ___/.*/~~~only.js --test-arg=child --only ___/# time=[0-9.]+(ms)?/~~~ {
ok 1 - ___/.*/~~~only.js ___/# time=[0-9.]+(ms)?/~~~ {
ok 1 - normal # SKIP
ok 1 - normal # SKIP filter: only
ok 2 - only ___/# time=[0-9.]+(ms)?/~~~ {
ok 1 - only do this
1..1
}

1..2
ok 3 - only ___/# time=[0-9.]+(ms)?/~~~ {
ok 1 - only do this
1..1
}

1..3
# skip: 1
___/# time=[0-9.]+(ms)?/~~~
}
Expand All @@ -63,13 +84,18 @@ ok 4 - ___/.*(node|iojs)(.exe)?/~~~ ./bin/run.js ___/.*/~~~only.js --test-arg=ch

ok 5 - ___/.*(node|iojs)(.exe)?/~~~ ./bin/run.js ___/.*/~~~only.js --test-arg=child -O ___/# time=[0-9.]+(ms)?/~~~ {
ok 1 - ___/.*/~~~only.js ___/# time=[0-9.]+(ms)?/~~~ {
ok 1 - normal # SKIP
ok 1 - normal # SKIP filter: only
ok 2 - only ___/# time=[0-9.]+(ms)?/~~~ {
ok 1 - only do this
1..1
}

1..2
ok 3 - only ___/# time=[0-9.]+(ms)?/~~~ {
ok 1 - only do this
1..1
}

1..3
# skip: 1
___/# time=[0-9.]+(ms)?/~~~
}
Expand Down
44 changes: 35 additions & 9 deletions test/test/only--bail.tap
Expand Up @@ -11,31 +11,47 @@ TAP version 13
1..1
ok 2 - only ___/# time=[0-9.]+(ms)?/~~~

1..2
# "only" has `only` set but all tests run
# Subtest: only
ok 1 - only do this
1..1
ok 3 - only ___/# time=[0-9.]+(ms)?/~~~

1..3
___/# time=[0-9.]+(ms)?/~~~
ok 1 - ___/.*(node|iojs)(.exe)?.*/~~~only.js child ___/# time=[0-9.]+(ms)?/~~~

# Subtest: ___/.*(node|iojs)(.exe)?.*/~~~only.js child
ok 1 - normal # SKIP
ok 1 - normal # SKIP filter: only
# Subtest: only
ok 1 - only do this
1..1
ok 2 - only ___/# time=[0-9.]+(ms)?/~~~

1..2
# Subtest: only
ok 1 - only do this
1..1
ok 3 - only ___/# time=[0-9.]+(ms)?/~~~

1..3
# skip: 1
___/# time=[0-9.]+(ms)?/~~~
ok 2 - ___/.*(node|iojs)(.exe)?.*/~~~only.js child ___/# time=[0-9.]+(ms)?/~~~

# Subtest: ___/.*(node|iojs)(.exe)?/~~~ ./bin/run.js ___/.*/~~~only.js --test-arg=child
# Subtest: ___/.*/~~~only.js
ok 1 - normal # SKIP
ok 1 - normal # SKIP filter: only
# Subtest: only
ok 1 - only do this
1..1
ok 2 - only ___/# time=[0-9.]+(ms)?/~~~

1..2
# Subtest: only
ok 1 - only do this
1..1
ok 3 - only ___/# time=[0-9.]+(ms)?/~~~

1..3
# skip: 1
___/# time=[0-9.]+(ms)?/~~~
ok 1 - ___/.*/~~~only.js ___/# time=[0-9.]+(ms)?/~~~
Expand All @@ -46,13 +62,18 @@ ok 3 - ___/.*(node|iojs)(.exe)?/~~~ ./bin/run.js ___/.*/~~~only.js --test-arg=ch

# Subtest: ___/.*(node|iojs)(.exe)?/~~~ ./bin/run.js ___/.*/~~~only.js --test-arg=child --only
# Subtest: ___/.*/~~~only.js
ok 1 - normal # SKIP
ok 1 - normal # SKIP filter: only
# Subtest: only
ok 1 - only do this
1..1
ok 2 - only ___/# time=[0-9.]+(ms)?/~~~

1..2
# Subtest: only
ok 1 - only do this
1..1
ok 3 - only ___/# time=[0-9.]+(ms)?/~~~

1..3
# skip: 1
___/# time=[0-9.]+(ms)?/~~~
ok 1 - ___/.*/~~~only.js ___/# time=[0-9.]+(ms)?/~~~
Expand All @@ -63,13 +84,18 @@ ok 4 - ___/.*(node|iojs)(.exe)?/~~~ ./bin/run.js ___/.*/~~~only.js --test-arg=ch

# Subtest: ___/.*(node|iojs)(.exe)?/~~~ ./bin/run.js ___/.*/~~~only.js --test-arg=child -O
# Subtest: ___/.*/~~~only.js
ok 1 - normal # SKIP
ok 1 - normal # SKIP filter: only
# Subtest: only
ok 1 - only do this
1..1
ok 2 - only ___/# time=[0-9.]+(ms)?/~~~

1..2
# Subtest: only
ok 1 - only do this
1..1
ok 3 - only ___/# time=[0-9.]+(ms)?/~~~

1..3
# skip: 1
___/# time=[0-9.]+(ms)?/~~~
ok 1 - ___/.*/~~~only.js ___/# time=[0-9.]+(ms)?/~~~
Expand Down
44 changes: 35 additions & 9 deletions test/test/only--buffer.tap
Expand Up @@ -11,31 +11,47 @@ ok 1 - ___/.*(node|iojs)(.exe)?.*/~~~only.js child ___/# time=[0-9.]+(ms)?/~~~ {
1..1
}

1..2
# "only" has `only` set but all tests run
ok 3 - only ___/# time=[0-9.]+(ms)?/~~~ {
ok 1 - only do this
1..1
}

1..3
___/# time=[0-9.]+(ms)?/~~~
}

ok 2 - ___/.*(node|iojs)(.exe)?.*/~~~only.js child ___/# time=[0-9.]+(ms)?/~~~ {
ok 1 - normal # SKIP
ok 1 - normal # SKIP filter: only
# Subtest: only
ok 1 - only do this
1..1
ok 2 - only ___/# time=[0-9.]+(ms)?/~~~

1..2
# Subtest: only
ok 1 - only do this
1..1
ok 3 - only ___/# time=[0-9.]+(ms)?/~~~

1..3
# skip: 1
___/# time=[0-9.]+(ms)?/~~~
}

ok 3 - ___/.*(node|iojs)(.exe)?/~~~ ./bin/run.js ___/.*/~~~only.js --test-arg=child ___/# time=[0-9.]+(ms)?/~~~ {
# Subtest: ___/.*/~~~only.js
ok 1 - normal # SKIP
ok 1 - normal # SKIP filter: only
# Subtest: only
ok 1 - only do this
1..1
ok 2 - only ___/# time=[0-9.]+(ms)?/~~~

1..2
# Subtest: only
ok 1 - only do this
1..1
ok 3 - only ___/# time=[0-9.]+(ms)?/~~~

1..3
# skip: 1
___/# time=[0-9.]+(ms)?/~~~
ok 1 - ___/.*/~~~only.js ___/# time=[0-9.]+(ms)?/~~~
Expand All @@ -46,13 +62,18 @@ ok 3 - ___/.*(node|iojs)(.exe)?/~~~ ./bin/run.js ___/.*/~~~only.js --test-arg=ch

ok 4 - ___/.*(node|iojs)(.exe)?/~~~ ./bin/run.js ___/.*/~~~only.js --test-arg=child --only ___/# time=[0-9.]+(ms)?/~~~ {
ok 1 - ___/.*/~~~only.js ___/# time=[0-9.]+(ms)?/~~~ {
ok 1 - normal # SKIP
ok 1 - normal # SKIP filter: only
ok 2 - only ___/# time=[0-9.]+(ms)?/~~~ {
ok 1 - only do this
1..1
}

1..2
ok 3 - only ___/# time=[0-9.]+(ms)?/~~~ {
ok 1 - only do this
1..1
}

1..3
# skip: 1
___/# time=[0-9.]+(ms)?/~~~
}
Expand All @@ -63,13 +84,18 @@ ok 4 - ___/.*(node|iojs)(.exe)?/~~~ ./bin/run.js ___/.*/~~~only.js --test-arg=ch

ok 5 - ___/.*(node|iojs)(.exe)?/~~~ ./bin/run.js ___/.*/~~~only.js --test-arg=child -O ___/# time=[0-9.]+(ms)?/~~~ {
ok 1 - ___/.*/~~~only.js ___/# time=[0-9.]+(ms)?/~~~ {
ok 1 - normal # SKIP
ok 1 - normal # SKIP filter: only
ok 2 - only ___/# time=[0-9.]+(ms)?/~~~ {
ok 1 - only do this
1..1
}

1..2
ok 3 - only ___/# time=[0-9.]+(ms)?/~~~ {
ok 1 - only do this
1..1
}

1..3
# skip: 1
___/# time=[0-9.]+(ms)?/~~~
}
Expand Down
5 changes: 5 additions & 0 deletions test/test/only.js
Expand Up @@ -8,6 +8,11 @@ if (process.argv[2] === 'child') {
t.end()
})

t.only('only', function (t) {
t.pass('only do this')
t.end()
})

t.test('only', { only: true }, function (t) {
t.pass('only do this')
t.end()
Expand Down
44 changes: 35 additions & 9 deletions test/test/only.tap
Expand Up @@ -11,31 +11,47 @@ TAP version 13
1..1
ok 2 - only ___/# time=[0-9.]+(ms)?/~~~

1..2
# "only" has `only` set but all tests run
# Subtest: only
ok 1 - only do this
1..1
ok 3 - only ___/# time=[0-9.]+(ms)?/~~~

1..3
___/# time=[0-9.]+(ms)?/~~~
ok 1 - ___/.*(node|iojs)(.exe)?.*/~~~only.js child ___/# time=[0-9.]+(ms)?/~~~

# Subtest: ___/.*(node|iojs)(.exe)?.*/~~~only.js child
ok 1 - normal # SKIP
ok 1 - normal # SKIP filter: only
# Subtest: only
ok 1 - only do this
1..1
ok 2 - only ___/# time=[0-9.]+(ms)?/~~~

1..2
# Subtest: only
ok 1 - only do this
1..1
ok 3 - only ___/# time=[0-9.]+(ms)?/~~~

1..3
# skip: 1
___/# time=[0-9.]+(ms)?/~~~
ok 2 - ___/.*(node|iojs)(.exe)?.*/~~~only.js child ___/# time=[0-9.]+(ms)?/~~~

# Subtest: ___/.*(node|iojs)(.exe)?/~~~ ./bin/run.js ___/.*/~~~only.js --test-arg=child
# Subtest: ___/.*/~~~only.js
ok 1 - normal # SKIP
ok 1 - normal # SKIP filter: only
# Subtest: only
ok 1 - only do this
1..1
ok 2 - only ___/# time=[0-9.]+(ms)?/~~~

1..2
# Subtest: only
ok 1 - only do this
1..1
ok 3 - only ___/# time=[0-9.]+(ms)?/~~~

1..3
# skip: 1
___/# time=[0-9.]+(ms)?/~~~
ok 1 - ___/.*/~~~only.js ___/# time=[0-9.]+(ms)?/~~~
Expand All @@ -46,13 +62,18 @@ ok 3 - ___/.*(node|iojs)(.exe)?/~~~ ./bin/run.js ___/.*/~~~only.js --test-arg=ch

# Subtest: ___/.*(node|iojs)(.exe)?/~~~ ./bin/run.js ___/.*/~~~only.js --test-arg=child --only
# Subtest: ___/.*/~~~only.js
ok 1 - normal # SKIP
ok 1 - normal # SKIP filter: only
# Subtest: only
ok 1 - only do this
1..1
ok 2 - only ___/# time=[0-9.]+(ms)?/~~~

1..2
# Subtest: only
ok 1 - only do this
1..1
ok 3 - only ___/# time=[0-9.]+(ms)?/~~~

1..3
# skip: 1
___/# time=[0-9.]+(ms)?/~~~
ok 1 - ___/.*/~~~only.js ___/# time=[0-9.]+(ms)?/~~~
Expand All @@ -63,13 +84,18 @@ ok 4 - ___/.*(node|iojs)(.exe)?/~~~ ./bin/run.js ___/.*/~~~only.js --test-arg=ch

# Subtest: ___/.*(node|iojs)(.exe)?/~~~ ./bin/run.js ___/.*/~~~only.js --test-arg=child -O
# Subtest: ___/.*/~~~only.js
ok 1 - normal # SKIP
ok 1 - normal # SKIP filter: only
# Subtest: only
ok 1 - only do this
1..1
ok 2 - only ___/# time=[0-9.]+(ms)?/~~~

1..2
# Subtest: only
ok 1 - only do this
1..1
ok 3 - only ___/# time=[0-9.]+(ms)?/~~~

1..3
# skip: 1
___/# time=[0-9.]+(ms)?/~~~
ok 1 - ___/.*/~~~only.js ___/# time=[0-9.]+(ms)?/~~~
Expand Down

0 comments on commit 802cf70

Please sign in to comment.