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
  • message.gnogno
    1package expect23import "gno.land/p/nt/ufmt/v0"45const (6	MessageTypeCrossPanic MessageType = "cross panic"7	MessageTypeError                  = "error"8	MessageTypePanic                  = "panic"9)1011// MessageType defines a type for message checker errors.12type MessageType string1314// NewMessageChecker creates a new checker for text messages.15func NewMessageChecker(ctx Context, msg string, t MessageType) MessageChecker {16	return MessageChecker{ctx, msg, t}17}1819// MessageChecker asserts text messages.20type MessageChecker struct {21	ctx     Context22	msg     string23	msgType MessageType24}2526// Not negates the next called expectation.27func (c MessageChecker) Not() MessageChecker {28	c.ctx.negated = !c.ctx.negated29	return c30}3132// WithMessage asserts that a message is equal to an expected message.33func (c MessageChecker) WithMessage(msg string) {34	c.ctx.T().Helper()35	c.ctx.CheckExpectation(c.msg == msg, func(ctx Context) string {36		if !ctx.IsNegated() {37			return ufmt.Sprintf("Expected %s message to match\nGot: %s\nWant: %s", string(c.msgType), c.msg, msg)38		}39		return ufmt.Sprintf("Expected %s message to be different\nGot: %s", string(c.msgType), c.msg)40	})41}42

    Functions

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

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