From 4a94495f747fef1b32bb8ea3aa8adbe81314795a Mon Sep 17 00:00:00 2001 From: Saumit Dinesan Date: Mon, 5 Sep 2022 03:26:33 +0530 Subject: spring cleaning 0.3 --- .local/src/blesh/lib/test-main.sh | 79 --------------------------------------- 1 file changed, 79 deletions(-) delete mode 100644 .local/src/blesh/lib/test-main.sh (limited to '.local/src/blesh/lib/test-main.sh') diff --git a/.local/src/blesh/lib/test-main.sh b/.local/src/blesh/lib/test-main.sh deleted file mode 100644 index dc6cb57..0000000 --- a/.local/src/blesh/lib/test-main.sh +++ /dev/null @@ -1,79 +0,0 @@ -# this script is a part of blesh (https://github.com/akinomyoga/ble.sh) under BSD-3-Clause license -ble-import lib/core-test -ble/test/start-section 'ble/main' 19 -( - ble/test ble/util/put a stdout=a - ble/test ble/util/print a stdout=a - ble/test 'ble/util/put "a b"' stdout='a b' - ble/test 'ble/util/print "a b"' stdout='a b' - ble/test 'ble/util/put "a b"; ble/util/put "c d"' \ - stdout='a bc d' - ble/test 'ble/util/print "a b"; ble/util/print "c d"' \ - stdout='a b' \ - stdout='c d' -) -( - function ble/test/dummy-1 { true; } - function ble/test/dummy-2 { true; } - function ble/test/dummy-3 { true; } - ble/test ble/bin#has ble/test/dummy-1 - ble/test ble/bin#has ble/test/dummy-{1..3} - ble/test ble/bin#has ble/test/dummy-0 exit=1 - ble/test ble/bin#has ble/test/dummy-{0..2} exit=1 -) -( - ble/bin/.freeze-utility-path readlink ls - function ble/test:readlink.impl1 { - ret=$1 - ble/util/readlink/.resolve-loop - } - function ble/test:readlink.impl2 { - ret=$1 - ble/function#push ble/bin/readlink - ble/util/readlink/.resolve-loop - ble/function#pop ble/bin/readlink - } - ble/test/chdir - mkdir -p ab/cd/ef - touch ab/cd/ef/file.txt - ln -s ef/file.txt ab/cd/link1 - ln -s ab link.d - ln -s link.d/cd/link1 f.txt - ble/test ' - ble/util/readlink f.txt - [[ $ret != /* ]] && ret=${PWD%/}/$ret' \ - ret="${PWD%/}/ab/cd/ef/file.txt" - ln -s loop1.sh loop0.sh - ln -s loop2.sh loop1.sh - ln -s loop3.sh loop2.sh - ln -s loop1.sh loop3.sh - for impl in impl1 impl2; do - ble/test "ble/test:readlink.$impl loop0.sh" ret='loop1.sh' - done - mkdir -p phys.dir - touch phys.dir/1.txt - ln -s ../../../phys.dir ab/cd/ef/phys.link - ln -s ab/cd/ef/phys.link phys.link - local pwd=$PWD xpath= - ble/test code:' - path=phys.link/1.txt - ble/util/readlink/.resolve-physical-directory - declare -p path PWD >&2 - [[ $path == */phys.dir/1.txt && $PWD == "$pwd" ]]' - ble/test/rmdir -) -( - ble/test '[[ -d $_ble_base ]]' - ble/test '[[ -d $_ble_base_run ]]' - ble/test '[[ -d $_ble_base_cache ]]' -) -( - qnl="\$'\n'" - value=$'\nxxx is a function\nhello\nyyy is a function\n' - pattern=$'\n+([][{}:[:alnum:]]) is a function\n' - shopt -s extglob - ble/test '[[ ${value//$pattern/'"$qnl"'} == '"$qnl"'hello'"$qnl"' ]]' - shopt -u extglob - ble/test '[[ ${value//$pattern/'"$qnl"'} != '"$qnl"'hello'"$qnl"' ]]' -) -ble/test/end-section -- cgit v1.2.3