tests

package
v0.35.0 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

README

tests

Cross-package integration tests that exercise schema against the mapof and sliceof carrier types together. Part of rosetta.

What matters here

  • This directory exists to break an import cycle, not because the tests are special. schema defines the Getter/Setter interfaces, and mapof/sliceof implement them — but schema cannot import mapof/sliceof in its own _test files without a cycle. Putting the round-trip tests in a separate tests package lets them import all three and verify that the implementations actually satisfy schema's path get/set contract.
  • testInline asserts a lossless round-trip: Set then Get returns the same value. It's the shared helper for "this value survives a schema write/read unchanged." Because schema.Set validates and may coerce, a test that fails here often means the value was rewritten by the schema, not that get/set is broken — check the element's validation rules first.

Documentation

Overview

Package tests holds cross-package integration tests that exercise schema against the mapof and sliceof carrier types together.

It exists to break an import cycle, not because these tests are special. Schema defines the Getter and Setter interfaces; mapof and sliceof implement them, so schema cannot import either from its own test files. A third package can import all three and verify that the implementations really satisfy schema's path get/set contract.

Jump to

Keyboard shortcuts

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