shithub: regress

ref: fa29f36fe713a4bbdfca6770ebb3867436c1ac18
dir: /cmd/patch/patch.rc/

View raw version
#!/bin/rc -e

fn check{
	if(! cmp $1 $2){
		>[2=1] echo fail: $1 $2
		>[2=1] diff -u $1 $2
		exit mismatch
	}
	status=()
}

fn checkpatch{
	rm -f $1.out
	patch $1.patch
	check $1.out $1.expected
}

checkpatch basic
checkpatch header
checkpatch create

seq 12 > delete.out
patch delete.patch
test ! -f delete.out

rm -f multifile^(1 2)^.out
patch multifile.patch
check multifile1.out multifile1.expected
check multifile2.out multifile2.expected

status=()