-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #45 from molovo/version-0.5.x
v0.5.2
- Loading branch information
Showing
10 changed files
with
327 additions
and
8 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
Empty file.
Empty file.
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,27 @@ | ||
#!/usr/bin/env zunit | ||
|
||
@test 'Test _zunit_assert_is_executable success' { | ||
# Make file executable before checking it | ||
chmod 744 "$testdir/is_executable.zunit" | ||
|
||
run assert './is_executable.zunit' is_executable | ||
|
||
# Change permissions back before the test makes its assertions | ||
chmod 644 "$testdir/is_executable.zunit" | ||
|
||
assert $state equals 0 | ||
assert $output is_empty | ||
} | ||
|
||
@test 'Test _zunit_assert_is_executable failure' { | ||
# Make file unexecutable before checking it | ||
chmod 000 "$testdir/../_support/non-executable-file" | ||
|
||
run assert '../_support/non-executable-file' is_executable | ||
|
||
# Change permissions back before the test makes its assertions | ||
chmod 644 "$testdir/../_support/non-executable-file" | ||
|
||
assert $state equals 1 | ||
assert $output same_as "'../_support/non-executable-file' does not exist or is not executable" | ||
} |
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,23 @@ | ||
#!/usr/bin/env zunit | ||
|
||
@test 'Test _zunit_assert_is_key_in success' { | ||
typeset -A hash; hash=( | ||
'a' 1 | ||
'b' 2 | ||
'c' 3 | ||
) | ||
run assert 'a' is_key_in ${(@kv)hash} | ||
assert $state equals 0 | ||
assert "$output" is_empty | ||
} | ||
|
||
@test 'Test _zunit_assert_is_key_in failure' { | ||
typeset -A hash; hash=( | ||
'x' 1 | ||
'y' 2 | ||
'z' 3 | ||
) | ||
run assert 'a' is_key_in ${(@kv)hash} | ||
assert $state equals 1 | ||
assert "$output" same_as "'a' is not a key in (x 1 y 2 z 3)" | ||
} |
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,23 @@ | ||
#!/usr/bin/env zunit | ||
|
||
@test 'Test _zunit_assert_is_not_key_in success' { | ||
typeset -A assoc; assoc=( | ||
'x' 1 | ||
'y' 2 | ||
'z' 3 | ||
) | ||
run assert 'a' is_not_key_in ${(@kv)assoc} | ||
assert $state equals 0 | ||
assert "$output" is_empty | ||
} | ||
|
||
@test 'Test _zunit_assert_is_not_key_in failure' { | ||
typeset -A assoc; assoc=( | ||
'a' 1 | ||
'b' 2 | ||
'c' 3 | ||
) | ||
run assert 'a' is_not_key_in ${(@kv)assoc} | ||
assert $state equals 1 | ||
assert "$output" same_as "'a' is a key in (a 1 b 2 c 3)" | ||
} |
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,23 @@ | ||
#!/usr/bin/env zunit | ||
|
||
@test 'Test _zunit_assert_is_not_value_in success' { | ||
typeset -A hash; hash=( | ||
'x' 7 | ||
'y' 8 | ||
'z' 9 | ||
) | ||
run assert 1 is_not_value_in ${(@kv)hash} | ||
assert $state equals 0 | ||
assert "$output" is_empty | ||
} | ||
|
||
@test 'Test _zunit_assert_is_not_value_in failure' { | ||
typeset -A hash; hash=( | ||
'a' 1 | ||
'b' 2 | ||
'c' 3 | ||
) | ||
run assert 1 is_not_value_in ${(@kv)hash} | ||
assert $state equals 1 | ||
assert "$output" same_as "'1' is a value in (a 1 b 2 c 3)" | ||
} |
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,23 @@ | ||
#!/usr/bin/env zunit | ||
|
||
@test 'Test _zunit_assert_is_value_in success' { | ||
typeset -A hash; hash=( | ||
'a' 1 | ||
'b' 2 | ||
'c' 3 | ||
) | ||
run assert 1 is_value_in ${(@kv)hash} | ||
assert $state equals 0 | ||
assert "$output" is_empty | ||
} | ||
|
||
@test 'Test _zunit_assert_is_value_in failure' { | ||
typeset -A hash; hash=( | ||
'x' 1 | ||
'y' 2 | ||
'z' 3 | ||
) | ||
run assert 4 is_value_in ${(@kv)hash} | ||
assert $state equals 1 | ||
assert "$output" same_as "'4' is not a value in (x 1 y 2 z 3)" | ||
} |
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,20 @@ | ||
#!/usr/bin/env zunit | ||
|
||
@test 'Test _zunit_assert_is_writable success' { | ||
run assert './is_writable.zunit' is_writable | ||
assert $state equals 0 | ||
assert $output is_empty | ||
} | ||
|
||
@test 'Test _zunit_assert_is_writable failure' { | ||
# Make file unwritable before checking it | ||
chmod 000 "$testdir/../_support/non-writable-file" | ||
|
||
run assert '../_support/non-writable-file' is_writable | ||
|
||
# Change permissions back before the test makes its assertions | ||
chmod 644 "$testdir/../_support/non-writable-file" | ||
|
||
assert $state equals 1 | ||
assert $output same_as "'../_support/non-writable-file' does not exist or is not writable" | ||
} |
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