Skip to content

[book] testing chapter#205

Merged
damirka merged 15 commits intomainfrom
book/testing-2
Feb 9, 2026
Merged

[book] testing chapter#205
damirka merged 15 commits intomainfrom
book/testing-2

Conversation

@damirka
Copy link
Copy Markdown
Collaborator

@damirka damirka commented Feb 9, 2026

No description provided.

@damirka damirka requested a review from Copilot February 9, 2026 14:45
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new “Testing” chapter to the book (with multiple new pages and sidebar wiring), plus supporting sample Move code and a few site/theme tweaks to improve presentation and syntax highlighting.

Changes:

  • Introduce a new Testing section in the book (basics, utilities, TxContext, test scenarios, system objects, random tests, coverage, gas profiling, extensions).
  • Add/adjust sample Move modules used by the book (builder pattern samples; small fixes across existing samples).
  • Update site styling and Prism Move grammar to better render the new content (tables, bold text, extend module highlighting).

Reviewed changes

Copilot reviewed 24 out of 26 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
site/src/theme/prism-move.js Extend Prism Move highlighting to recognize extend module ... headers.
site/src/css/custom.css Adjust global font weights and strengthen <strong> rendering.
site/src/css/code.css Render ```table fenced blocks in monospace for readability.
rnd/tests/rnd_tests.move Adds a placeholder (currently commented-out) Move test file for rnd.
rnd/sources/rnd.move Adds a placeholder (currently commented-out) rnd module stub.
rnd/Move.toml Introduces a new Move package manifest for rnd.
rnd/.gitignore Ignores build/trace/coverage artifacts for the rnd package.
packages/samples/sources/testing/builder_pattern_builder.move Adds a test-only UserBuilder example + tests for the builder pattern chapter.
packages/samples/sources/testing/builder_pattern.move Adds the corresponding User type used by the builder example.
packages/samples/sources/programmability/publisher.move Switches cleanup in the test snippet to std::unit_test::destroy.
packages/samples/sources/programmability/dynamic-object-fields.move Switches cleanup in the test snippet to std::unit_test::destroy.
packages/samples/sources/programmability/collections-4.move Adds explicit u8 literal to avoid inference ambiguity in examples.
packages/samples/sources/programmability/collections-2.move Adds explicit u8 literal to avoid inference ambiguity in examples.
packages/samples/sources/move-basics/string.move Adds an additional string/bytes example line (currently incorrect as written).
packages/samples/sources/move-basics/control-flow.move Adds explicit u64 literal for clarity/typing in an example.
packages/samples/sources/move-basics/comments-line.move Adds explicit u8 literal for clarity/typing in an example.
packages/samples/Move.lock Regenerates the samples lockfile to the newer format/version.
packages/samples/.gitignore Ignores trace/coverage outputs for the samples package.
packages/hello_world/Move.lock Regenerates the hello_world lockfile to the newer format/version.
book/testing/index.md Adds Testing chapter landing page.
book/testing/testing-basics.md Adds overview of Move’s unit testing model and CLI usage.
book/testing/good-tests.md Adds guidance on what makes tests effective and maintainable.
book/testing/test-utilities.md Documents std::unit_test helpers (assert_eq!, destroy, etc.).
book/testing/transaction-context.md Documents ways to construct/simulate TxContext in tests.
book/testing/test-scenario.md Documents multi-transaction testing with sui::test_scenario.
book/testing/using-system-objects.md Documents test creation/usage of system objects (Clock/Random/DenyList/etc.).
book/testing/builder-pattern.md Builder-pattern chapter referencing the new sample code via anchors.
book/testing/random-test.md Documents #[random_test] property-style testing.
book/testing/extend-foreign-module.md Documents module extensions for test helpers (e.g., foreign types).
book/testing/coverage.md Documents Move coverage generation and output formats.
book/testing/gas-profiling.md Documents test statistics, traces, and gas profiling workflows.
book/sidebar.yml Adds the new Testing section and page ordering to the sidebar.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

@manolisliolios manolisliolios left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stamp

@damirka damirka merged commit 939bc78 into main Feb 9, 2026
@damirka damirka deleted the book/testing-2 branch February 9, 2026 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants