problemtest

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 1, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package problemtest checks that a client's message catalog covers an application's problem types.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckArgs

func CheckArgs(msg string, params []string) error

CheckArgs returns an error if the ICU message msg does not parse or uses an argument not in params.

func CheckCatalog

func CheckCatalog(tb testing.TB, path string, registries ...*problem.Registry)

CheckCatalog fails t unless the JSON catalog at path has a message at apiErrors.<code> for every type in registries, using only the type's Params as ICU arguments. The shared codes' messages ship with @parallelworks/problem, so the catalog needs only the application's own.

func MessageArgs

func MessageArgs(msg string) ([]string, error)

MessageArgs returns the names of the arguments an ICU message format string uses, including those inside plural and select branches.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL