summaryrefslogtreecommitdiff
path: root/regress/usr.bin
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2016-08-06 14:41:15 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2016-08-06 14:41:15 +0000
commite4f12ea44f8e752053aafc23fa4ad0e74652b5e7 (patch)
tree27e6149690604f9d0cbd62d3072e7656aa7813b3 /regress/usr.bin
parentb1794bc9350af573958b3ab1be77c732b1109cc5 (diff)
If you see code like this, you know something's quite wrong
(present in some form since r1.1, still present in r1.31): 229 case 013: 230 if (randomize) 231 begin = BEGIN_DEF; 232 else if (reps == 0) 233 errx(1, "Must specify begin if reps == 0"); 234 begin = ender - reps * s + s; Add two tests that check for the intended behavior.
Diffstat (limited to 'regress/usr.bin')
-rw-r--r--regress/usr.bin/jot/regress.rdhhh.out1
-rw-r--r--regress/usr.bin/jot/regress.rhdhh.out1
-rw-r--r--regress/usr.bin/jot/regress.sh5
3 files changed, 6 insertions, 1 deletions
diff --git a/regress/usr.bin/jot/regress.rdhhh.out b/regress/usr.bin/jot/regress.rdhhh.out
new file mode 100644
index 00000000000..d00491fd7e5
--- /dev/null
+++ b/regress/usr.bin/jot/regress.rdhhh.out
@@ -0,0 +1 @@
+1
diff --git a/regress/usr.bin/jot/regress.rhdhh.out b/regress/usr.bin/jot/regress.rhdhh.out
new file mode 100644
index 00000000000..29d6383b52c
--- /dev/null
+++ b/regress/usr.bin/jot/regress.rhdhh.out
@@ -0,0 +1 @@
+100
diff --git a/regress/usr.bin/jot/regress.sh b/regress/usr.bin/jot/regress.sh
index 247b85b0db7..9165b8faf37 100644
--- a/regress/usr.bin/jot/regress.sh
+++ b/regress/usr.bin/jot/regress.sh
@@ -1,4 +1,4 @@
-# $OpenBSD: regress.sh,v 1.2 2016/08/05 13:24:04 tb Exp $
+# $OpenBSD: regress.sh,v 1.3 2016/08/06 14:41:14 tb Exp $
# $FreeBSD: head/usr.bin/jot/tests/regress.sh 208728 2010-06-02 07:47:29Z brian $
JOT=${JOT-jot}
@@ -37,6 +37,9 @@ REGRESSION_TEST([[dhhd2]], [[${JOT} - 20 160 -]])
REGRESSION_TEST([[ddhh2]], [[${JOT} - - 160 2]])
REGRESSION_TEST([[rand1]], [[${JOT} -r 10000 0 9 | sort -u]])
REGRESSION_TEST([[rand2]], [[${JOT} -r 10000 9 0 | sort -u]])
+# rdhhh and rhdhh test if begin and ender are set to the default with jot -r
+REGRESSION_TEST([[rdhhh]], [[${JOT} -r 100 - 10 2 2>/dev/null | sort -n | head -1]])
+REGRESSION_TEST([[rhdhh]], [[${JOT} -r 100 90 - 2 2>/dev/null | sort -n | tail -1]])
REGRESSION_TEST([[n21]], [[${JOT} 21 -1 1.00]])
REGRESSION_TEST([[ascii]], [[${JOT} -c 128 0]])
REGRESSION_TEST([[xaa]], [[${JOT} -w xa%c 26 a]])