SHELL=/bin/bash
n=100

go:
	# once in a rare while, this first test will legitimately fail...
	./this-pylint randomize
	! diff <(seq $n | ./randomize) <(seq $n) > /dev/null
	diff <(seq $n | ./randomize | sort -n) <(seq $n)
	cmp <(seq $n | tr '\n' '\0' | ./randomize -0 | tr '\0' '\n' | sort -n) <(seq $n)
	! diff <(seq $n | /usr/local/cpython-3.10/bin/python ./randomize) <(seq $n) > /dev/null
	diff <(seq $n | /usr/local/cpython-3.10/bin/python ./randomize | sort -n) <(seq $n)
	cmp <(seq $n | tr '\n' '\0' | /usr/local/cpython-3.10/bin/python ./randomize -0 | tr '\0' '\n' | sort -n) <(seq $n)

install:
	./install-file --file randomize --directory /usr/local/bin/.
	# ./install-file --file python2x3.py --directory /usr/local/lib/.
	./install-file --file readline0.py --directory /usr/local/lib/.

clean:
	rm -f *.pyc
	rm -rf __pycache__