comparison scripts/test/touch.test @ 909:9a732a0f8ddc

Tests for touch (needs more work).
author Rob Landley <rob@landley.net>
date Mon, 27 May 2013 13:39:03 -0500
parents
children
comparison
equal deleted inserted replaced
908:24ee3b04af3b 909:9a732a0f8ddc
1 #!/bin/bash
2
3 [ -f testing.sh ] && . testing.sh
4
5 #testing "name" "command" "result" "infile" "stdin"
6
7 testing "touch" "touch walrus && [ -e walrus ] && echo yes" "yes\n" "" ""
8 testing "touch 1 2 3" "touch one two three && rm one two three && echo yes" "yes\n" \
9 "" ""
10 testing "touch -c" "touch -c walrus && [ -e walrus ] && echo yes" "yes\n" "" ""
11 testing "touch -c missing" "touch -c warrus && [ ! -e warrus ] && echo yes" \
12 "yes\n" "" ""
13
14 # This isn't testing fraction of a second because I dunno how to read it back
15
16 testing "touch -d" \
17 "touch -d 2009-02-13T23:31:30.12Z walrus && date -r walrus +%s.%N" "1234567890\n" \
18 "" ""
19 #testing "touch -t" "touch -t 200902132331.42
20 #testing "touch -r"
21 #testing "touch -a"
22 #testing "touch -m"
23 #testing "touch -am"
24 rm walrus