Skip to content

Commit c393921

Browse files
committed
fix(types): add type_info field to test-only struct literals
5 files had test code constructing Hypothesis/Variable without the type_info field added in the type-system PR. Adds `type_info: None` to all test struct literals and fixes Hypothesis::new() call in types/mod.rs test to use a direct struct literal. 628 tests pass, 0 failures. https://claude.ai/code/session_01FYkVX52Tdn6Arp9dWfPLxq
1 parent 77d1ec0 commit c393921

5 files changed

Lines changed: 7 additions & 2 deletions

File tree

src/rust/gnn/graph.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -736,6 +736,7 @@ mod tests {
736736
name: "h_nat".to_string(),
737737
ty: Term::Const("Nat".to_string()),
738738
body: None,
739+
type_info: None,
739740
};
740741

741742
let theorem = Theorem {
@@ -778,6 +779,7 @@ mod tests {
778779
variables: vec![Variable {
779780
name: "n".to_string(),
780781
ty: Term::Const("Nat".to_string()),
782+
type_info: None,
781783
}],
782784
},
783785
proof_script: Vec::new(),

src/rust/gnn/guided_search.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,7 @@ mod tests {
384384
name: "h".to_string(),
385385
ty: Term::Const("Nat".to_string()),
386386
body: None,
387+
type_info: None,
387388
}],
388389
}],
389390
context: Context {
@@ -393,6 +394,7 @@ mod tests {
393394
variables: vec![Variable {
394395
name: "n".to_string(),
395396
ty: Term::Const("Nat".to_string()),
397+
type_info: None,
396398
}],
397399
},
398400
proof_script: Vec::new(),

src/rust/learning/self_play.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ mod tests {
192192
name: "h0".to_string(),
193193
ty: Term::Const("P".to_string()),
194194
body: None,
195+
type_info: None,
195196
}],
196197
});
197198
s

src/rust/provers/metamath.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,6 +1021,7 @@ mod tests {
10211021
state.context.variables.push(Variable {
10221022
name: "x".to_string(),
10231023
ty: Term::Const("nat".to_string()),
1024+
type_info: None,
10241025
});
10251026

10261027
let exported = backend.export(&state).await.unwrap();

src/rust/types/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -456,8 +456,7 @@ mod tests {
456456
#[test]
457457
fn hypothesis_with_type_info_roundtrips() {
458458
use crate::core::Hypothesis;
459-
let h = Hypothesis::new("h", Term::Const("Nat".to_string()))
460-
.with_type_info(TypeInfo::new().with_multiplicity(Multiplicity::Linear));
459+
let h = Hypothesis { name: "h".into(), ty: Term::Const("Nat".to_string()), body: None, type_info: Some(TypeInfo::new().with_multiplicity(Multiplicity::Linear)) };
461460
let json = serde_json::to_string(&h).expect("serialize");
462461
assert!(json.contains("Linear"));
463462
let back: Hypothesis = serde_json::from_str(&json).expect("deserialize");

0 commit comments

Comments
 (0)