From 224d8e7e7e5719452f9f29c2e28b3c937fbdb8de Mon Sep 17 00:00:00 2001 From: jdolecek Date: Thu, 26 Oct 2000 23:32:14 +0000 Subject: [PATCH] add two tests for expr --- regress/bin/expr/Makefile | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 regress/bin/expr/Makefile diff --git a/regress/bin/expr/Makefile b/regress/bin/expr/Makefile new file mode 100644 index 000000000000..8e7698ec7df3 --- /dev/null +++ b/regress/bin/expr/Makefile @@ -0,0 +1,28 @@ +# $NetBSD: Makefile,v 1.1 2000/10/26 23:32:14 jdolecek Exp $ + +MKMAN= no + +regress: test_one test_two + +test_one: + @good="1/2"; \ + out=`expr X"1/2/3" : 'X\(.*[^/]\)//*[^/][^/]*/*$$' \| . : '\(.\)'`; \ + if [ "$$good" != "$$out" ]; then \ + echo "Test 1 (precedence) failed - got '$$out', should be '$$good'."; \ + exit 1; \ + else \ + echo "Test 1 (precedence) succeeded."; \ + fi + +test_two: + @good="2"; \ + out=`expr '1/2' : '.*/\(.*\)'`; \ + if [ "$$good" != "$$out" ]; then \ + echo "Test 2 failed - got '$$out', should be '$$good'."; \ + exit 1; \ + else \ + echo "Test 2 succeeded."; \ + fi + + +.include