scc

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

commit 3ef80008e88323260372f6d2404261f850c2ca83
parent 2b7fc269472d283082e0e53f4b92f18278b15ad6
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