From 802cf70f684a4ddf6d5c4f0f7cdf9c44787a56a2 Mon Sep 17 00:00:00 2001 From: isaacs Date: Sat, 24 Jun 2017 23:35:51 -0700 Subject: [PATCH] update 'only' output test --- test/test/only--bail--buffer.tap | 44 +++++++++++++++++++++++++------- test/test/only--bail.tap | 44 +++++++++++++++++++++++++------- test/test/only--buffer.tap | 44 +++++++++++++++++++++++++------- test/test/only.js | 5 ++++ test/test/only.tap | 44 +++++++++++++++++++++++++------- 5 files changed, 145 insertions(+), 36 deletions(-) diff --git a/test/test/only--bail--buffer.tap b/test/test/only--bail--buffer.tap index 9a0f491b4..e053f12a9 100644 --- a/test/test/only--bail--buffer.tap +++ b/test/test/only--bail--buffer.tap @@ -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)?/~~~ @@ -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)?/~~~ } @@ -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)?/~~~ } diff --git a/test/test/only--bail.tap b/test/test/only--bail.tap index da3820577..86b697bb7 100644 --- a/test/test/only--bail.tap +++ b/test/test/only--bail.tap @@ -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)?/~~~ @@ -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)?/~~~ @@ -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)?/~~~ diff --git a/test/test/only--buffer.tap b/test/test/only--buffer.tap index 9a0f491b4..e053f12a9 100644 --- a/test/test/only--buffer.tap +++ b/test/test/only--buffer.tap @@ -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)?/~~~ @@ -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)?/~~~ } @@ -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)?/~~~ } diff --git a/test/test/only.js b/test/test/only.js index a5208f9f2..ac3942ed0 100644 --- a/test/test/only.js +++ b/test/test/only.js @@ -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() diff --git a/test/test/only.tap b/test/test/only.tap index da3820577..86b697bb7 100644 --- a/test/test/only.tap +++ b/test/test/only.tap @@ -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)?/~~~ @@ -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)?/~~~ @@ -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)?/~~~