summaryrefslogtreecommitdiff
path: root/sauvola_test.go
diff options
context:
space:
mode:
authorNick White <git@njw.name>2020-02-26 16:28:57 +0000
committerNick White <git@njw.name>2020-02-26 16:28:57 +0000
commita47b35dc44f0e770a1bb1f7b53b6aa11d6895e0b (patch)
tree3994c41d70fafe44e94eae89dd4be5653c51e616 /sauvola_test.go
parentd900d8bd656fffc1d2f2581d50eaac15c428ba17 (diff)
Fix flag parsing with go test, and switch to -short to gate long tests
Diffstat (limited to 'sauvola_test.go')
-rw-r--r--sauvola_test.go8
1 files changed, 2 insertions, 6 deletions
diff --git a/sauvola_test.go b/sauvola_test.go
index f0433ba..fd5da60 100644
--- a/sauvola_test.go
+++ b/sauvola_test.go
@@ -5,7 +5,6 @@
package preproc
import (
- "flag"
"fmt"
"image"
"image/png"
@@ -14,9 +13,6 @@ import (
)
func TestBinarization(t *testing.T) {
- var slow = flag.Bool("slow", false, "include slow tests")
- var update = flag.Bool("updatesauvola", false, "update golden files")
-
cases := []struct {
name string
orig string
@@ -43,10 +39,10 @@ func TestBinarization(t *testing.T) {
case "integralsauvola":
actual = IntegralSauvola(orig, c.ksize, c.wsize)
case "sauvola":
- if *slow {
+ if !testing.Short() {
actual = Sauvola(orig, c.ksize, c.wsize)
} else {
- t.Skip("Skipping slow test; use -slow to run it.\n")
+ t.Skip("Skipping long test due to -short flag.\n")
}
default:
t.Fatalf("No method %s\n", c.name)