diff options
author | Junichi Uekawa <dancer@netfort.gr.jp> | 2011-12-04 22:17:32 +0900 |
---|---|---|
committer | Junichi Uekawa <dancer@netfort.gr.jp> | 2011-12-04 22:17:32 +0900 |
commit | 36b02fd98cdfefb9a6ec1fd4cf006c7eaf484506 (patch) | |
tree | 229ccf873a2631e0121596152b732e62aae69a15 /test_pbuilder-modules | |
parent | 57a6a286b437ef6715ec7ac608898a0dabc32444 (diff) | |
download | pbuilder-36b02fd98cdfefb9a6ec1fd4cf006c7eaf484506.tar pbuilder-36b02fd98cdfefb9a6ec1fd4cf006c7eaf484506.tar.gz |
factor out the file copy test part and add a test.
Use 'PWD' like other parts of the codebase.
Coding style uses $() not ``.
Diffstat (limited to 'test_pbuilder-modules')
-rwxr-xr-x | test_pbuilder-modules | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test_pbuilder-modules b/test_pbuilder-modules index bec24e1..ffd8b3e 100755 --- a/test_pbuilder-modules +++ b/test_pbuilder-modules @@ -22,4 +22,26 @@ expect_output "I: test W: warning E: error" test_information +# test the non-copy case +function test_conditional_cp_a() { + ( + TEMPDIR=$(mktemp -d) + cd "${TEMPDIR}" + touch "hoge" + outdir=$(readlink -f "${TEMPDIR}/..") + conditional_cp_a "hoge" "${outdir}" echo + ) +} +expect_output "" test_conditional_cp_a + +# test the copy case. +function test_conditional_cp_a_copy() { + ( + cd /tmp + outdir=/something-else + conditional_cp_a "hoge" "${outdir}" echo + ) +} +expect_output "-a hoge /something-else" test_conditional_cp_a_copy + testlib_summary |