dot.dot.dot.exampol

This commit is contained in:
Captain Nick Lucifer* 2023-03-10 23:21:16 +05:45
commit a0bc2d79de
406 changed files with 34577 additions and 0 deletions

11
node_modules/tap/test/buffer_compare.js generated vendored Normal file
View file

@ -0,0 +1,11 @@
var test = require("../").test
test("same buffers", function (t) {
t.same(new Buffer([3,4,243]), new Buffer([3,4,243]))
t.end()
})
test("not same buffers", function (t) {
t.notSame(new Buffer([3,5,243]), new Buffer([3,4,243]))
t.end()
})

32
node_modules/tap/test/common.js generated vendored Normal file
View file

@ -0,0 +1,32 @@
exports.taps = ["Tests for the foo module"
,{ok:true, name:"test that the foo is fooish"
,file:"foo.js", line:8, name:"fooish test"
,stack:new Error("fooish").stack}
,{ok:false, name:"a test that the bar is barish"
,file:"bar.js", line:25
,expected:"bar\nbar\nbaz", actual:"rab\nrib\nzib"
,hash:{more:"\nstuff\nhere\n",regexp:/asdf/}}
,"Quux module tests"
,"This is a longer comment"
,{ok:true, name:"an easy one."}
,{ok:false, name:"bloooooo"
,expected:"blerggeyyy"
,actual:"blorggeyy"}
,{ok:false, name:"array test"
,expected:[{ok:true},{ok:true},{stack:new Error().stack}]
,actual:[1234567890,123456789,{error:new Error("yikes")}]}
,{ok:true, name:"nulltest"
,expected:undefined, actual:null}
,{ok:true, name:"weird key test"
,expected:"weird key"
,actual:"weird key"
,"this object":{"has a ":"weird key"
,"and a looooooooonnnnnnnnnggg":"jacket"}}
,{ok:true, name:"regexp test"
,regexp:/asdf/,function:function (a,b) { return a + b }}
]
if (require.main === module) {
console.log("1..1")
console.log("ok 1 - just setup, nothing relevant")
}

43
node_modules/tap/test/deep.js generated vendored Normal file
View file

@ -0,0 +1,43 @@
var tap = require("../")
, test = tap.test
test("deepEquals shouldn't care about key order", function (t) {
t.deepEqual({ a : 1, b : 2 }, { b : 2, a : 1 })
t.end()
})
test("deepEquals shouldn't care about key order recursively", function (t) {
t.deepEqual(
{ x : { a : 1, b : 2 }, y : { c : 3, d : 4 } },
{ y : { d : 4, c : 3 }, x : { b : 2, a : 1 } }
)
t.end()
})
test("deepEquals shoudn't care about key order but still might", function (t) {
t.deepEqual(
[ { foo:
{ z: 100
, y: 200
, x: 300 } }
, "bar"
, 11
, { baz:
{ d : 4
, a: 1
, b: 2
, c: 3 } } ]
, [ { foo :
{ z: 100
, y: 200
, x: 300 } }
, "bar"
, 11
, { baz:
{ a: 1
, b: 2
, c: 3
, d: 4 } } ]
)
t.end()
});

16
node_modules/tap/test/independent-timeouts.js generated vendored Normal file
View file

@ -0,0 +1,16 @@
// https://github.com/isaacs/node-tap/issues/23
var tap = require("../")
, test = tap.test
test("finishes in time", {timeout: 500}, function(t) {
setTimeout(function () {
t.end();
}, 300);
})
test("finishes in time too", {timeout: 500}, function(t) {
setTimeout(function () {
t.end();
}, 300);
})

16
node_modules/tap/test/isolated-conf-test.js generated vendored Normal file
View file

@ -0,0 +1,16 @@
// https://github.com/isaacs/node-tap/issues/24
var tap = require("../")
, test = tap.test
var config = {foo: "bar"}
test("one", config, function(t) {
t.equal(t.conf.foo, "bar")
t.equal(t.conf.name, "one") // before fix this would be "two"
t.end()
})
test("two", config, function(t) {
t.equal(t.conf.foo, "bar")
t.equal(t.conf.name, "two")
t.end()
})

