PathrockNetwork Gno Explorer
HomeBlocksTransactionsTokensRealmsPackagesValidatorsAnalytics

PathrockNetwork Gno Explorer — an independent explorer for Gno.land Mainnet (gnoland-1), operated by PathrockNetwork. Not an official Gno.land service.

gnowebarchive RPC

gno.land/p/onbloc/json/v0

Package
Open in gnoweb ↗

Overview

Kind
Pure package
Name
v0
Namespace
onbloc / json
Files
24 (README)(gnomod.toml)
Exported functions
n/a — not supported for pure packages by the node (vm/qfuncs)
Module
gno.land/p/onbloc/json/v0
gno
0.9

Files (24)

  • README.mdmarkdown
  • gnomod.tomltoml
  • buffer.gnogno
  • builder.gnogno
  • decode.gnogno
  • encode.gnogno
  • errors.gnogno
  • escape.gnogno
  • indent.gnogno
  • internal.gnogno
  • node.gnogno
  • parser.gnogno
  • path.gnogno
  • token.gnogno
  • buffer_test.gnogno
  • builder_test.gnogno
  • decode_test.gnogno
  • encode_test.gnogno
  • escape_test.gnogno
  • indent_test.gnogno
  • node_test.gnogno
  • parser_test.gnogno
  • path_test.gnogno
  • LICENSEother
  • parser_test.gnogno
    1package json23import "testing"45func TestParseStringLiteral(t *testing.T) {6	tests := []struct {7		input    string8		expected string9		isError  bool10	}{11		{`"Hello, World!"`, "\"Hello, World!\"", false},12		{`\uFF11`, "\uFF11", false},13		{`\uFFFF`, "\uFFFF", false},14		{`true`, "true", false},15		{`false`, "false", false},16		{`\uDF00`, "", true},17	}1819	for i, tt := range tests {20		s, err := ParseStringLiteral([]byte(tt.input))2122		if !tt.isError && err != nil {23			t.Errorf("%d. unexpected error: %s", i, err)24		}2526		if tt.isError && err == nil {27			t.Errorf("%d. expected error, but not error", i)28		}2930		if s != tt.expected {31			t.Errorf("%d. expected=%s, but actual=%s", i, tt.expected, s)32		}33	}34}3536func TestParseBoolLiteral(t *testing.T) {37	tests := []struct {38		input    string39		expected bool40		isError  bool41	}{42		{`true`, true, false},43		{`false`, false, false},44		{`TRUE`, false, true},45		{`FALSE`, false, true},46		{`foo`, false, true},47		{`"true"`, false, true},48		{`"false"`, false, true},49	}5051	for i, tt := range tests {52		b, err := ParseBoolLiteral([]byte(tt.input))5354		if !tt.isError && err != nil {55			t.Errorf("%d. unexpected error: %s", i, err)56		}5758		if tt.isError && err == nil {59			t.Errorf("%d. expected error, but not error", i)60		}6162		if b != tt.expected {63			t.Errorf("%d. expected=%t, but actual=%t", i, tt.expected, b)64		}65	}66}67

    Functions

    not supported for pure packages by the node (vm/qfuncs)

    Signatures reconstructed verbatim from vm/qfuncs — interface params keep their inline definitions.