From 9000f58786bc21b05e59ddbe96f8be607f13a00d Mon Sep 17 00:00:00 2001 From: Prabhu Ramachandran Date: Fri, 25 Nov 2011 23:57:56 +0530 Subject: ENH: Fixing bash support, tests for code server. This checkin fixes bash support. In actuality the bash support lets one test any runnable script/program that outputs results to stdout. I've also added a decent test suite for the code server that checks if it functions correctly or not. I've also updated the sample_questions to work with the new bash support and added a reference bash script and the testcode to go with it. --- docs/sample.args | 2 ++ docs/sample.sh | 2 ++ docs/sample_questions.py | 7 ++----- 3 files changed, 6 insertions(+), 5 deletions(-) create mode 100644 docs/sample.args create mode 100755 docs/sample.sh (limited to 'docs') diff --git a/docs/sample.args b/docs/sample.args new file mode 100644 index 0000000..4d9f00d --- /dev/null +++ b/docs/sample.args @@ -0,0 +1,2 @@ +1 2 +2 1 diff --git a/docs/sample.sh b/docs/sample.sh new file mode 100755 index 0000000..e935cb3 --- /dev/null +++ b/docs/sample.sh @@ -0,0 +1,2 @@ +#!/bin/bash +[[ $# -eq 2 ]] && echo $(( $1 + $2 )) && exit $(( $1 + $2 )) diff --git a/docs/sample_questions.py b/docs/sample_questions.py index 5af9c4b..aa7f239 100644 --- a/docs/sample_questions.py +++ b/docs/sample_questions.py @@ -35,11 +35,8 @@ Question( description='''Write a shell script which takes two arguments on the command line and prints the sum of the two on the output.''', test='''\ -#!/bin/bash -[[ $# -eq 2 ]] && echo $(( $1 + $2 )) && exit $(( $1 + $2 )) -#++++++ -1 2 -2 1 +docs/sample.sh +docs/sample.args '''), Question( summary='Size of integer in Python', -- cgit