-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathhavedata_test.go
More file actions
43 lines (35 loc) · 1.09 KB
/
havedata_test.go
File metadata and controls
43 lines (35 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Copyright © 2015 Phil Pennock.
// All rights reserved, except as granted under license.
// Licensed per file LICENSE.txt
package main
import (
"testing"
"github.com/philpennock/character/commands/root"
"github.com/philpennock/character/sources"
_ "github.com/philpennock/character/commands/name"
_ "github.com/philpennock/character/commands/named"
_ "github.com/philpennock/character/commands/version"
)
const (
minSaneByRune = 1000
minSaneByName = 1000
)
func Test000LoadDataExternal(*testing.T) {
// just load data once so that times for other tests are sane
_ = sources.NewAll()
}
func TestBasicLoadWithoutErrors(t *testing.T) {
_ = sources.NewAll()
if ec := root.GetErrorCount(); ec != 0 {
t.Fatalf("basic data load gave us %d errors", ec)
}
}
func TestHaveUnicode(t *testing.T) {
s := sources.NewAll()
if runeCount := len(s.Unicode.ByRune); runeCount < minSaneByRune {
t.Errorf("only got %d entries in unicode ByRune map", runeCount)
}
if nameCount := len(s.Unicode.ByName); nameCount < minSaneByName {
t.Errorf("only got %d entries in unicode ByRune map", nameCount)
}
}