-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #403 from jbampton/fix-build-step
Try a simple Go test on CircleCI
- Loading branch information
Showing
4 changed files
with
32 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
#!/usr/bin/env bash | ||
|
||
cd ../ || exit | ||
|
||
# print first | ||
revive -config config.toml . | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,26 @@ | ||
package main | ||
|
||
import "testing" | ||
import ( | ||
"strconv" | ||
"testing" | ||
"time" | ||
) | ||
|
||
func TestSimple(t *testing.T) { | ||
func TestLength(t *testing.T) { | ||
got := len(scrape("jbampton")) | ||
if got != 5 { | ||
t.Errorf("len(scrape(\"jbampton\")) = %d; want 5", got) | ||
} | ||
} | ||
|
||
func TestIntegers(t *testing.T) { | ||
time.Sleep(15 * time.Second) | ||
got := scrape("prestonhunter") | ||
for _, v := range got { | ||
i, _ := strconv.Atoi(v) | ||
s := strconv.Itoa(i) | ||
if v != s { | ||
t.Errorf("scrape(\"prestonhunter\") = %s; want all numeric", got) | ||
} | ||
} | ||
} |