ecc0eac
From 37a227b27344ef0b7cfa9d42064f704ffcde9234 Mon Sep 17 00:00:00 2001
ecc0eac
From: christos <christos>
ecc0eac
Date: Fri, 27 May 2016 18:07:58 +0000
ecc0eac
Subject: [PATCH 1/3] Add a couple of test for PR/526 (David Kaspar)
ecc0eac
ecc0eac
---
ecc0eac
 tests/lexical.at | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ecc0eac
 1 file changed, 59 insertions(+)
ecc0eac
ecc0eac
diff --git a/tests/lexical.at b/tests/lexical.at
ecc0eac
index 5fa37bd..78f66d6 100644
ecc0eac
--- a/tests/lexical.at
ecc0eac
+++ b/tests/lexical.at
ecc0eac
@@ -546,3 +546,62 @@ arg1 arg2
ecc0eac
 ])
ecc0eac
 
ecc0eac
 AT_CLEANUP
ecc0eac
+
ecc0eac
+
ecc0eac
+AT_SETUP([Quoting of expansions in `...`])
ecc0eac
+
ecc0eac
+AT_DATA([batchsystem.properties],
ecc0eac
+[[# Path to job setting file
ecc0eac
+asyncjobinfo.uri=file:///usr/bns/stbns01/batch/app/properties/asyncjobinfo.xml
ecc0eac
+purebatchjobinfo.uri=file:///usr/bns/stbns01/batch/app/properties/purebatchjobinfo.xml
ecc0eac
+
ecc0eac
+# DB connection info
ecc0eac
+jdbc_url=jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=db)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=bns03)))
ecc0eac
+sub_url=jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=db)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=bns03)))
ecc0eac
+mss_url=jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=db)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=bns03)))
ecc0eac
+dbuser=stbns01bt
ecc0eac
+dbpasswd=stbns01bt
ecc0eac
+
ecc0eac
+# OnBatch listener
ecc0eac
+run=3
ecc0eac
+]])
ecc0eac
+AT_DATA([uniformity_test.csh],
ecc0eac
+[[
ecc0eac
+set SERVICE_NAME_LOG = `cat batchsystem.properties | grep '^jdbc_url' | sed -ne 's/^[^=]*=[^@]*@[:blank:]*\([^$]*\)$/\1/p' | perl -pe 's/\s//g'  |  perl -pe 's/\)/\\\)/g' | perl -pe 's/\(/\\\(/g'`
ecc0eac
+echo -n "$SERVICE_NAME_LOG" > ./output1
ecc0eac
+
ecc0eac
+cat batchsystem.properties | grep '^jdbc_url' | sed -ne 's/^[^=]*=[^@]*@[:blank:]*\([^$]*\)$/\1/p' | perl -pe 's/\s//g'  |  perl -pe 's/\)/\\\)/g' | perl -pe 's/\(/\\\(/g' > ./output2
ecc0eac
+
ecc0eac
+diff -uprN ./output1 ./output2 >& /dev/null
ecc0eac
+
ecc0eac
+if ( $? != 0 ) then
ecc0eac
+  echo -n 'FAIL: tcsh does not have uniform output when `...` is used!'
ecc0eac
+  exit 1
ecc0eac
+else
ecc0eac
+  echo -n 'OK'
ecc0eac
+  exit 0
ecc0eac
+endif
ecc0eac
+]])
ecc0eac
+AT_DATA([quoting_result_test.csh],
ecc0eac
+[[
ecc0eac
+echo "(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP\)(HOST=db\)(PORT=1521\)\)(CONNECT_DATA=(SERVER=DEDICATED\)(SERVICE_NAME=bns03\)\)\)" > ./expected_result
ecc0eac
+
ecc0eac
+set string = "jdbc_url=jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=db)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=bns03)))"
ecc0eac
+set SERVICE_NAME_LOG  = `echo "$string" | grep '^jdbc_url' | sed -ne 's/^[^=]*=[^@]*@[:blank:]*\([^$]*\)$/\1/p' | perl -pe 's/\)/\\\)/g'`
ecc0eac
+
ecc0eac
+echo "$SERVICE_NAME_LOG" > ./actual_result
ecc0eac
+
ecc0eac
+diff -uprN ./expected_result ./actual_result >& /dev/null
ecc0eac
+
ecc0eac
+if ( $? != 0 ) then
ecc0eac
+  echo -n 'FAIL: tcsh has unexpected result when `...` is used!'
ecc0eac
+  exit 1
ecc0eac
+else
ecc0eac
+  echo -n 'OK'
ecc0eac
+  exit 0
ecc0eac
+endif
ecc0eac
+]])
ecc0eac
+AT_CHECK([tcsh -f uniformity_test.csh], 0,[OK])
ecc0eac
+AT_CHECK([tcsh -f quoting_result_test.csh], 0, [OK])
ecc0eac
+
ecc0eac
+AT_CLEANUP
ecc0eac
-- 
ecc0eac
2.5.5
ecc0eac
ecc0eac
ecc0eac
From 3e4411aa612d6e70eeaed56ccac824c0c4fe7645 Mon Sep 17 00:00:00 2001
ecc0eac
From: christos <christos>
ecc0eac
Date: Fri, 27 May 2016 18:08:56 +0000
ecc0eac
Subject: [PATCH 2/3] Test that output of the jobs builtin goes to stdout
ecc0eac
 (David Kaspar)
ecc0eac
ecc0eac
---
ecc0eac
 tests/commands.at | 16 ++++++++++++++++
ecc0eac
 1 file changed, 16 insertions(+)
ecc0eac
ecc0eac
diff --git a/tests/commands.at b/tests/commands.at
ecc0eac
index 4ca5a0e..b78fb26 100644
ecc0eac
--- a/tests/commands.at
ecc0eac
+++ b/tests/commands.at
ecc0eac
@@ -1470,4 +1470,20 @@ OK
ecc0eac
 
ecc0eac
 AT_CLEANUP
ecc0eac
 
ecc0eac
+AT_SETUP([jobs output])
ecc0eac
 
ecc0eac
+AT_DATA([jobs_stdout.csh],
ecc0eac
+[[
ecc0eac
+sleep 3 &
ecc0eac
+jobs -l > ./stdout
ecc0eac
+
ecc0eac
+if ( -z ./stdout ) then
ecc0eac
+  echo "FAIL: 'jobs' output is not being displayed to stdout!"
ecc0eac
+  exit 1
ecc0eac
+else
ecc0eac
+  exit 0
ecc0eac
+endif
ecc0eac
+]])
ecc0eac
+AT_CHECK([tcsh -f jobs_stdout.csh], 0, [ignore])
ecc0eac
+
ecc0eac
+AT_CLEANUP
ecc0eac
-- 
ecc0eac
2.5.5
ecc0eac
ecc0eac
ecc0eac
From 9e4845ba68c3fc4533ac484404752d9b59bef535 Mon Sep 17 00:00:00 2001
ecc0eac
From: christos <christos>
ecc0eac
Date: Fri, 27 May 2016 18:10:15 +0000
ecc0eac
Subject: [PATCH 3/3] Test that in backquote expansions quoting just the first
ecc0eac
 character does not assume that the whole string is quoted (David Kaspar)
ecc0eac
ecc0eac
---
ecc0eac
 tests/lexical.at | 21 +++++++++++++++++++++
ecc0eac
 1 file changed, 21 insertions(+)
ecc0eac
ecc0eac
diff --git a/tests/lexical.at b/tests/lexical.at
ecc0eac
index 78f66d6..7b7da4e 100644
ecc0eac
--- a/tests/lexical.at
ecc0eac
+++ b/tests/lexical.at
ecc0eac
@@ -605,3 +605,24 @@ AT_CHECK([tcsh -f uniformity_test.csh], 0,[OK])
ecc0eac
 AT_CHECK([tcsh -f quoting_result_test.csh], 0, [OK])
ecc0eac
 
ecc0eac
 AT_CLEANUP
ecc0eac
+
ecc0eac
+AT_SETUP([\echo for git_tcsh_completion])
ecc0eac
+
ecc0eac
+AT_DATA([escape_echo.csh],
ecc0eac
+[[
ecc0eac
+set myvar = `\echo "1 2 3"`
ecc0eac
+echo ${myvar}
ecc0eac
+echo ${myvar[1]}
ecc0eac
+echo ${myvar[2]}
ecc0eac
+echo ${myvar[3]}
ecc0eac
+exit 0
ecc0eac
+]])
ecc0eac
+
ecc0eac
+AT_CHECK([tcsh -f escape_echo.csh], 0,
ecc0eac
+[1 2 3
ecc0eac
+1
ecc0eac
+2
ecc0eac
+3
ecc0eac
+])
ecc0eac
+
ecc0eac
+AT_CLEANUP
ecc0eac
-- 
ecc0eac
2.5.5
ecc0eac