scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

commit bd06ba3a5ea0f122fbb6b7c284c32068220dd33b
parent 2e8217b7eced5b5af1048a3ba7144c0adb5b46c2
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Sun, 19 Jan 2020 13:17:28 +0100

test-ar: Add test for -ru

Diffstat:
Atests/ar/execute/0039-update.sh | 38++++++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+), 0 deletions(-)

diff --git a/tests/ar/execute/0039-update.sh b/tests/ar/execute/0039-update.sh @@ -0,0 +1,38 @@ +#!/bin/sh + +set -e + +tmp1=`mktemp` +tmp2=`mktemp` + +trap "rm -f file* $tmp1 $tmp2; exit" 0 2 3 + +############################################################################ +#Update one member that already exist + +echo First > file1 + +cp master.a file.a +sleep 1 +touch file1 +ar -ruv file.a file1 + +ar -p file.a file1 > $tmp1 + +cat <<EOF > $tmp2 +First +EOF + +cmp $tmp1 $tmp2 + +echo Second > file1 +touch -t 197001010000 file.1 +ar -ruv file.a file1 + +ar -p file.a file1 > $tmp1 + +cat <<EOF > $tmp2 +First +EOF + +cmp $tmp1 $tmp2