var test = require('../');
var ran = 0;

var concat = require('concat-stream');
var tap = require('tap');

tap.test('test SKIP comment', function (assert) {
    assert.plan(1);

    var verify = function (output) {
        assert.equal(output.toString('utf8'), [
            'TAP version 13',
            '# SKIP skipped',
            '',
            '1..0',
            '# tests 0',
            '# pass  0',
            '',
            '# ok',
            ''
        ].join('\n'));
    };

    var tapeTest = test.createHarness();
    tapeTest.createStream().pipe(concat(verify));
    tapeTest('skipped', { skip: true }, function (t) {
        t.end();
    });
});


test('do not skip this', { skip: false }, function(t) {
    t.pass('this should run');
    ran ++;
    t.end();
});

test('skip this', { skip: true }, function(t) {
    t.fail('this should not even run');
	ran++;
    t.end();
});

test.skip('skip this too', function(t) {
    t.fail('this should not even run');
	ran++;
    t.end();
});

test('skip subtest', function(t) {
    ran ++;
    t.test('do not skip this', { skip: false }, function(t) {
        ran ++;
        t.pass('this should run');
        t.end();
    });
    t.test('skip this', { skip: true }, function(t) {
        t.fail('this should not even run');
        t.end();
    });
    t.end();
});

test('right number of tests ran', function(t) {
    t.equal(ran, 3, 'ran the right number of tests');
    t.end();
});

// vim: set softtabstop=4 shiftwidth=4:

@@ -664,126 +664,8 @@
 );%0A%0A
-%0Atest('do not skip this', %7B skip: false %7D, function(t) %7B%0A    t.pass('this should run');%0A    ran ++;%0A    t.end();%0A%7D);%0A%0A
 test
@@ -847,33 +847,36 @@
 not even run');%0A
-%09
+    
 ran++;%0A    t.end
@@ -922,25 +922,24 @@
 t) %7B%0A    ran
- 
 ++;%0A    t.te
@@ -946,374 +946,116 @@
 st('
-do not skip this', %7B skip: false %7D, function(t) %7B%0A        ran ++;%0A        t.pass('this should run');%0A        t.end();%0A    %7D);%0A    t.test('skip this', %7B skip: true %7D, function(t) %7B%0A        t.fail('this should not even run');%0A        t.end();%0A    %7D);%0A    t.end();%0A%7D);%0A%0Atest('right number of tests ran', function(t) %7B%0A    t.equal(ran, 3, 'ran the right number of tests'
+skip this', %7B skip: true %7D, function(t) %7B%0A        t.fail('this should not even run');%0A        t.end();%0A    %7D
 );%0A 

remove redundant tests from test/skip.js - still testing the documented API adequately