-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: changes to obfus - ignore vars; fix import within argsh env; an…
…d tests (#18) - feature obfus: to ignore vars as flag - fix import: was ignoring `ARGSH_SOURCE` - tests: added minify test - fix args: didn't handle rest positional params correctly (array) - moved test fixtures to tests itself
- Loading branch information
Showing
35 changed files
with
142 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/usr/bin/env bash | ||
|
||
main() { | ||
local usage="test" | ||
local args="test" | ||
local obfuscate="test" | ||
echo "${usage} ${args} ${obfuscate}" | ||
} | ||
[[ "${0}" != "${BASH_SOURCE[0]}" && -z "${ARGSH_SOURCE}" ]] || main "${@}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/bin/env bats | ||
# shellcheck shell=bash disable=SC2154 | ||
# vim: filetype=bash | ||
# This test file has to be run from the docker container itself | ||
set -euo pipefail | ||
|
||
load "/workspace/test/helper" | ||
load_source | ||
|
||
@test "ignore variables" { | ||
( | ||
docker-entrypoint.sh minify "${PATH_FIXTURES}/ignore_vars.sh" | ||
) >"${stdout}" 2>"${stderr}" || status="${?}" | ||
|
||
is_empty stderr | ||
grep -q 'local usage' "${stdout}" | ||
grep -q 'local args' "${stdout}" | ||
grep -vq obfuscate "${stdout}" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
{ | ||
"files": [ | ||
{"file": "/workspace/test/fixtures/args/attrs.sh", "percent_covered": "52.50", "covered_lines": "21", "total_lines": "40"}, | ||
{"file": "/workspace/libraries/fixtures/import/print_out.sh", "percent_covered": "100.00", "covered_lines": "2", "total_lines": "2"}, | ||
{"file": "/workspace/libraries/fixtures/args/usage.sh", "percent_covered": "67.57", "covered_lines": "25", "total_lines": "37"}, | ||
{"file": "/workspace/libraries/fixtures/args/attrs.sh", "percent_covered": "52.50", "covered_lines": "21", "total_lines": "40"}, | ||
{"file": "/workspace/libraries/array.sh", "percent_covered": "35.71", "covered_lines": "5", "total_lines": "14"}, | ||
{"file": "/workspace/test/fixtures/import/print_out.sh", "percent_covered": "100.00", "covered_lines": "2", "total_lines": "2"}, | ||
{"file": "/workspace/libraries/error.sh", "percent_covered": "27.78", "covered_lines": "5", "total_lines": "18"}, | ||
{"file": "/workspace/test/fixtures/args/fmt.sh", "percent_covered": "33.33", "covered_lines": "13", "total_lines": "39"}, | ||
{"file": "/workspace/libraries/to.sh", "percent_covered": "41.67", "covered_lines": "10", "total_lines": "24"}, | ||
{"file": "/workspace/libraries/is.sh", "percent_covered": "75.00", "covered_lines": "6", "total_lines": "8"}, | ||
{"file": "/workspace/libraries/fmt.sh", "percent_covered": "62.50", "covered_lines": "5", "total_lines": "8"}, | ||
{"file": "/workspace/libraries/import.sh", "percent_covered": "100.00", "covered_lines": "19", "total_lines": "19"}, | ||
{"file": "/workspace/libraries/import.sh", "percent_covered": "100.00", "covered_lines": "20", "total_lines": "20"}, | ||
{"file": "/workspace/libraries/string.sh", "percent_covered": "100.00", "covered_lines": "41", "total_lines": "41"}, | ||
{"file": "/workspace/test/fixtures/args/usage.sh", "percent_covered": "67.57", "covered_lines": "25", "total_lines": "37"}, | ||
{"file": "/workspace/libraries/args.sh", "percent_covered": "89.80", "covered_lines": "273", "total_lines": "304"} | ||
{"file": "/workspace/libraries/fixtures/args/fmt.sh", "percent_covered": "33.33", "covered_lines": "13", "total_lines": "39"}, | ||
{"file": "/workspace/libraries/args.sh", "percent_covered": "90.03", "covered_lines": "280", "total_lines": "311"} | ||
], | ||
"percent_covered": "76.71", | ||
"covered_lines": 425, | ||
"total_lines": 554, | ||
"percent_covered": "77.05", | ||
"covered_lines": 433, | ||
"total_lines": 562, | ||
"percent_low": 25, | ||
"percent_high": 75, | ||
"command": "bats", | ||
"date": "2024-03-25 12:26:58" | ||
"date": "2024-04-05 10:46:08" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters