Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 13 May 2017 20:28:33 +0000 (UTC)
From:      Jilles Tjoelker <jilles@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r318258 - head/bin/sh/tests/builtins
Message-ID:  <201705132028.v4DKSXKp022813@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jilles
Date: Sat May 13 20:28:32 2017
New Revision: 318258
URL: https://svnweb.freebsd.org/changeset/base/318258

Log:
  sh: Add test for arithmetic expansion in [x-y] pattern range.
  
  It does not make much sense to generate the '-' in a pattern bracket
  expression using arithmetic expansion, but it does not make sense to forbid
  it either.
  
  This test already passes.

Added:
  head/bin/sh/tests/builtins/case21.0   (contents, props changed)
Modified:
  head/bin/sh/tests/builtins/Makefile

Modified: head/bin/sh/tests/builtins/Makefile
==============================================================================
--- head/bin/sh/tests/builtins/Makefile	Sat May 13 19:59:03 2017	(r318257)
+++ head/bin/sh/tests/builtins/Makefile	Sat May 13 20:28:32 2017	(r318258)
@@ -40,6 +40,7 @@ ${PACKAGE}FILES+=		case17.0
 ${PACKAGE}FILES+=		case18.0
 ${PACKAGE}FILES+=		case19.0
 ${PACKAGE}FILES+=		case20.0
+${PACKAGE}FILES+=		case21.0
 ${PACKAGE}FILES+=		cd1.0
 ${PACKAGE}FILES+=		cd2.0
 ${PACKAGE}FILES+=		cd3.0

Added: head/bin/sh/tests/builtins/case21.0
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/bin/sh/tests/builtins/case21.0	Sat May 13 20:28:32 2017	(r318258)
@@ -0,0 +1,10 @@
+# $FreeBSD$
+
+case 5 in
+[0$((-9))]) ;;
+*) echo bad1 ;;
+esac
+
+case - in
+[0$((-9))]) echo bad2 ;;
+esac



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201705132028.v4DKSXKp022813>