Adapted from FreeBSD's test suite by attila () stalphonsos ! com.
Minor tweaks:
* make tests work properly with 'make obj' and setting VERBOSE
* add 10 tests checking some examples in our man page
* disable the dddd test for now since it loops forever
Besides dddd, the following five tests fail: dhhd dhhd2 wp3 wp4 wp5
Suggested fixes for these are on tech@
Many thanks to attila for doing the hard work!
--- /dev/null
+# $OpenBSD: Makefile,v 1.1 2016/07/30 13:55:54 tb Exp $
+
+JOT?=jot
+VERBOSE?=0
+
+regress:
+ m4 ${.CURDIR}/regress.m4 ${.CURDIR}/regress.sh | \
+ env JOT=${JOT} SRCDIR=${.CURDIR} VERBOSE=${VERBOSE} sh
+
+clean:
+ rm -f test.*.out
+
+.include <bsd.regress.mk>
--- /dev/null
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+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+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
--- /dev/null
+1
+3
+5
+7
+9
+11
+13
+15
+17
+19
+21
+23
+25
+27
+29
+31
+33
+35
+37
+39
+41
+43
+45
+47
+49
+51
+53
+55
+57
+59
+61
+63
+65
+67
+69
+71
+73
+75
+77
+79
+81
+83
+85
+87
+89
+91
+93
+95
+97
+99
+101
+103
+105
+107
+109
+111
+113
+115
+117
+119
+121
+123
+125
+127
+129
+131
+133
+135
+137
+139
+141
+143
+145
+147
+149
+151
+153
+155
+157
+159
+161
+163
+165
+167
+169
+171
+173
+175
+177
+179
+181
+183
+185
+187
+189
+191
+193
+195
+197
+199
--- /dev/null
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
--- /dev/null
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
--- /dev/null
+-78
+-76
+-74
+-72
+-70
+-68
+-66
+-64
+-62
+-60
+-58
+-56
+-54
+-52
+-50
+-48
+-46
+-44
+-42
+-40
+-38
+-36
+-34
+-32
+-30
+-28
+-26
+-24
+-22
+-20
+-18
+-16
+-14
+-12
+-10
+-8
+-6
+-4
+-2
+0
+2
+4
+6
+8
+10
+12
+14
+16
+18
+20
+22
+24
+26
+28
+30
+32
+34
+36
+38
+40
+42
+44
+46
+48
+50
+52
+54
+56
+58
+60
+62
+64
+66
+68
+70
+72
+74
+76
+78
+80
+82
+84
+86
+88
+90
+92
+94
+96
+98
+100
+102
+104
+106
+108
+110
+112
+114
+116
+118
+120
--- /dev/null
+-38
+-36
+-34
+-32
+-30
+-28
+-26
+-24
+-22
+-20
+-18
+-16
+-14
+-12
+-10
+-8
+-6
+-4
+-2
+0
+2
+4
+6
+8
+10
+12
+14
+16
+18
+20
+22
+24
+26
+28
+30
+32
+34
+36
+38
+40
+42
+44
+46
+48
+50
+52
+54
+56
+58
+60
+62
+64
+66
+68
+70
+72
+74
+76
+78
+80
+82
+84
+86
+88
+90
+92
+94
+96
+98
+100
+102
+104
+106
+108
+110
+112
+114
+116
+118
+120
+122
+124
+126
+128
+130
+132
+134
+136
+138
+140
+142
+144
+146
+148
+150
+152
+154
+156
+158
+160
--- /dev/null
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
--- /dev/null
+20
+22
+24
+26
+28
+30
+32
+34
+36
+38
+40
+42
+44
+46
+48
+50
+52
+54
+56
+58
+60
+62
+64
+66
+68
+70
+72
+74
+76
+78
+80
+82
+84
+86
+88
+90
+92
+94
+96
+98
+100
+102
+104
+106
+108
+110
+112
+114
+116
+118
+120
+122
+124
+126
+128
+130
+132
+134
+136
+138
+140
+142
+144
+146
+148
+150
+152
+154
+156
+158
+160
+162
+164
+166
+168
+170
+172
+174
+176
+178
+180
+182
+184
+186
+188
+190
+192
+194
+196
+198
+200
+202
+204
+206
+208
+210
+212
+214
+216
+218
--- /dev/null
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
--- /dev/null
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
--- /dev/null
+20
+22
+24
+26
+28
+30
+32
+34
+36
+38
+40
+42
+44
+46
+48
+50
+52
+54
+56
+58
+60
+62
+64
+66
+68
+70
+72
+74
+76
+78
+80
+82
+84
+86
+88
+90
+92
+94
+96
+98
+100
+102
+104
+106
+108
+110
+112
+114
+116
+118
+120
--- /dev/null
+20
+22
+24
+26
+28
+30
+32
+34
+36
+38
+40
+42
+44
+46
+48
+50
+52
+54
+56
+58
+60
+62
+64
+66
+68
+70
+72
+74
+76
+78
+80
+82
+84
+86
+88
+90
+92
+94
+96
+98
+100
+102
+104
+106
+108
+110
+112
+114
+116
+118
+120
+122
+124
+126
+128
+130
+132
+134
+136
+138
+140
+142
+144
+146
+148
+150
+152
+154
+156
+158
+160
--- /dev/null
+2s/old/new/
+7s/old/new/
+12s/old/new/
+17s/old/new/
+22s/old/new/
+27s/old/new/
+32s/old/new/
+37s/old/new/
+42s/old/new/
+47s/old/new/
+52s/old/new/
+57s/old/new/
+62s/old/new/
+67s/old/new/
+72s/old/new/
+77s/old/new/
+82s/old/new/
+87s/old/new/
+92s/old/new/
+97s/old/new/
+102s/old/new/
+107s/old/new/
+112s/old/new/
+117s/old/new/
+122s/old/new/
+127s/old/new/
+132s/old/new/
+137s/old/new/
+142s/old/new/
+147s/old/new/
--- /dev/null
+................................................................................
--- /dev/null
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
--- /dev/null
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
--- /dev/null
+1
+3
+5
+7
+9
+11
+13
+15
+17
+19
+21
+23
+25
+27
+29
+31
+33
+35
+37
+39
+41
+43
+45
+47
+49
+51
+53
+55
+57
+59
+61
+63
+65
+67
+69
+71
+73
+75
+77
+79
+81
+83
+85
+87
+89
+91
+93
+95
+97
+99
--- /dev/null
+1
+3
+5
+7
+9
+11
+13
+15
+17
+19
+21
+23
+25
+27
+29
+31
+33
+35
+37
+39
+41
+43
+45
+47
+49
+51
+53
+55
+57
+59
--- /dev/null
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
--- /dev/null
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
--- /dev/null
+22
+24
+26
+28
+30
+32
+34
+36
+38
+40
+42
+44
+46
+48
+50
+52
+54
+56
+58
+60
+62
+64
+66
+68
+70
+72
+74
+76
+78
+80
+82
+84
+86
+88
+90
+92
+94
+96
+98
+100
+102
+104
+106
+108
+110
+112
+114
+116
+118
+120
--- /dev/null
+102
+104
+106
+108
+110
+112
+114
+116
+118
+120
+122
+124
+126
+128
+130
+132
+134
+136
+138
+140
+142
+144
+146
+148
+150
+152
+154
+156
+158
+160
--- /dev/null
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
--- /dev/null
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
--- /dev/null
+20
+22
+24
+26
+28
+30
+32
+34
+36
+38
+40
+42
+44
+46
+48
+50
+52
+54
+56
+58
+60
+62
+64
+66
+68
+70
+72
+74
+76
+78
+80
+82
+84
+86
+88
+90
+92
+94
+96
+98
+100
+102
+104
+106
+108
+110
+112
+114
+116
+118
--- /dev/null
+20
+22
+24
+26
+28
+30
+32
+34
+36
+38
+40
+42
+44
+46
+48
+50
+52
+54
+56
+58
+60
+62
+64
+66
+68
+70
+72
+74
+76
+78
--- /dev/null
+20
+22
+24
+26
+28
+30
+32
+34
+36
+38
+40
+42
+44
+47
+49
+51
+53
+55
+57
+59
+61
+63
+65
+67
+69
+71
+73
+75
+77
+79
+81
+83
+85
+87
+89
+91
+93
+96
+98
+100
+102
+104
+106
+108
+110
+112
+114
+116
+118
+120
--- /dev/null
+20
+25
+30
+34
+39
+44
+49
+54
+59
+63
+68
+73
+78
+83
+88
+92
+97
+102
+107
+112
+117
+121
+126
+131
+136
+141
+146
+150
+155
+160
--- /dev/null
+20
+22
+24
+26
+28
+30
+32
+34
+36
+38
+40
+42
+44
+46
+48
+50
+52
+54
+56
+58
+60
+62
+64
+66
+68
+70
+72
+74
+76
+78
+80
+82
+84
+86
+88
+90
+92
+94
+96
+98
+100
+102
+104
+106
+108
+110
+112
+114
+116
+118
--- /dev/null
+20
+22
+24
+26
+28
+30
+32
+34
+36
+38
+40
+42
+44
+46
+48
+50
+52
+54
+56
+58
+60
+62
+64
+66
+68
+70
+72
+74
+76
+78
--- /dev/null
+# $OpenBSD: regress.m4,v 1.1 2016/07/30 13:55:54 tb Exp $
+# $FreeBSD: head/usr.bin/tests/regress.m4 263227 2014-03-16 08:04:06Z jmmv $
+
+dnl Originally /usr/src/usr.bin/tests/regress.m4 on FreeBSD
+dnl Merged into jot tests for OpenBSD by attila@stalphonsos.com
+
+dnl A library of routines for doing regression tests for userland utilities.
+
+dnl Start up. We initialise the exit status to 0 (no failure) and change
+dnl into the directory specified by our first argument, which is the
+dnl directory to run the tests inside.
+
+dnl We need backticks and square brackets, use [[ ]] for m4 quoting
+changequote([[,]])
+
+dnl Set some things up before we start running tests
+define([[REGRESSION_START]],
+TESTDIR=$1
+if [ -z "$TESTDIR" ]; then
+ TESTDIR=.
+fi
+cd $TESTDIR
+
+TOTAL=0
+NFAILED=0
+FAILED=""
+STATUS=0
+)
+
+dnl Check $? to see if we passed or failed. The first parameter is the test
+dnl which passed or failed. It may be nil.
+define([[REGRESSION_PASSFAIL]],
+if [ $? -eq 0 ]; then
+ echo "ok - $1 # Test detected no regression. (in $TESTDIR)"
+else
+ STATUS=$?
+ NFAILED=`expr 1 + ${NFAILED}`
+ [ -n "${FAILED}" ] && FAILED="${FAILED} "
+ FAILED="${FAILED}$1"
+ SEE_ABOVE=""
+ if [ ${VERBOSE-0} != 0 ]; then
+ diff -u ${SRCDIR:-.}/regress.$1.out ./test.$1.out
+ SEE_ABOVE="See above. "
+ fi
+ echo "not ok - $1 # Test failed: regression detected. ${SEE_ABOVE}(in $TESTDIR)"
+fi)
+
+dnl An actual test. The first parameter is the test name. The second is the
+dnl command/commands to execute for the actual test. Their exit status is
+dnl checked. It is assumed that the test will output to stdout, and that the
+dnl output to be used to check for regression will be in regress.TESTNAME.out.
+define([[REGRESSION_TEST]],
+TOTAL=`expr 1 + ${TOTAL}`
+$2 >test.$1.out
+diff -q ${SRCDIR:-.}/regress.$1.out ./test.$1.out >/dev/null
+REGRESSION_PASSFAIL($1))
+
+dnl Cleanup. Exit with the status code of the last failure. Should probably
+dnl be the number of failed tests, but hey presto, this is what it does. This
+dnl could also clean up potential droppings, if some forms of regression tests
+dnl end up using mktemp(1) or such.
+define([[REGRESSION_END]],
+if [ ${NFAILED} -ne 0 ]; then
+ echo "FAILED ${NFAILED} tests out of ${TOTAL}: ${FAILED}"
+else
+ echo "PASSED ${TOTAL} tests"
+fi
+exit $STATUS)
--- /dev/null
+1
+2
+2
+2
+3
+4
--- /dev/null
+................................................................................
--- /dev/null
+1.0
+1.5
+2.0
+2.5
+3.0
+3.5
--- /dev/null
+1
+1
+2
+2
+3
+3
--- /dev/null
+1
+1
+2
+2
+3
+3
--- /dev/null
+-1.00
+-0.90
+-0.80
+-0.70
+-0.60
+-0.50
+-0.40
+-0.30
+-0.20
+-0.10
+-0.00
+0.10
+0.20
+0.30
+0.40
+0.50
+0.60
+0.70
+0.80
+0.90
+1.00
--- /dev/null
+xaa
+xab
+xac
+xad
+xae
+xaf
+xag
+xah
+xai
+xaj
+xak
+xal
+xam
+xan
+xao
+xap
+xaq
+xar
+xas
+xat
+xau
+xav
+xaw
+xax
+xay
+xaz
--- /dev/null
+2s/old/new/
+7s/old/new/
+12s/old/new/
+17s/old/new/
+22s/old/new/
+27s/old/new/
+32s/old/new/
+37s/old/new/
+42s/old/new/
+47s/old/new/
+52s/old/new/
+57s/old/new/
+62s/old/new/
+67s/old/new/
+72s/old/new/
+77s/old/new/
+82s/old/new/
+87s/old/new/
+92s/old/new/
+97s/old/new/
+102s/old/new/
+107s/old/new/
+112s/old/new/
+117s/old/new/
+122s/old/new/
+127s/old/new/
+132s/old/new/
+137s/old/new/
+142s/old/new/
+147s/old/new/
--- /dev/null
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+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
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
--- /dev/null
+10,14,18,22,26,30,34,38,42,46,50,54,58,62,66,70,74,78,82,86,90,94,98,102,106,110,114,118,122,126,130
--- /dev/null
+-1.00
+-0.90
+-0.80
+-0.70
+-0.60
+-0.50
+-0.40
+-0.30
+-0.20
+-0.10
+-0.00
+0.10
+0.20
+0.30
+0.40
+0.50
+0.60
+0.70
+0.80
+0.90
+1.00
--- /dev/null
+0
+1
+2
+3
+4
+5
+6
+7
+8
+9
--- /dev/null
+0
+1
+2
+3
+4
+5
+6
+7
+8
+9
--- /dev/null
+# $OpenBSD: regress.sh,v 1.1 2016/07/30 13:55:54 tb Exp $
+# $FreeBSD: head/usr.bin/jot/tests/regress.sh 208728 2010-06-02 07:47:29Z brian $
+
+JOT=${JOT-jot}
+echo "# JOT is ${JOT}"
+echo "# SRCDIR is ${SRCDIR}"
+
+REGRESSION_START(`pwd`)
+
+REGRESSION_TEST([[x]], [[${JOT} -w "%X" -s , 100 1 200]])
+REGRESSION_TEST([[hhhh]], [[${JOT} 50 20 120 2]])
+REGRESSION_TEST([[hhhd]], [[${JOT} 50 20 120 -]])
+REGRESSION_TEST([[hhdh]], [[${JOT} 50 20 - 2]])
+REGRESSION_TEST([[hhdd]], [[${JOT} 50 20 - -]])
+REGRESSION_TEST([[hdhh]], [[${JOT} 50 - 120 2]])
+REGRESSION_TEST([[hdhd]], [[${JOT} 50 - 120 -]])
+REGRESSION_TEST([[hddh]], [[${JOT} 50 - - 2]])
+REGRESSION_TEST([[hddd]], [[${JOT} 50 - - -]])
+REGRESSION_TEST([[dhhh]], [[${JOT} - 20 120 2]])
+REGRESSION_TEST([[dhhd]], [[${JOT} - 20 120 -]])
+REGRESSION_TEST([[dhdh]], [[${JOT} - 20 - 2]])
+REGRESSION_TEST([[dhdd]], [[${JOT} - 20 - -]])
+REGRESSION_TEST([[ddhh]], [[${JOT} - - 120 2]])
+REGRESSION_TEST([[ddhd]], [[${JOT} - - 120 -]])
+REGRESSION_TEST([[dddh]], [[${JOT} - - - 2]])
+#REGRESSION_TEST([[dddd]], [[${JOT} - - - -]])
+REGRESSION_TEST([[hhhh2]], [[${JOT} 30 20 160 2]])
+REGRESSION_TEST([[hhhd2]], [[${JOT} 30 20 160 -]])
+REGRESSION_TEST([[hhdh2]], [[${JOT} 30 20 - 2]])
+REGRESSION_TEST([[hhdd2]], [[${JOT} 30 20 - -]])
+REGRESSION_TEST([[hdhh2]], [[${JOT} 30 - 160 2]])
+REGRESSION_TEST([[hdhd2]], [[${JOT} 30 - 160 -]])
+REGRESSION_TEST([[hddh2]], [[${JOT} 30 - - 2]])
+REGRESSION_TEST([[hddd2]], [[${JOT} 30 - - -]])
+REGRESSION_TEST([[dhhh2]], [[${JOT} - 20 160 2]])
+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]])
+REGRESSION_TEST([[n21]], [[${JOT} 21 -1 1.00]])
+REGRESSION_TEST([[ascii]], [[${JOT} -c 128 0]])
+REGRESSION_TEST([[xaa]], [[${JOT} -w xa%c 26 a]])
+REGRESSION_TEST([[yes]], [[${JOT} -b yes 10]])
+REGRESSION_TEST([[ed]], [[${JOT} -w %ds/old/new/ 30 2 - 5]])
+REGRESSION_TEST([[stutter]], [[${JOT} - 9 0 -.5]])
+REGRESSION_TEST([[stutter2]], [[${JOT} -w %d - 9.5 0 -.5]])
+REGRESSION_TEST([[block]], [[${JOT} -b x 512]])
+REGRESSION_TEST([[tabs]], [[${JOT} -s, - 10 132 4]])
+REGRESSION_TEST([[grep]], [[${JOT} -s "" -b . 80]])
+REGRESSION_TEST([[wf]], [[${JOT} -w "a%.1fb" 10]])
+REGRESSION_TEST([[we]], [[${JOT} -w "a%eb" 10]])
+REGRESSION_TEST([[wwe]], [[${JOT} -w "a%-15eb" 10]])
+REGRESSION_TEST([[wg]], [[${JOT} -w "a%20gb" 10]])
+REGRESSION_TEST([[wc]], [[${JOT} -w "a%cb" 10 33 43]])
+REGRESSION_TEST([[wgd]], [[${JOT} -w "a%gb" 10 .2]])
+REGRESSION_TEST([[wu]], [[${JOT} -w "a%ub" 10]])
+REGRESSION_TEST([[wo]], [[${JOT} -w "a%ob" 10]])
+REGRESSION_TEST([[wx]], [[${JOT} -w "a%xb" 10]])
+REGRESSION_TEST([[wX1]], [[${JOT} -w "a%Xb" 10]])
+REGRESSION_TEST([[wXl]], [[${JOT} -w "a%Xb" 10 2147483648]])
+REGRESSION_TEST([[wdl]], [[${JOT} -w "a%db" 10 2147483648 2>/dev/null]])
+REGRESSION_TEST([[wxn]], [[${JOT} -w "a%xb" 10 -5 2>/dev/null]])
+REGRESSION_TEST([[wdn]], [[${JOT} -w "a%db" 10 -5]])
+REGRESSION_TEST([[wp1]], [[${JOT} -w "%%%d%%%%" 10]])
+REGRESSION_TEST([[wp2]], [[${JOT} -w "%d%%d%%" 10]])
+REGRESSION_TEST([[wp3]], [[${JOT} -w "a%%A%%%d%%B%%b" 10]])
+REGRESSION_TEST([[wp4]], [[${JOT} -w "%%d%d%%d%%" 10]])
+REGRESSION_TEST([[wp5]], [[${JOT} -w ftp://www.example.com/pub/uploaded%%20files/disk%03d.iso 10]])
+REGRESSION_TEST([[wp6]], [[${JOT} -w "%d%" 10]])
+
+# test some of the examples in the jot(1) man page
+REGRESSION_TEST([[man1]], [[${JOT} 6 1 10 0.5]])
+REGRESSION_TEST([[man2]], [[${JOT} -p 1 6 1 10 0.5]])
+REGRESSION_TEST([[man3]], [[${JOT} -p 0 6 .9999999999 10 0.5]])
+REGRESSION_TEST([[man4]], [[${JOT} -w %d 6 1 10 0.5]])
+REGRESSION_TEST([[man5]], [[${JOT} 21 -1 1.00]])
+REGRESSION_TEST([[man6]], [[${JOT} -w xa%c 26 a]])
+REGRESSION_TEST([[man7]], [[${JOT} -w %ds/old/new/ 30 2 - 5]])
+REGRESSION_TEST([[man8]], [[${JOT} -b x 512]])
+REGRESSION_TEST([[man9]], [[${JOT} -s, - 10 132 4]])
+REGRESSION_TEST([[man10]], [[${JOT} -s "" -b. 80]])
+
+REGRESSION_END()
--- /dev/null
+9
+8
+8
+8
+7
+6
+6
+6
+5
+4
+4
+4
+3
+2
+2
+2
+1
+0
+0
--- /dev/null
+9
+9
+8
+8
+7
+7
+6
+6
+5
+5
+4
+4
+3
+3
+2
+2
+1
+1
+0
+0
--- /dev/null
+10,14,18,22,26,30,34,38,42,46,50,54,58,62,66,70,74,78,82,86,90,94,98,102,106,110,114,118,122,126,130
--- /dev/null
+a1b
+a2b
+a3b
+a4b
+a5b
+a6b
+a7b
+a8b
+a9b
+aAb
--- /dev/null
+a80000000b
+a80000001b
+a80000002b
+a80000003b
+a80000004b
+a80000005b
+a80000006b
+a80000007b
+a80000008b
+a80000009b
--- /dev/null
+a!b
+a"b
+a#b
+a$b
+a%b
+a&b
+a'b
+a(b
+a)b
+a+b
--- /dev/null
+a-5b
+a-4b
+a-3b
+a-2b
+a-1b
+a0b
+a1b
+a2b
+a3b
+a4b
--- /dev/null
+a1.000000e+00b
+a2.000000e+00b
+a3.000000e+00b
+a4.000000e+00b
+a5.000000e+00b
+a6.000000e+00b
+a7.000000e+00b
+a8.000000e+00b
+a9.000000e+00b
+a1.000000e+01b
--- /dev/null
+a1.0b
+a2.0b
+a3.0b
+a4.0b
+a5.0b
+a6.0b
+a7.0b
+a8.0b
+a9.0b
+a10.0b
--- /dev/null
+a 1b
+a 2b
+a 3b
+a 4b
+a 5b
+a 6b
+a 7b
+a 8b
+a 9b
+a 10b
--- /dev/null
+a0.2b
+a1.2b
+a2.2b
+a3.2b
+a4.2b
+a5.2b
+a6.2b
+a7.2b
+a8.2b
+a9.2b
--- /dev/null
+a1b
+a2b
+a3b
+a4b
+a5b
+a6b
+a7b
+a10b
+a11b
+a12b
--- /dev/null
+%1%%
+%2%%
+%3%%
+%4%%
+%5%%
+%6%%
+%7%%
+%8%%
+%9%%
+%10%%
--- /dev/null
+1%d%
+2%d%
+3%d%
+4%d%
+5%d%
+6%d%
+7%d%
+8%d%
+9%d%
+10%d%
--- /dev/null
+a%A%1%B%b
+a%A%2%B%b
+a%A%3%B%b
+a%A%4%B%b
+a%A%5%B%b
+a%A%6%B%b
+a%A%7%B%b
+a%A%8%B%b
+a%A%9%B%b
+a%A%10%B%b
--- /dev/null
+%d1%d%
+%d2%d%
+%d3%d%
+%d4%d%
+%d5%d%
+%d6%d%
+%d7%d%
+%d8%d%
+%d9%d%
+%d10%d%
--- /dev/null
+ftp://www.example.com/pub/uploaded%20files/disk001.iso
+ftp://www.example.com/pub/uploaded%20files/disk002.iso
+ftp://www.example.com/pub/uploaded%20files/disk003.iso
+ftp://www.example.com/pub/uploaded%20files/disk004.iso
+ftp://www.example.com/pub/uploaded%20files/disk005.iso
+ftp://www.example.com/pub/uploaded%20files/disk006.iso
+ftp://www.example.com/pub/uploaded%20files/disk007.iso
+ftp://www.example.com/pub/uploaded%20files/disk008.iso
+ftp://www.example.com/pub/uploaded%20files/disk009.iso
+ftp://www.example.com/pub/uploaded%20files/disk010.iso
--- /dev/null
+1%
+2%
+3%
+4%
+5%
+6%
+7%
+8%
+9%
+10%
--- /dev/null
+a1b
+a2b
+a3b
+a4b
+a5b
+a6b
+a7b
+a8b
+a9b
+a10b
--- /dev/null
+a1.000000e+00 b
+a2.000000e+00 b
+a3.000000e+00 b
+a4.000000e+00 b
+a5.000000e+00 b
+a6.000000e+00 b
+a7.000000e+00 b
+a8.000000e+00 b
+a9.000000e+00 b
+a1.000000e+01 b
--- /dev/null
+a1b
+a2b
+a3b
+a4b
+a5b
+a6b
+a7b
+a8b
+a9b
+aab
--- /dev/null
+1,3,5,7,9,B,D,F,11,13,15,17,19,1B,1D,1F,21,23,25,27,29,2B,2D,2F,31,33,35,37,39,3B,3D,3F,41,43,45,47,49,4B,4D,4F,51,53,55,57,59,5B,5D,5F,61,63,65,67,69,6B,6D,6F,71,73,75,77,79,7B,7D,7F,81,83,85,87,89,8B,8D,8F,91,93,95,97,99,9B,9D,9F,A1,A3,A5,A7,A9,AB,AD,AF,B1,B3,B5,B7,B9,BB,BD,BF,C1,C3,C5,C8
--- /dev/null
+xaa
+xab
+xac
+xad
+xae
+xaf
+xag
+xah
+xai
+xaj
+xak
+xal
+xam
+xan
+xao
+xap
+xaq
+xar
+xas
+xat
+xau
+xav
+xaw
+xax
+xay
+xaz
--- /dev/null
+yes
+yes
+yes
+yes
+yes
+yes
+yes
+yes
+yes
+yes