SHTK_UNITTEST_ASSERT_FILE(3) | Library Functions Manual | SHTK_UNITTEST_ASSERT_FILE(3) |
shtk_unittest_assert_file
—
Validates the contents of a file against golden
data
shtk_import unittest
shtk_unittest_assert_file |
golden_spec actual_file |
The shtk_unittest_assert_file
function
verifies that actual_file, which must exist, matches
some predefined contents specified by golden_spec.
The valid values for golden_spec are of the form:
shtk_unittest_assert_file
but comes in handy
when used in conjunction of
shtk_unittest_assert_command(3).The following examples all pass:
touch my_file assert_file empty my_file echo "foo" >my_file assert_file inline:"foo\n" my_file echo "bar" >>my_file cp my_file golden assert_file file:golden my_file assert_file stdin my_file <golden assert_file match:"fo" my_file assert_file not-match:"abcde" my_file
shtk_unittest_assert_file
first appeared
in shtk
1.6.
November 9, 2014 | Debian |