Skip to content

Commit

Permalink
Echo
Browse files Browse the repository at this point in the history
  • Loading branch information
bep committed May 3, 2023
1 parent 0771bbe commit b90abf9
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -136,4 +136,4 @@ go 1.18

replace github.com/bep/simplecobra => /Users/bep/dev/go/bep/simplecobra

replace github.com/rogpeppe/go-internal => /Users/bep/dev/go/forks/go-internal
replace github.com/rogpeppe/go-internal => /Users/bep/dev/go/bep/go-internal
5 changes: 5 additions & 0 deletions main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ func TestMain(m *testing.M) {
}
return 0
},
"echos": func() int {
fmt.Println(strings.Join(os.Args[1:], " "))
time.Sleep(10 * time.Millisecond)
return 0
},
"waitServer": func() int {
// The server will write a .ready file when ready.
// We wait for that.
Expand Down
10 changes: 10 additions & 0 deletions testloop.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@


#!/bin/bash
set -e

for i in {1..20}
do
echo "Test run $i"
go test -failfast -count 1 -run TestUnfinished
done
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ httpgrep 'Title: Hugo Server Test.*localhost:1234' 'http://localhost:1234/'

stop


-- hugo.toml --
title = "Hugo Server Test"
baseURL = "https://example.org/"
Expand Down
3 changes: 3 additions & 0 deletions testscripts/unfinished/echos.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

echos "foo"
stdout 'foo'
2 changes: 2 additions & 0 deletions watch_testscripts.sh → watchtestscripts.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

trap exit SIGINT

# I use "run tests on save" in my editor.
# Unfortantly, changes to text files does not trigger this. Hence this workaround.
while true; do find testscripts -type f -name "*.txt" | entr -pd touch main_test.go; done

0 comments on commit b90abf9

Please sign in to comment.