Blob Blame History Raw
From 37a227b27344ef0b7cfa9d42064f704ffcde9234 Mon Sep 17 00:00:00 2001
From: christos <christos>
Date: Fri, 27 May 2016 18:07:58 +0000
Subject: [PATCH 1/3] Add a couple of test for PR/526 (David Kaspar)

---
 tests/lexical.at | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 59 insertions(+)

diff --git a/tests/lexical.at b/tests/lexical.at
index 5fa37bd..78f66d6 100644
--- a/tests/lexical.at
+++ b/tests/lexical.at
@@ -546,3 +546,62 @@ arg1 arg2
 ])
 
 AT_CLEANUP
+
+
+AT_SETUP([Quoting of expansions in `...`])
+
+AT_DATA([batchsystem.properties],
+[[# Path to job setting file
+asyncjobinfo.uri=file:///usr/bns/stbns01/batch/app/properties/asyncjobinfo.xml
+purebatchjobinfo.uri=file:///usr/bns/stbns01/batch/app/properties/purebatchjobinfo.xml
+
+# DB connection info
+jdbc_url=jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=db)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=bns03)))
+sub_url=jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=db)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=bns03)))
+mss_url=jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=db)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=bns03)))
+dbuser=stbns01bt
+dbpasswd=stbns01bt
+
+# OnBatch listener
+run=3
+]])
+AT_DATA([uniformity_test.csh],
+[[
+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'`
+echo -n "$SERVICE_NAME_LOG" > ./output1
+
+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
+
+diff -uprN ./output1 ./output2 >& /dev/null
+
+if ( $? != 0 ) then
+  echo -n 'FAIL: tcsh does not have uniform output when `...` is used!'
+  exit 1
+else
+  echo -n 'OK'
+  exit 0
+endif
+]])
+AT_DATA([quoting_result_test.csh],
+[[
+echo "(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP\)(HOST=db\)(PORT=1521\)\)(CONNECT_DATA=(SERVER=DEDICATED\)(SERVICE_NAME=bns03\)\)\)" > ./expected_result
+
+set string = "jdbc_url=jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=db)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=bns03)))"
+set SERVICE_NAME_LOG  = `echo "$string" | grep '^jdbc_url' | sed -ne 's/^[^=]*=[^@]*@[:blank:]*\([^$]*\)$/\1/p' | perl -pe 's/\)/\\\)/g'`
+
+echo "$SERVICE_NAME_LOG" > ./actual_result
+
+diff -uprN ./expected_result ./actual_result >& /dev/null
+
+if ( $? != 0 ) then
+  echo -n 'FAIL: tcsh has unexpected result when `...` is used!'
+  exit 1
+else
+  echo -n 'OK'
+  exit 0
+endif
+]])
+AT_CHECK([tcsh -f uniformity_test.csh], 0,[OK])
+AT_CHECK([tcsh -f quoting_result_test.csh], 0, [OK])
+
+AT_CLEANUP
-- 
2.5.5


From 3e4411aa612d6e70eeaed56ccac824c0c4fe7645 Mon Sep 17 00:00:00 2001
From: christos <christos>
Date: Fri, 27 May 2016 18:08:56 +0000
Subject: [PATCH 2/3] Test that output of the jobs builtin goes to stdout
 (David Kaspar)

---
 tests/commands.at | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/tests/commands.at b/tests/commands.at
index 4ca5a0e..b78fb26 100644
--- a/tests/commands.at
+++ b/tests/commands.at
@@ -1470,4 +1470,20 @@ OK
 
 AT_CLEANUP
 
+AT_SETUP([jobs output])
 
+AT_DATA([jobs_stdout.csh],
+[[
+sleep 3 &
+jobs -l > ./stdout
+
+if ( -z ./stdout ) then
+  echo "FAIL: 'jobs' output is not being displayed to stdout!"
+  exit 1
+else
+  exit 0
+endif
+]])
+AT_CHECK([tcsh -f jobs_stdout.csh], 0, [ignore])
+
+AT_CLEANUP
-- 
2.5.5


From 9e4845ba68c3fc4533ac484404752d9b59bef535 Mon Sep 17 00:00:00 2001
From: christos <christos>
Date: Fri, 27 May 2016 18:10:15 +0000
Subject: [PATCH 3/3] Test that in backquote expansions quoting just the first
 character does not assume that the whole string is quoted (David Kaspar)

---
 tests/lexical.at | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/tests/lexical.at b/tests/lexical.at
index 78f66d6..7b7da4e 100644
--- a/tests/lexical.at
+++ b/tests/lexical.at
@@ -605,3 +605,24 @@ AT_CHECK([tcsh -f uniformity_test.csh], 0,[OK])
 AT_CHECK([tcsh -f quoting_result_test.csh], 0, [OK])
 
 AT_CLEANUP
+
+AT_SETUP([\echo for git_tcsh_completion])
+
+AT_DATA([escape_echo.csh],
+[[
+set myvar = `\echo "1 2 3"`
+echo ${myvar}
+echo ${myvar[1]}
+echo ${myvar[2]}
+echo ${myvar[3]}
+exit 0
+]])
+
+AT_CHECK([tcsh -f escape_echo.csh], 0,
+[1 2 3
+1
+2
+3
+])
+
+AT_CLEANUP
-- 
2.5.5