(t *testing.T)
| 23 | ) |
| 24 | |
| 25 | func 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 | } |
nothing calls this directly
no test coverage detected