1#!/usr/bin/env bash
2# Copyright 2013 The Go Authors. All rights reserved.
3# Use of this source code is governed by a BSD-style
4# license that can be found in the LICENSE file.
5
6set -e
7
8function fail {
9	echo FAIL: doc/codewalk/$1
10	exit 1
11}
12
13# markov.xml
14echo foo | go run markov.go | grep foo > /dev/null || fail markov
15
16# functions.xml
17go run pig.go | grep 'Wins, losses staying at k = 100: 210/990 (21.2%), 780/990 (78.8%)' > /dev/null || fail pig
18
19# sharemem.xml: only build the example, as it uses the network
20go build urlpoll.go || fail urlpoll
21rm -f urlpoll
22