From 519725bb3c075ee2462c929f5997cb068e18466a Mon Sep 17 00:00:00 2001 From: Ondřej Surý Date: Mon, 26 Mar 2012 16:50:58 +0200 Subject: Imported Upstream version 2012.03.22 --- doc/articles/wiki/test.bash | 30 ++++++++++++++++++++++++++++++ doc/articles/wiki/test.sh | 27 --------------------------- 2 files changed, 30 insertions(+), 27 deletions(-) create mode 100755 doc/articles/wiki/test.bash delete mode 100755 doc/articles/wiki/test.sh (limited to 'doc/articles/wiki') diff --git a/doc/articles/wiki/test.bash b/doc/articles/wiki/test.bash new file mode 100755 index 000000000..5c2cb60dc --- /dev/null +++ b/doc/articles/wiki/test.bash @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +# Copyright 2010 The Go Authors. All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. + +set -e +wiki_pid= +cleanup() { + kill $wiki_pid + rm -f test_*.out Test.txt final-test.bin final-test.go +} +trap cleanup 0 INT + +go build -o get.bin get.go +addr=$(./get.bin -addr) +sed s/:8080/$addr/ < final.go > final-test.go +go build -o final-test.bin final-test.go +(./final-test.bin) & +wiki_pid=$! + +sleep 1 + +./get.bin http://$addr/edit/Test > test_edit.out +diff -u test_edit.out test_edit.good +./get.bin -post=body=some%20content http://$addr/save/Test +diff -u Test.txt test_Test.txt.good +./get.bin http://$addr/view/Test > test_view.out +diff -u test_view.out test_view.good + +echo PASS diff --git a/doc/articles/wiki/test.sh b/doc/articles/wiki/test.sh deleted file mode 100755 index 58b218a78..000000000 --- a/doc/articles/wiki/test.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env bash - -set -e -wiki_pid= -cleanup() { - kill $wiki_pid - rm -f test_*.out Test.txt final-test.bin final-test.go -} -trap cleanup 0 INT - -make get.bin -addr=$(./get.bin -addr) -sed s/:8080/$addr/ < final.go > final-test.go -make final-test.bin -(./final-test.bin) & -wiki_pid=$! - -sleep 1 - -./get.bin http://$addr/edit/Test > test_edit.out -diff -u test_edit.out test_edit.good -./get.bin -post=body=some%20content http://$addr/save/Test -diff -u Test.txt test_Test.txt.good -./get.bin http://$addr/view/Test > test_view.out -diff -u test_view.out test_view.good - -echo PASS -- cgit v1.2.3