minimal test of --diff option

This commit is contained in:
Johan Holmberg 2016-06-28 09:06:34 +02:00
parent 19d55530f5
commit 502e242402

View File

@ -181,6 +181,36 @@ class CMDTEST_stdxxx_equal < Cmdtest::Testcase
end
end
#----------------------------------------
## methods: test_stdout_equal_DIFF test_stderr_equal_DIFF
define_method("test_#{stdxxx}_equal_DIFF") do
create_CMDTEST_foo [
"cmd 'echo_#{stdxxx}.rb --lines 11 33 44 55-changed 66 77 88' do",
" #{stdxxx}_equal [ '11', '22', '33', '44', '55', '66', '77' ]",
"end",
]
cmd_cmdtest_diff do
stdout_equal [
"### echo_#{stdxxx}.rb --lines 11 33 44 55-changed 66 77 88",
"--- ERROR: wrong #{stdxxx}",
"--- 11",
"--- - 22",
"--- 33",
"--- 44",
"--- - 55",
"--- + 55-changed",
"--- 66",
"--- 77",
"--- + 88",
]
exit_nonzero
end
end
#----------------------------------------
# stdxxx_not_equal
#----------------------------------------