From 830407e88f9d40d954356c3754f2647f91d5c06a Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 17:26:00 +0200 Subject: Adding upstream version 5.6.0. Signed-off-by: Daniel Baumann --- tests/config/tapered/test/is-isnt-test.lua | 36 ++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100755 tests/config/tapered/test/is-isnt-test.lua (limited to 'tests/config/tapered/test/is-isnt-test.lua') diff --git a/tests/config/tapered/test/is-isnt-test.lua b/tests/config/tapered/test/is-isnt-test.lua new file mode 100755 index 0000000..d1c7636 --- /dev/null +++ b/tests/config/tapered/test/is-isnt-test.lua @@ -0,0 +1,36 @@ +package.path = '../src/?.lua;' .. package.path +local tap = require 'tapered' + +--- is and isnt +-- is(actual, expected, [msg]) tests if actual == expected +-- isnt(actual, expected, [msg]) tests if actual ~= expected +tap.is(2+1, 3, 'ok - is(2+1, 3)') +tap.is(2+2, 3, 'not ok - is(2+2, 3)') +tap.is(print, print, 'ok - is(print, print)') +tap.is(print, 3, 'not ok - is(print, 3)') +tap.is('hello', 'hello', 'ok - is("hello", "hello")') +tap.is('goodbye', 'hello', 'not ok - is("goodbye", "hello")') +tap.is(nil, nil, 'ok - is(nil, nil)') +tap.is(nil, false, 'not ok - is(nil, false)') +tap.is(false, false, 'ok - is(false, false)') +tap.is(true, true, 'ok - is(true, true)') +tap.is(true, false, 'not ok - is(true, false)') +tap.is(false, true, 'not ok - is(false, true)') +tap.isnt(2+2, 3, 'ok - isnt(2+2, 3)') +tap.isnt(2+2, 4, 'not ok - isnt(2+2, 4)') +tap.isnt(3, print, 'ok - isnt(3, print)') +tap.isnt(print, os.exit, 'ok - isnt(print, os.exit)') +tap.isnt('hello', 'goodbye', 'ok - isnt("hello", "goodbye")') +tap.isnt('hello', 'hello', 'not ok - isnt("hello", "hello")') +tap.isnt(nil, nil, 'not ok - isnt(nil, nil)') +tap.isnt(nil, false, 'ok - isnt(nil, false)') +tap.isnt(false, false, 'not ok - isnt(false, false)') +tap.isnt(true, true, 'not ok - isnt(true, true)') +tap.isnt(true, false, 'ok - isnt(true, false)') +tap.isnt(false, true, 'ok - isnt(false, true)') +tap.isnt(nil, false, 'ok - isnt(nil, false)') +tap.isnt(false, false, 'not ok - isnt(false, false)') +tap.isnt(true, true, 'not ok - isnt(true, true)') +tap.isnt(true, false, 'ok - isnt(true, false)') +tap.isnt(false, true, 'ok - isnt(false, true)') +tap.done() -- cgit v1.2.3