Mercurial > hg
comparison tests/test-diffstat @ 9651:bd3af545c7c6
diffstat: made test case work with POSIX sh and printf
* arithmetic expression ((...)), without $, is bashism.
* printf '\xXX' seems non-standard. '\0' is okay.
http://www.opengroup.org/onlinepubs/009695399/utilities/printf.html
tested with bash 4.0 and dash 0.5.5.1
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Tue, 27 Oct 2009 21:59:44 +0900 |
parents | 7d17794f08a9 |
children | 99a2096c3d8d |
comparison
equal
deleted
inserted
replaced
9650:1ad02c04356c | 9651:bd3af545c7c6 |
---|---|
1 #!/bin/sh | 1 #!/bin/sh |
2 | 2 |
3 hg init repo | 3 hg init repo |
4 cd repo | 4 cd repo |
5 i=0; while (( $i < 213 )); do echo a >> a; i=$(($i + 1)); done | 5 i=0; while [ "$i" -lt 213 ]; do echo a >> a; i=$(($i + 1)); done |
6 hg add a | 6 hg add a |
7 | 7 |
8 echo '% wide diffstat' | 8 echo '% wide diffstat' |
9 hg diff --stat | 9 hg diff --stat |
10 | 10 |
22 echo '% narrow diffstat' | 22 echo '% narrow diffstat' |
23 hg diff --stat | 23 hg diff --stat |
24 | 24 |
25 hg ci -m appenda | 25 hg ci -m appenda |
26 | 26 |
27 printf '%b' '\x00' > b | 27 printf '\0' > b |
28 hg add b | 28 hg add b |
29 | 29 |
30 echo '% binary diffstat' | 30 echo '% binary diffstat' |
31 hg diff --stat | 31 hg diff --stat |
32 | 32 |