From 97a70ecd3e70d08fae544dc11cca0fb1e06e5a66 Mon Sep 17 00:00:00 2001 From: Zyad Hassan Date: Wed, 24 Apr 2024 09:28:38 -0700 Subject: Update tests --- tests/lean/BetreeMain/FunsExternal_Template.lean | 6 ------ tests/lean/External/FunsExternal_Template.lean | 6 ------ 2 files changed, 12 deletions(-) (limited to 'tests/lean') diff --git a/tests/lean/BetreeMain/FunsExternal_Template.lean b/tests/lean/BetreeMain/FunsExternal_Template.lean index 0b3e4ef4..0dcce5ca 100644 --- a/tests/lean/BetreeMain/FunsExternal_Template.lean +++ b/tests/lean/BetreeMain/FunsExternal_Template.lean @@ -28,9 +28,3 @@ axiom betree_utils.load_leaf_node axiom betree_utils.store_leaf_node : U64 → betree.List (U64 × U64) → State → Result (State × Unit) -/- [core::option::{core::option::Option}::unwrap]: - Source: '/rustc/d59363ad0b6391b7fc5bbb02c9ccf9300eef3753/library/core/src/option.rs', lines 932:4-932:34 - Name pattern: core::option::{core::option::Option<@T>}::unwrap -/ -axiom core.option.Option.unwrap - (T : Type) : Option T → State → Result (State × T) - diff --git a/tests/lean/External/FunsExternal_Template.lean b/tests/lean/External/FunsExternal_Template.lean index 38151dc9..34b0552a 100644 --- a/tests/lean/External/FunsExternal_Template.lean +++ b/tests/lean/External/FunsExternal_Template.lean @@ -18,9 +18,3 @@ axiom core.mem.swap axiom core.num.nonzero.NonZeroU32.new : U32 → State → Result (State × (Option core.num.nonzero.NonZeroU32)) -/- [core::option::{core::option::Option}::unwrap]: - Source: '/rustc/d59363ad0b6391b7fc5bbb02c9ccf9300eef3753/library/core/src/option.rs', lines 932:4-932:34 - Name pattern: core::option::{core::option::Option<@T>}::unwrap -/ -axiom core.option.Option.unwrap - (T : Type) : Option T → State → Result (State × T) - -- cgit v1.2.3 From 1728dced8484befe35ef61fdf4ccd62b93fbb19d Mon Sep 17 00:00:00 2001 From: Zyad Hassan Date: Wed, 24 Apr 2024 10:01:27 -0700 Subject: Fix a couple of tests --- tests/lean/BetreeMain/Funs.lean | 4 ++-- tests/lean/BetreeMain/FunsExternal.lean | 5 ----- tests/lean/External/Funs.lean | 3 ++- tests/lean/External/FunsExternal.lean | 5 ----- 4 files changed, 4 insertions(+), 13 deletions(-) (limited to 'tests/lean') diff --git a/tests/lean/BetreeMain/Funs.lean b/tests/lean/BetreeMain/Funs.lean index 0c31b9bc..57b334fa 100644 --- a/tests/lean/BetreeMain/Funs.lean +++ b/tests/lean/BetreeMain/Funs.lean @@ -238,11 +238,11 @@ divergent def betree.Node.apply_upserts betree.Node.apply_upserts msgs1 (some v) key st else do - let (st1, v) ← core.option.Option.unwrap U64 prev st + let v ← core.option.Option.unwrap U64 prev let msgs1 ← betree.List.push_front (U64 × betree.Message) msgs (key, betree.Message.Insert v) - Result.ok (st1, (v, msgs1)) + Result.ok (st, (v, msgs1)) /- [betree_main::betree::{betree_main::betree::Internal#4}::lookup_in_children]: Source: 'src/betree.rs', lines 395:4-395:63 -/ diff --git a/tests/lean/BetreeMain/FunsExternal.lean b/tests/lean/BetreeMain/FunsExternal.lean index 71d26da4..d26177fb 100644 --- a/tests/lean/BetreeMain/FunsExternal.lean +++ b/tests/lean/BetreeMain/FunsExternal.lean @@ -28,8 +28,3 @@ def betree_utils.load_leaf_node def betree_utils.store_leaf_node : U64 → betree.List (U64 × U64) → State → Result (State × Unit) := fun _ _ _ => .fail .panic - -/- [core::option::Option::{0}::unwrap] -/ -def core.option.Option.unwrap - (T : Type) : Option T → State → Result (State × T) := - fun _ _ => .fail .panic diff --git a/tests/lean/External/Funs.lean b/tests/lean/External/Funs.lean index 78e0f95c..3bdd70e3 100644 --- a/tests/lean/External/Funs.lean +++ b/tests/lean/External/Funs.lean @@ -19,7 +19,8 @@ def test_new_non_zero_u32 (x : U32) (st : State) : Result (State × core.num.nonzero.NonZeroU32) := do let (st1, o) ← core.num.nonzero.NonZeroU32.new x st - core.option.Option.unwrap core.num.nonzero.NonZeroU32 o st1 + let o1 ← core.option.Option.unwrap core.num.nonzero.NonZeroU32 o + Result.ok (st1, o1) /- [external::test_vec]: Source: 'src/external.rs', lines 17:0-17:17 -/ diff --git a/tests/lean/External/FunsExternal.lean b/tests/lean/External/FunsExternal.lean index b6efc65f..7adf0922 100644 --- a/tests/lean/External/FunsExternal.lean +++ b/tests/lean/External/FunsExternal.lean @@ -15,8 +15,3 @@ def core.mem.swap def core.num.nonzero.NonZeroU32.new : U32 → State → Result (State × (Option core_num_nonzero_non_zero_u32_t)) := fun _ _ => .fail .panic - -/- [core::option::Option::{0}::unwrap] -/ -def core.option.Option.unwrap - (T : Type) : Option T → State → Result (State × T) := - fun _ _ => .fail .panic -- cgit v1.2.3 From 036756d6bddbcf9bc936489779ed36c7e4d22d14 Mon Sep 17 00:00:00 2001 From: Son Ho Date: Thu, 25 Apr 2024 16:28:30 +0200 Subject: Regenerate and fix the tests --- tests/lean/BetreeMain/Funs.lean | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'tests/lean') diff --git a/tests/lean/BetreeMain/Funs.lean b/tests/lean/BetreeMain/Funs.lean index 0c31b9bc..f0032d51 100644 --- a/tests/lean/BetreeMain/Funs.lean +++ b/tests/lean/BetreeMain/Funs.lean @@ -219,8 +219,8 @@ divergent def betree.Node.lookup_in_bindings Source: 'src/betree.rs', lines 819:4-819:90 -/ divergent def betree.Node.apply_upserts (msgs : betree.List (U64 × betree.Message)) (prev : Option U64) (key : U64) - (st : State) : - Result (State × (U64 × (betree.List (U64 × betree.Message)))) + : + Result (U64 × (betree.List (U64 × betree.Message))) := do let b ← betree.ListPairU64T.head_has_key betree.Message msgs key @@ -235,14 +235,14 @@ divergent def betree.Node.apply_upserts | betree.Message.Upsert s => do let v ← betree.upsert_update prev s - betree.Node.apply_upserts msgs1 (some v) key st + betree.Node.apply_upserts msgs1 (some v) key else do - let (st1, v) ← core.option.Option.unwrap U64 prev st + let v ← core.option.Option.unwrap U64 prev let msgs1 ← betree.List.push_front (U64 × betree.Message) msgs (key, betree.Message.Insert v) - Result.ok (st1, (v, msgs1)) + Result.ok (v, msgs1) /- [betree_main::betree::{betree_main::betree::Internal#4}::lookup_in_children]: Source: 'src/betree.rs', lines 395:4-395:63 -/ @@ -307,13 +307,13 @@ divergent def betree.Node.lookup let (st2, (v, node1)) ← betree.Internal.lookup_in_children (betree.Internal.mk i i1 n n1) key st1 - let (st3, (v1, pending1)) ← + let (v1, pending1) ← betree.Node.apply_upserts (betree.List.Cons (k, - betree.Message.Upsert ufs) l) v key st2 + betree.Message.Upsert ufs) l) v key let ⟨ i2, i3, n2, n3 ⟩ := node1 let msgs1 ← lookup_first_message_for_key_back pending1 - let (st4, _) ← betree.store_internal_node i2 msgs1 st3 - Result.ok (st4, (some v1, betree.Node.Internal (betree.Internal.mk i2 + let (st3, _) ← betree.store_internal_node i2 msgs1 st2 + Result.ok (st3, (some v1, betree.Node.Internal (betree.Internal.mk i2 i3 n2 n3))) | betree.List.Nil => do -- cgit v1.2.3