WIP: testing #96

Draft
emma wants to merge 23 commits from testing into main
9 changed files with 8 additions and 8 deletions
Showing only changes of commit 4ad9e0da92 - Show all commits

View File

@ -7,7 +7,7 @@
# permitted in any medium without royalty provided the copyright notice and this
# notice are preserved. This file is offered as-is, without any warranty.
. tests/bonsai/aliases
. tests/bonsai/test_env
! dj -h

View File

@ -7,7 +7,7 @@
# permitted in any medium without royalty provided the copyright notice and this
# notice are preserved. This file is offered as-is, without any warranty.
. tests/bonsai/aliases
. tests/bonsai/test_env
! false
! false -h
emma marked this conversation as resolved
Review

GNU false(1), a notoriously POSIX non-compliant implementation, would pass here, as (if I recall) it returns EXIT_FAILURE for improper usage. It shouldn't pass, though, because it prints a usage text to the standard output when usage help or version information are queried.

I think another good test would be false --help | wc -c | xargs test 0 =, though you should double check the exit statuses here before adding it.

GNU false(1), a notoriously POSIX non-compliant implementation, would pass here, as (if I recall) it returns `EXIT_FAILURE` for improper usage. It shouldn't pass, though, because [it prints a usage text to the standard output when usage help or version information are queried](https://git.savannah.gnu.org/cgit/coreutils.git/tree/src/true.c#n36). I think another good test would be `false --help | wc -c | xargs test 0 =`, though you should double check the exit statuses here before adding it.
Review

Why would we test for GNU extensions in our implementation of true(1)?

Why would we test for GNU extensions in our implementation of `true(1)`?
Review

It's testing for bloat. It drives home the fact that we will not compromise on making good, simple tools. If we did our tests would fail us.

It's testing for bloat. It drives home the fact that we *will not* compromise on making good, simple tools. If we did our tests would fail us.
Review

But if we changed our minds, we could just change our test, and if someone made a PR with changes like that, they would just change the test too.

But if we changed our minds, we could just change our test, and if someone made a PR with changes like that, they would just change the test too.
Review

That's true. I suppose such a test isn't necessary.

That's true. I suppose such a test isn't necessary.

View File

@ -6,7 +6,7 @@
# permitted in any medium without royalty provided the copyright notice and this
# notice are preserved. This file is offered as-is, without any warranty.
. tests/bonsai/aliases
. tests/bonsai/test_env
! fop -h

View File

@ -6,7 +6,7 @@
# permitted in any medium without royalty provided the copyright notice and this
# notice are preserved. This file is offered as-is, without any warranty.
. tests/bonsai/aliases
. tests/bonsai/test_env
alias strcmp="$BIN/strcmp"
alias rpn="$BIN/rpn"

View File

@ -7,7 +7,7 @@
# permitted in any medium without royalty provided the copyright notice and this
# notice are preserved. This file is offered as-is, without any warranty.
. tests/bonsai/aliases
. tests/bonsai/test_env
intcmp -e 3 3 3
intcmp -g 3 2 1

View File

@ -6,7 +6,7 @@
# permitted in any medium without royalty provided the copyright notice and this
# notice are preserved. This file is offered as-is, without any warranty.
. tests/bonsai/aliases
. tests/bonsai/test_env
exec 3>&1

View File

@ -7,7 +7,7 @@
# permitted in any medium without royalty provided the copyright notice and this
# notice are preserved. This file is offered as-is, without any warranty.
. tests/bonsai/aliases
. tests/bonsai/test_env
strcmp equals equals
! strcmp inequals equals

View File

@ -7,7 +7,7 @@
# permitted in any medium without royalty provided the copyright notice and this
# notice are preserved. This file is offered as-is, without any warranty.
. tests/bonsai/aliases
. tests/bonsai/test_env
true
true -h