mbland / go-script-bash

Framework for writing modular, discoverable, testable Bash scripts
ISC License
95 stars 16 forks source link

'core/search-plugins' test fails #231

Closed nkakouros closed 5 years ago

nkakouros commented 6 years ago

Due diligence

Framework, Bash, and operating system version information

_GO_CORE_VERSION:         v1.7.0    
BASH_VERSION:             4.4.12(1)-release
OSTYPE:                   linux-gnu
_GO_PLATFORM_ID:          arch
_GO_PLATFORM_VERSION_ID:

Description

I am using Arch linux and bash 4.4.12. When I run ./go test, all tests pass except one:

 ✗ core/search-plugins: /plugins/ in _GO_ROOTDIR, _GO_SCRIPTS_DIR (pathological)
   (in test file tests/core/search-plugins.bats, line 140)              
     `assert_failure "$test_plugins_dir/foo/bin/plugins/bar/bin/plugins" \' failed 
   output not equal to expected value:    
     expected: '/tmp/test rootdir/plugins/plugins/plugins/plugins/foo/bin/plugins/bar/bin/plugins 
   /tmp/test rootdir/plugins/plugins/plugins/plugins/foo/bin/plugins     
   /tmp/test rootdir/plugins/plugins/plugins/plugins'   
     actual:   '/tmp/test rootdir/plugins/plugins/go: line 2: /home/plugins/vendor/go-script-bash/go-core.bash: No such file or directory  
   /tmp/test rootdir/plugins/plugins/go: line 17: @go: command not found'   

The culprit is line 8 in search-plugins.bats:

printf '%s\n' "${test_go_script_impl/$TEST_GO_SCRIPTS_RELATIVE_DIR/plugins}" \ 
   >"$test_go_script"

The problem is that I have placed go-script-bash under /home/scripts/vendor and the line above converts the path home/plugins/vendorwhich does not exist.

What is the test supposed to test?

nkakouros commented 5 years ago

I don't face this issue anymore.