From 9bc261a14dc4514d14c39f39caa37651dda58745 Mon Sep 17 00:00:00 2001 From: Chemaclass Date: Thu, 23 Jul 2026 08:23:00 +0200 Subject: [PATCH] docs(assert): document assert_not_equals in the assertions catalog assert_not_equals ships and is tested but was missing from docs/assertions.md, while its twin assert_equals is documented. Add it to the negative-assertions cluster with the standard signature/description/example, and regenerate the `bashunit doc` acceptance snapshots (it now appears in the full listing and in the `doc equals` filtered output). Claude-Session: https://claude.ai/code/session_01JSeB8UzLCpqst55hAK6dED --- docs/assertions.md | 19 +++++++++++++++++++ ...it_should_display_all_assert_docs.snapshot | 11 +++++++++-- ...ould_display_filtered_assert_docs.snapshot | 9 +++++++++ 3 files changed, 37 insertions(+), 2 deletions(-) diff --git a/docs/assertions.md b/docs/assertions.md index 592d0358..661ddcb3 100644 --- a/docs/assertions.md +++ b/docs/assertions.md @@ -1103,6 +1103,25 @@ function test_failure() { ``` ::: +## assert_not_equals +> `assert_not_equals "expected" "actual"` + +Reports an error if the two variables `expected` and `actual` are equal ignoring the special chars like ANSI Escape Sequences (colors) and other special chars like tabs and new lines. + +- [assert_equals](#assert-equals) is the inverse of this assertion and takes the same arguments. + +::: code-group +```bash [Example] +function test_success() { + assert_not_equals "foo" "bar" +} + +function test_failure() { + assert_not_equals "foo" "foo" +} +``` +::: + ## assert_not_same > `assert_not_same "expected" "actual"` diff --git a/tests/acceptance/snapshots/bashunit_test_sh.test_bashunit_should_display_all_assert_docs.snapshot b/tests/acceptance/snapshots/bashunit_test_sh.test_bashunit_should_display_all_assert_docs.snapshot index aaf7b4a3..97fefb84 100644 --- a/tests/acceptance/snapshots/bashunit_test_sh.test_bashunit_should_display_all_assert_docs.snapshot +++ b/tests/acceptance/snapshots/bashunit_test_sh.test_bashunit_should_display_all_assert_docs.snapshot @@ -431,6 +431,15 @@ Reports an error if `expected` and `actual` are not equals. - assert_files_not_equals is the inverse of this assertion and takes the same arguments. +## assert_not_equals +-------------- +> `assert_not_equals "expected" "actual"` + +Reports an error if the two variables `expected` and `actual` are equal ignoring the special chars like ANSI Escape Sequences (colors) and other special chars like tabs and new lines. + +- assert_equals is the inverse of this assertion and takes the same arguments. + + ## assert_not_same -------------- > `assert_not_same "expected" "actual"` @@ -614,5 +623,3 @@ Reports an error if `command` completes in `threshold_ms` milliseconds or less. Unambiguously reports an error message. Useful for reporting specific message when testing situations not covered by any `assert_*` functions. - - diff --git a/tests/acceptance/snapshots/bashunit_test_sh.test_bashunit_should_display_filtered_assert_docs.snapshot b/tests/acceptance/snapshots/bashunit_test_sh.test_bashunit_should_display_filtered_assert_docs.snapshot index b3e12a41..957e0848 100644 --- a/tests/acceptance/snapshots/bashunit_test_sh.test_bashunit_should_display_filtered_assert_docs.snapshot +++ b/tests/acceptance/snapshots/bashunit_test_sh.test_bashunit_should_display_filtered_assert_docs.snapshot @@ -33,6 +33,15 @@ Reports an error if `expected` and `actual` are not equals. - assert_files_not_equals is the inverse of this assertion and takes the same arguments. +## assert_not_equals +-------------- +> `assert_not_equals "expected" "actual"` + +Reports an error if the two variables `expected` and `actual` are equal ignoring the special chars like ANSI Escape Sequences (colors) and other special chars like tabs and new lines. + +- assert_equals is the inverse of this assertion and takes the same arguments. + + ## assert_files_not_equals -------------- > `assert_files_not_equals "expected" "actual"`