Skip to content

test: move the observe() compile-fail case to a doctest - #489

Merged
lxsaah merged 1 commit into
feat/typed-record-keysfrom
claude/elegant-mendel-kwt6jt
Nov 15, 2026
Merged

lxsaah merged 1 commit into
feat/typed-record-keysfrom
claude/elegant-mendel-kwt6jt

Conversation

@lxsaah

@lxsaah lxsaah commented Nov 15, 2026

Copy link
Copy Markdown
Member

Description

Fixes the red Build & Test on #487 after #488 was merged.

#488 added tests/compile-fail/typed_key_contract_verbs_on_name.rs, which also checked .observe(). The compile_fail trybuild suite runs under several feature sets. One of them, alloc,linkable-json,migratable, does not enable observable, so ObservableRegistrarExt doesn't exist there. The import failed to resolve and the expected output didn't match (CI job 132972249694).

  • The observe() case is removed from the trybuild file, and its .stderr is regenerated for the remaining five contract verbs (linked_to, linked_from, linked_to_with, publish, subscribe).
  • observe() on an Undeclared registrar is now covered by a compile_fail,E0277 doctest on ObservableRegistrarExt::observe, which only builds with observable. I checked that the same snippet with a Declared registrar compiles, so the doctest fails because of the schema state and not some other error.

Related Issue

Validation

  • cargo test -p aimdb-data-contracts --test compile_fail with the full feature set: passes
  • cargo test -p aimdb-data-contracts --no-default-features --features alloc,linkable-json,migratable --test compile_fail (the failing CI configuration): passes
  • cargo test -p aimdb-data-contracts --features <full> --doc observ: passes

Checklist

  • I have read the CONTRIBUTING.md document.
  • My code follows the project's coding standards.
  • I have added tests to cover my changes.
  • All new and existing tests passed (make check): the affected suite passes locally; awaiting CI.
  • I have updated the documentation accordingly.

Generated by Claude Code

The trybuild suite also runs without the observable feature
(alloc,linkable-json,migratable), where ObservableRegistrarExt does not
exist, so the contract-verbs case failed to resolve its import. Cover
observe() with a compile_fail doctest on the method instead, which only
builds when the feature is on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGkDJ9Sps6DnUDtpdbs6kD
@lxsaah
lxsaah merged commit 87c54c8 into feat/typed-record-keys Nov 15, 2026
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.

2 participants