73
node_modules/tap/test/meta-test.js generated vendored Normal file
View file

@ -0,0 +1,73 @@
var tap = require("../")
, test = tap.test
test("meta test", { skip: false }, function (t) {
function thr0w() { throw new Error('raburt') }
function noop () {}
// this also tests the ok/notOk functions
t.once("end", section2)
t.ok(true, "true is ok")
t.ok(noop, "function is ok")
t.ok({}, "object is ok")
t.ok(t, "t is ok")
t.ok(100, "number is ok")
t.ok("asdf", "string is ok")
t.notOk(false, "false is notOk")
t.notOk(0, "0 is notOk")
t.notOk(null, "null is notOk")
t.notOk(undefined, "undefined is notOk")
t.notOk(NaN, "NaN is notOk")
t.notOk("", "empty string is notOk")
t.throws(thr0w, "Thrower throws");
t.doesNotThrow(noop, "noop does not throw");
t.similar({foo:"bar", bar:"foo"}, {foo:"bar"}, "similar objects are ok");
t.dissimilar({}, {mandatory:"value"}, "dissimilar objects are ok");
t.dissimilar(null, {}, "null is dissimilar from an object, even with no keys");
// a few failures.
t.ifError(new Error("this is an error"))
t.ifError({ message: "this is a custom error" })
t.ok(false, "false is not ok")
t.notOk(true, "true is not not ok")
t.similar(null, {}, "Null is not similar to an object, even with no keys");
t.throws(noop, "noop does not throw");
t.throws(noop, new Error("Whoops!"), "noop does not throw an Error");
t.throws(noop, {name:"MyError", message:"Whoops!"}, "noop does not throw a MyError");
t.doesNotThrow(thr0w, "thrower does throw");
// things that are like other things
t.like("asdf", "asdf")
t.like("asdf", /^a.*f$/)
t.like(100, 100)
t.like(100, '100')
t.like(100, 100.0)
t.unlike("asdf", "fdsa")
t.unlike("asdf", /^you jelly, bro?/)
t.unlike(100, 100.1)
t.like(true, 1)
t.like(null, undefined)
t.like(true, [1])
t.like(false, [])
t.like('', [])
t.end()
function section2 () {
var results = t.results
t.clear()
t.ok(true, "sanity check")
t.notOk(results.ok, "not ok")
t.equal(results.tests, 39, "total test count")
t.equal(results.passTotal, 30, "tests passed")
t.equal(results.fail, 9, "tests failed")
t.type(results.ok, "boolean", "ok is boolean")
t.type(results.skip, "number", "skip is number")
t.type(results, "Results", "results isa Results")
t.type(t, "Test", "test isa Test")
t.type(t, "Harness", "test isa Harness")
t.end()
}
})

23
node_modules/tap/test/nested-test.js generated vendored Normal file
View file

@ -0,0 +1,23 @@
var tap = require("../"),
test = tap.test,
util = require('util');
test("parent", function (t) {
// TODO: Make grandchildren tests count?
t.plan(3);
t.ok(true, 'p test');
t.test("subtest", function (t) {
t.ok(true, 'ch test');
t.test('nested subtest', function(t) {
t.ok(true, 'grch test');
t.end();
});
t.end();
});
t.test('another subtest', function(t) {
t.ok(true, 'ch test 2');
t.end();
});
t.end();
})

12
node_modules/tap/test/non-tap-output.js generated vendored Normal file
View file

@ -0,0 +1,12 @@
console.log("everything is fine\n"
+"there are no errors\n"
+"this output is not haiku.\n\n"
+"is 8 ok?\n"
+"ok, 8 can stay.\n"
+"ok 100 might be confusing\n"
+" but: nevertheless, here we are\n"
+" this: is indented\n"
+" and: it\n"
+" might: ~\n"
+" be: yaml?\n"
+"ok done now, exiting")

25
node_modules/tap/test/result-trap.js generated vendored Normal file
View file

