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/g17khqpukees4237dtn3astzapmp462vjhsz6st4/expect

Package
Open in gnoweb ↗

Overview

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

Files (13)

  • README.mdmarkdown
  • gnomod.tomltoml
  • boolean.gnogno
  • context.gnogno
  • doc.gnogno
  • error.gnogno
  • float.gnogno
  • func.gnogno
  • int.gnogno
  • message.gnogno
  • string.gnogno
  • uint.gnogno
  • value.gnogno
  • doc.gnogno
    1// Package expect provides testing support for packages and realms.2//3// Values can be asserted using the `Value()` function, for example:4//5//	func TestFoo(t *testing.T) {6//	  got := 427//	  expect.Value(t, got).ToEqual(42)8//	  expect.Value(t, got).Not().ToEqual(0)9//10//	  expect.Value(t, "foo").ToEqual("foo")11//	  expect.Value(t, 42).AsInt().Not().ToBeGreaterThan(50)12//	  expect.Value(t, "TRUE").AsBoolean().ToBeTruthy()13//	}14//15// Functions can also be used to assert returned values, errors or panics.16//17// Package supports four type of functions:18//19//   - func()20//   - func() any21//   - func() error22//   - func() (any, error)23//24// Functions can be asserted using the `Func()` function, for example:25//26//	func TestFoo(t *testing.T) {27//	  expect.Func(t, func() {28//	    panic("Boom!")29//	  }).ToPanic().WithMessage("Boom!")30//31//	  wantErr := errors.New("Boom!")32//	  expect.Func(t, func() error {33//	    return wantErr34//	  }).ToFail().WithMessage("Boom!")35//36//	  expect.Func(t, func() error {37//	    return wantErr38//	  }).ToFail().WithError(wantErr)39//	}40package expect41

    Functions

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

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