return
}
delta := wakeup.Sub(now) // A Duration.
- log.Printf("Sleeping for %.3fs", delta.Seconds())
+ fmt.Printf("Sleeping for %.3fs\n", delta.Seconds())
time.Sleep(delta)
}</pre>
return nil
}
-func findLine(os.FileInfo, int64) (int, int)
+func findLine(os.FileInfo, int64) (int, int) {
+ // place holder; no need to run
+ return 0, 0
+}
func netError(err error) { // OMIT
for { // OMIT
var timeout = flag.Duration("timeout", 30*time.Second, "how long to wait for completion")
+func init() {
+ // canonicalize the logging
+ log.SetFlags(0)
+}
+
func mapDelete() {
m := map[string]int{"7": 7, "23": 23}
k := "7"
return
}
delta := wakeup.Sub(now) // A Duration.
- log.Printf("Sleeping for %.3fs", delta.Seconds())
+ fmt.Printf("Sleeping for %.3fs\n", delta.Seconds())
time.Sleep(delta)
}
set -e
-eval $(gomake --no-print-directory -f ../../src/Make.inc go-env)
-
-if [ -z "$O" ]; then
- echo 'missing $O - maybe no Make.$GOARCH?' 1>&2
- exit 1
-fi
-
-rm -f *.$O
-
defer_panic_recover="
- defer.go
- defer2.go
+ defer
+ defer2
"
effective_go="
- eff_bytesize.go
- eff_qr.go
- eff_sequence.go
+ eff_bytesize
+ eff_qr
+ eff_sequence
"
error_handling="
- error.go
- error2.go
- error3.go
- error4.go
+ error
+ error2
+ error3
+ error4
"
-for i in \
- $defer_panic_recover \
- $effective_go \
- $error_handling \
- slices.go \
- go1.go \
-; do
- $GC $i
+all=$(echo $defer_panic_recover $effective_go $error_handling slices go1)
+
+for i in $all; do
+ go build $i.go
done
# Write to temporary file to avoid mingw bash bug.
TMPFILE="/tmp/gotest3.$USER"
function testit {
- $LD $1.$O
- ./$O.out $2 2>&1 >"$TMPFILE" || true
+ ./$1 >"$TMPFILE" 2>&1 || true
x=$(echo $(cat "$TMPFILE")) # extra echo canonicalizes
- if [ "$x" != "$3" ]
+ if ! echo "$x" | grep "$2" > /dev/null
then
- echo $1 failed: '"'$x'"' is not '"'$3'"'
+ echo $1 failed: '"'$x'"' is not '"'$2'"'
fi
}
-testit defer "" "0 3210 2"
-testit defer2 "" "Calling g. Printing in g 0 Printing in g 1 Printing in g 2 Printing in g 3 Panicking! Defer in g 3 Defer in g 2 Defer in g 1 Defer in g 0 Recovered in f 4 Returned normally from f."
+testit defer '^0 3210 2$'
+testit defer2 '^Calling g. Printing in g 0 Printing in g 1 Printing in g 2 Printing in g 3 Panicking! Defer in g 3 Defer in g 2 Defer in g 1 Defer in g 0 Recovered in f 4 Returned normally from f.$'
-testit eff_bytesize "" "1.00YB 9.09TB"
-testit eff_sequence "" "[-1 2 6 16 44]"
+testit eff_bytesize '^1.00YB 9.09TB$'
+testit eff_sequence '^\[-1 2 6 16 44\]$'
-testit go1 "" "Christmas is a holiday: true"
+testit go1 '^Christmas is a holiday: true Sleeping for 0.123s.*go1.go already exists$'
-rm -f $O.out $O.out.exe *.$O "$TMPFILE"
+rm -f $all "$TMPFILE"