MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / TestTokenType

Function TestTokenType

types/token_test.go:25–54  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

23)
24
25func TestTokenType(t *testing.T) {
26 Convey("test token util function", t, func() {
27 eos := "EOS"
28 unknown := "Unknown"
29 token := FromString(eos)
30 So(eos, ShouldEqual, token.String())
31 So(token.Listed(), ShouldBeTrue)
32
33 token = FromString("shitcoin")
34 So(token.String(), ShouldEqual, unknown)
35 So(token.Listed(), ShouldBeFalse)
36
37 token = SupportTokenNumber
38 So(token.String(), ShouldEqual, unknown)
39 So(token.Listed(), ShouldBeFalse)
40 })
41
42 Convey("test token list", t, func() {
43 So(SupportTokenNumber, ShouldEqual, len(TokenList))
44
45 var i TokenType
46 token := make(map[string]int)
47 for i = 0; i < SupportTokenNumber; i++ {
48 t, ok := TokenList[i]
49 So(ok, ShouldBeTrue)
50 token[t] = 1
51 }
52 So(len(token), ShouldEqual, SupportTokenNumber)
53 })
54}

Callers

nothing calls this directly

Calls 3

FromStringFunction · 0.85
ListedMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected