mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 00:32:25 -04:00
Add a regression test for diff -D
This commit is contained in:
parent
00eab743ab
commit
05d06ecac3
3 changed files with 37 additions and 1 deletions
|
|
@ -21,7 +21,8 @@ ${PACKAGE}FILES+= \
|
|||
unified_c9999.out \
|
||||
unified_9999.out \
|
||||
header.out \
|
||||
header_ns.out
|
||||
header_ns.out \
|
||||
ifdef.out
|
||||
|
||||
NETBSD_ATF_TESTS_SH+= netbsd_diff_test
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ atf_test_case simple
|
|||
atf_test_case unified
|
||||
atf_test_case header
|
||||
atf_test_case header_ns
|
||||
atf_test_case ifdef
|
||||
|
||||
simple_body()
|
||||
{
|
||||
|
|
@ -70,10 +71,18 @@ header_ns_body()
|
|||
diff -u empty hello
|
||||
}
|
||||
|
||||
ifdef_body()
|
||||
{
|
||||
atf_check -o file:$(atf_get_srcdir)/ifdef.out -s eq:1 \
|
||||
diff -D PLOP "$(atf_get_srcdir)/input_c1.in" \
|
||||
"$(atf_get_srcdir)/input_c2.in"
|
||||
}
|
||||
|
||||
atf_init_test_cases()
|
||||
{
|
||||
atf_add_test_case simple
|
||||
atf_add_test_case unified
|
||||
atf_add_test_case header
|
||||
atf_add_test_case header_ns
|
||||
atf_add_test_case ifdef
|
||||
}
|
||||
|
|
|
|||
26
usr.bin/diff/tests/ifdef.out
Normal file
26
usr.bin/diff/tests/ifdef.out
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
* A comment
|
||||
*
|
||||
#ifndef PLOP
|
||||
* And another bla
|
||||
#else /* PLOP */
|
||||
* And another bla
|
||||
#endif /* PLOP */
|
||||
*
|
||||
#ifndef PLOP
|
||||
* And yet another
|
||||
#else /* PLOP */
|
||||
* and yet another
|
||||
#endif /* PLOP */
|
||||
*/
|
||||
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
#ifdef PLOP
|
||||
|
||||
#endif /* PLOP */
|
||||
printf("something");
|
||||
|
||||
return (0);
|
||||
}
|
||||
Loading…
Reference in a new issue