OSDN Git Service

split pgrep/pkill tests.
[android-x86/external-toybox.git] / tests / touch.test
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 testing "touch -d" \
15   "touch -d 2009-02-13T23:31:30Z walrus && date -r walrus +%s" \
16   "1234567890\n" "" ""
17
18 testing "touch -d nanoseconds" \
19   "touch -d 2009-02-13T23:31:30.123456789Z walrus && date -r walrus +%s.%N" \
20   "1234567890.123456789\n" "" ""
21
22 testing "touch -r" \
23   "touch -r walrus walrus2 && date -r walrus2 +%s.%N" \
24    "1234567890.123456789\n" "" ""
25
26 #testing "touch -a"
27 #testing "touch -m"
28 #testing "touch -am"
29 #testing "touch -t"
30 rm walrus walrus2