Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 1 addition & 11 deletions distributed_cli/src/contracts/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -703,10 +703,6 @@ fn human_and_json_diagnostics_preserve_same_facts_and_redact_values() {
.to_json()
.expect("diagnostic JSON")
.contains("postgres://"));
assert_eq!(
result.canonical_bytes().expect("canonical result"),
result.canonical_bytes().expect("second canonical result")
);

let decoded: ContractDiagnostic = serde_json::from_value(serde_json::json!({
"code": "CTL-SCHEMA-DRIFT",
Expand Down Expand Up @@ -1251,7 +1247,7 @@ fn write_json_value(path: &Path, value: &Value) {
}

#[test]
fn migration_inventory_is_deterministic_and_preserves_runtime_order() {
fn migration_inventory_preserves_runtime_order() {
let inventory = MigrationInventory::from_repository_root(repository_root())
.expect("repository migration inventory");
let versions = inventory
Expand All @@ -1263,12 +1259,6 @@ fn migration_inventory_is_deterministic_and_preserves_runtime_order() {
versions,
vec![1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
);
assert_eq!(
inventory.canonical_bytes().expect("canonical inventory"),
inventory
.canonical_bytes()
.expect("second canonical inventory")
);
}

#[test]
Expand Down
11 changes: 0 additions & 11 deletions distributed_cli/src/contracts/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -300,15 +300,4 @@ mod tests {
assert!(contracts_accept(&root, ContractAcceptScope::Catalog, &bad).is_err());
let _ = fs::remove_dir_all(root);
}

#[test]
fn check_report_is_no_write() {
// Empty catalog check shape only — catalog construction is covered elsewhere.
let report = ContractsCheckReport {
ok: true,
result: ContractCheckResult::default(),
human: String::new(),
};
assert!(report.ok);
}
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

43 changes: 43 additions & 0 deletions distributed_game_macros/tests/rustc_fail.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
//! Compile failures reported through a trait bound (`#[diagnostic::on_unimplemented]`
//! text or a type mismatch) rather than the macro's own error. Each must fail
//! and name its cause; rustc's notes around it are not pinned. See
//! `tests/support/rustc_fail.rs` at the workspace root.

#[path = "../../tests/support/rustc_fail.rs"]
mod rustc_fail;

#[test]
fn rustc_rejects_generated_code_for_the_named_cause() {
rustc_fail::assert_fail_with(
env!("CARGO_MANIFEST_DIR"),
"tests/rustc_fail",
r#"distributed_game = { path = "{workspace}/distributed_game" }
serde = { version = "1", features = ["derive"] }"#,
&[
(
"game_pure_unsupported_output",
&["`Opaque` has no game payload encoding"],
),
(
"input_buttons_on_float",
&["`#[buttons]` needs a u8, u16 or u32 field, not `f32`"],
),
(
"input_unsupported_field",
&["`String` cannot be a game input field"],
),
(
"replicated_unsupported_type",
&["`i8` cannot be a replicated entity field"],
),
(
"replicated_quant_on_integer",
&["`#[quant]` / `#[angle]` need an `f32` field, not `u8`"],
),
(
"predict_returns_state",
&["E0308", "expected `State`, found `f32`"],
),
],
);
}
2 changes: 2 additions & 0 deletions distributed_macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ trybuild = "=1.0.121"
# Cargo permits dev-dependency cycles.
distributed = { path = ".." }
serde = { version = "1.0", features = ["derive"] }
# Reads `cargo check --message-format=json` in tests/rustc_fail.rs.
serde_json = "1"
Loading
Loading