prvng_core/nulib/lib_provisioning/utils/test.nu
Jesús Pérez 316622a78f
merge(refactor/lazy-loading): ADR-025 lazy-loading complete
557 files merged. Conflicts resolved:
  - CHANGELOG.md: took refactor/lazy-loading (session changelog)
  - versions.ncl: took refactor/lazy-loading (adds typedialog entries)
2026-04-17 23:09:56 +01:00

38 lines
1.3 KiB
Text

#!/usr/bin/env nu
let tempdir = (mktemp --directory)
let template = $env.PWD
for command_is_simple in [Yes, No] {
for multi_command in [Yes, No] {
print ($"Testing with command_is_simple=($command_is_simple), " ++
$"multi_command=($multi_command)")
let result = (do {
do --capture-errors {
cd $tempdir
(
^cargo generate
--path $template
--force
--silent
--name nu_plugin_test_plugin
--define command_name="test command"
--define $"command_is_simple=($command_is_simple)"
--define $"multi_command=($multi_command)"
--define github_username=
)
do { cd nu_plugin_test_plugin; ^cargo test }
rm -r nu_plugin_test_plugin
}
} | complete)
if $result.exit_code != 0 {
print -e ($"Failed with command_is_simple=($command_is_simple), " ++
$"multi_command=($multi_command)")
rm -rf $tempdir
error make { msg: $result.stderr }
}
}
}
rm -rf $tempdir
print "All tests passed."