@ -0,0 +1,25 @@
var tap = require("../")
tap.test("trap result #TODO", function (t0) {
console.log("not ok 1 result event trapping #TODO")
return t0.end()
t0.plan(3)
var t1 = new(tap.Harness)(tap.Test).test()
t1.plan(1)
t1.on("result", function (res) {
if (res.wanted === 4) {
t0.equal(res.found, 3)
t0.equal(res.wanted, 4)
t0.end()
t1.end()
}
})
t1.equal(1 + 2, 4)
})

16
node_modules/tap/test/simple-harness-test-with-plan.js generated vendored Normal file
View file

@ -0,0 +1,16 @@
var tap = require("../")
, test = tap.test
, plan = tap.plan
plan(2)
test("trivial success", function (t) {
t.ok(true, "it works")
t.end()
})
test("two tests", function (t) {
t.equal(255, 0xFF, "math should work")
t.notOk(false, "false should not be ok")
t.end()
})

13
node_modules/tap/test/simple-harness-test.js generated vendored Normal file
View file

@ -0,0 +1,13 @@
var tap = require("../")
, test = tap.test
test("trivial success", function (t) {
t.ok(true, "it works")
t.end()
})
test("two tests", function (t) {
t.equal(255, 0xFF, "math should work")
t.notOk(false, "false should not be ok")
t.end()
})

91
node_modules/tap/test/test-test.js generated vendored Normal file
View file

@ -0,0 +1,91 @@
var tap = require("../")
, test = tap.test
, Test = require("../lib/tap-test")
, Harness = require("../lib/tap-harness")
test("testing the test object", function (t) {
t.isa(t, Test, "test object should be instanceof Test")
t.isa(t, Harness, "test object should be instanceof Harness")
t.is(t._Test, Test, "test._Test should be the Test class")
// now test all the methods.
; [ "isNotDeepEqual"
, "equals"
, "inequivalent"
, "threw"
, "strictEqual"
, "emit"
, "fail"
, "strictEquals"
, "notLike"
, "dissimilar"
, "true"
, "assert"
, "is"
, "ok"
, "isEqual"
, "isDeeply"
, "deepEqual"
, "deepEquals"
, "pass"
, "length"
, "skip"
, "isNotEqual"
, "looseEquals"
, "false"
, "notDeeply"
, "ifErr"
, "hasFields"
, "isNotDeeply"
, "like"
, "similar"
, "notOk"
, "isDissimilar"
, "isEquivalent"
, "doesNotEqual"
, "isSimilar"
, "notDeepEqual"
, "type"
, "notok"
, "isInequivalent"
, "isNot"
, "same"
, "isInequal"
, "_endNice"
, "ifError"
, "iferror"
, "clear"
, "has"
, "not"
, "timeout"
, "notSimilar"
, "isUnlike"
, "notEquals"
, "unsimilar"
, "result"
, "doesNotThrow"
, "error"
, "constructor"
, "notEqual"
, "throws"
, "isLike"
, "isNotSimilar"
, "isNotEquivalent"
, "inequal"
, "notEquivalent"
, "isNotLike"
, "equivalent"
, "looseEqual"
, "equal"
, "unlike"
, "doesNotHave"
, "comment"
, "isa"
].forEach(function (method) {
t.ok(t[method], "should have "+method+" method")
t.isa(t[method], "function", method+" method should be a function")
})
t.end()
})

33
node_modules/tap/test/timeout.js generated vendored Normal file
View file

@ -0,0 +1,33 @@
var tap = require("../")
tap.test("timeout test with plan only", function (t) {
console.error("timeout test")
t.plan(2)
console.error("t.plan="+t._plan)
setTimeout(function () {
console.error("a assert")
t.ok(true, "a")
}, 1000)
setTimeout(function () {
console.error("b assert")
t.ok(true, "b")
}, 1000)
})
tap.test("timeout test with plan and end", function (t) {
console.error("timeout test")
t.plan(2)
var tc = 2
console.error("t.plan="+t._plan)
setTimeout(function () {
console.error("a assert")
t.ok(true, "a")
if (-- tc === 0) t.end()
}, 1000)
setTimeout(function () {
console.error("b assert")
t.ok(true, "b")
if (-- tc === 0) t.end()
}, 1000)
})

0
node_modules/tap/test/trivial-success.js generated vendored Normal file
View file