zunit-zsh.zunit/tests/assertions/same_as.zunit

20 lines
504 B
Bash

#!/usr/bin/env zunit
@test 'Test _zunit_assert_same_as success' {
run assert 'test' same_as 'test'
assert $state equals 0
assert $output is_empty
}
@test 'Test _zunit_assert_same_as failure' {
run assert 'test' same_as 'wrong'
assert $state equals 1
assert $output same_as "'test' is not the same as 'wrong'"
}
@test 'Test _zunit_assert_same_as failure with empty value' {
run assert '' same_as 'wrong'
assert $state equals 1
assert $output same_as "'' is not the same as 'wrong'"
}