File: test.sh

package info (click to toggle)
safecopy 1.7-7
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 2,388 kB
  • sloc: ansic: 2,751; sh: 1,925; makefile: 19
file content (20 lines) | stat: -rwxr-xr-x 553 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh

test_name="safecopy, ability to simply copy a regular file"

source "../libtestsuite.sh"

function test_current() {
	testsuite_debug "Test if a copy of a file created with safecopy is identical to the source."
	$safecopy "test.dat" "$testsuite_tmpdir/test.dat" >"$testsuite_tmpdir/test.out" 2>&1
	if [ $? != 0 ]; then
		testsuite_error "Run of safecopy returned wrong exit code. Output:"
		testsuite_debug_file "$testsuite_tmpdir/test.out"
	fi
	testsuite_assert_files_identical "test.dat" "$testsuite_tmpdir/test.dat"

}

testsuite_runtest