diff options
author | Aria <me@aria.rip> | 2023-11-30 13:13:11 +0000 |
---|---|---|
committer | Aria <me@aria.rip> | 2023-11-30 13:13:11 +0000 |
commit | eb697c607bdbf0b768e06dca701c14761206f344 (patch) | |
tree | eeb1d601aa9c9c1d0f70410f075c1ba8e9506f1c /src | |
parent | 4aab30e99bcea7f32469048916be5342ea3c0f4d (diff) |
test: remove old tests and fix one remaining one
easier than changing them all, this is fine for now
Diffstat (limited to 'src')
37 files changed, 4 insertions, 306 deletions
diff --git a/src/tests/.gitignore b/src/tests/.gitignore index e9a847e..fd0eef2 100644 --- a/src/tests/.gitignore +++ b/src/tests/.gitignore @@ -1,2 +1,3 @@ */target -target
\ No newline at end of file +target +types.rs
\ No newline at end of file diff --git a/src/tests/Cargo.toml b/src/tests/Cargo.toml index e7372e9..d4d9ab2 100644 --- a/src/tests/Cargo.toml +++ b/src/tests/Cargo.toml @@ -1,16 +1,5 @@ [workspace] resolver = "2" members = [ - "b_asc_con", - "b_asc_con_ra", - "b_des_con", - "b_des_con_ra", - "b_stack_con", - "b_unique_asc_con", - "b_unique_asc_con_ra", - "b_unique_con", - "b_unique_con_ra", - "example_comp", "example_stack", - "example_unique" ]
\ No newline at end of file diff --git a/src/tests/b_asc_con/Cargo.toml b/src/tests/b_asc_con/Cargo.toml deleted file mode 100644 index 654d8ab..0000000 --- a/src/tests/b_asc_con/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "b_asc_con" -version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] diff --git a/src/tests/b_asc_con/src/main.rs b/src/tests/b_asc_con/src/main.rs deleted file mode 100644 index 0d18aee..0000000 --- a/src/tests/b_asc_con/src/main.rs +++ /dev/null @@ -1,11 +0,0 @@ -mod types; -use types::*; - -fn main() { - let mut c = AscendingCon::<u32>::new(); - for x in 0..10 { - c.insert(x); - c.insert(x); - } - assert_eq!(c.len(), 20); -} diff --git a/src/tests/b_asc_con/src/types.pr.rs b/src/tests/b_asc_con/src/types.pr.rs deleted file mode 100644 index 12d3d02..0000000 --- a/src/tests/b_asc_con/src/types.pr.rs +++ /dev/null @@ -1,6 +0,0 @@ -/*SPEC* -property ascending<T> { - \c -> ((for-all-consecutive-pairs c) leq?) -} -type AscendingCon<T> = {c impl (Container) | (ascending c)} -*ENDSPEC*/ diff --git a/src/tests/b_asc_con_ra/Cargo.toml b/src/tests/b_asc_con_ra/Cargo.toml deleted file mode 100644 index 9bbe454..0000000 --- a/src/tests/b_asc_con_ra/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "b_asc_con_ra" -version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] diff --git a/src/tests/b_asc_con_ra/src/main.rs b/src/tests/b_asc_con_ra/src/main.rs deleted file mode 100644 index 0d18aee..0000000 --- a/src/tests/b_asc_con_ra/src/main.rs +++ /dev/null @@ -1,11 +0,0 @@ -mod types; -use types::*; - -fn main() { - let mut c = AscendingCon::<u32>::new(); - for x in 0..10 { - c.insert(x); - c.insert(x); - } - assert_eq!(c.len(), 20); -} diff --git a/src/tests/b_asc_con_ra/src/types.pr.rs b/src/tests/b_asc_con_ra/src/types.pr.rs deleted file mode 100644 index 4d33cb9..0000000 --- a/src/tests/b_asc_con_ra/src/types.pr.rs +++ /dev/null @@ -1,6 +0,0 @@ -/*SPEC* -property ascending<T> { - \c -> ((for-all-consecutive-pairs c) leq?) -} -type AscendingCon<T> = {c impl (Container, Indexable) | (ascending c)} -*ENDSPEC*/ diff --git a/src/tests/b_des_con/Cargo.toml b/src/tests/b_des_con/Cargo.toml deleted file mode 100644 index b1d0d61..0000000 --- a/src/tests/b_des_con/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "b_des_con" -version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] diff --git a/src/tests/b_des_con/src/main.rs b/src/tests/b_des_con/src/main.rs deleted file mode 100644 index b64347b..0000000 --- a/src/tests/b_des_con/src/main.rs +++ /dev/null @@ -1,11 +0,0 @@ -mod types; -use types::*; - -fn main() { - let mut c = DescendingCon::<u32>::new(); - for x in 0..10 { - c.insert(x); - c.insert(x); - } - assert_eq!(c.len(), 20); -} diff --git a/src/tests/b_des_con/src/types.pr.rs b/src/tests/b_des_con/src/types.pr.rs deleted file mode 100644 index 63f15ff..0000000 --- a/src/tests/b_des_con/src/types.pr.rs +++ /dev/null @@ -1,6 +0,0 @@ -/*SPEC* -property descending<T> { - \c -> ((for-all-consecutive-pairs c) geq?) -} -type DescendingCon<T> = {c impl (Container) | (descending c)} -*ENDSPEC*/ diff --git a/src/tests/b_des_con_ra/Cargo.toml b/src/tests/b_des_con_ra/Cargo.toml deleted file mode 100644 index 5ea4fd4..0000000 --- a/src/tests/b_des_con_ra/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "b_des_con_ra" -version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] diff --git a/src/tests/b_des_con_ra/src/main.rs b/src/tests/b_des_con_ra/src/main.rs deleted file mode 100644 index b64347b..0000000 --- a/src/tests/b_des_con_ra/src/main.rs +++ /dev/null @@ -1,11 +0,0 @@ -mod types; -use types::*; - -fn main() { - let mut c = DescendingCon::<u32>::new(); - for x in 0..10 { - c.insert(x); - c.insert(x); - } - assert_eq!(c.len(), 20); -} diff --git a/src/tests/b_des_con_ra/src/types.pr.rs b/src/tests/b_des_con_ra/src/types.pr.rs deleted file mode 100644 index db5adb0..0000000 --- a/src/tests/b_des_con_ra/src/types.pr.rs +++ /dev/null @@ -1,6 +0,0 @@ -/*SPEC* -property descending<T> { - \c -> ((for-all-consecutive-pairs c) geq?) -} -type DescendingCon<T> = {c impl (Container, Indexable) | (descending c)} -*ENDSPEC*/ diff --git a/src/tests/b_stack_con/Cargo.toml b/src/tests/b_stack_con/Cargo.toml deleted file mode 100644 index 6668e3d..0000000 --- a/src/tests/b_stack_con/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "b_stack_con" -version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] diff --git a/src/tests/b_stack_con/src/main.rs b/src/tests/b_stack_con/src/main.rs deleted file mode 100644 index 7c83f6b..0000000 --- a/src/tests/b_stack_con/src/main.rs +++ /dev/null @@ -1,11 +0,0 @@ -mod types; -use types::*; - -fn main() { - let mut c = StackCon::<u32>::new(); - for x in 0..10 { - c.insert(x); - c.insert(x); - } - assert_eq!(c.len(), 20); -} diff --git a/src/tests/b_stack_con/src/types.pr.rs b/src/tests/b_stack_con/src/types.pr.rs deleted file mode 100644 index 525fdee..0000000 --- a/src/tests/b_stack_con/src/types.pr.rs +++ /dev/null @@ -1,7 +0,0 @@ -/*SPEC* -property lifo<T> { - \c <: (Stack) -> (forall \x -> ((equal? (pop ((push c) x))) x)) -} - -type StackCon<S> = {c impl (Container, Stack) | (lifo c)} -*ENDSPEC*/ diff --git a/src/tests/b_unique_asc_con/Cargo.toml b/src/tests/b_unique_asc_con/Cargo.toml deleted file mode 100644 index 8d4c00f..0000000 --- a/src/tests/b_unique_asc_con/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "b_unique_asc_con" -version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] diff --git a/src/tests/b_unique_asc_con/src/main.rs b/src/tests/b_unique_asc_con/src/main.rs deleted file mode 100644 index 2eac169..0000000 --- a/src/tests/b_unique_asc_con/src/main.rs +++ /dev/null @@ -1,11 +0,0 @@ -mod types; -use types::*; - -fn main() { - let mut c = StrictlyAscendingCon::<u32>::new(); - for x in 0..10 { - c.insert(x); - c.insert(x); - } - assert_eq!(c.len(), 10); -} diff --git a/src/tests/b_unique_asc_con/src/types.pr.rs b/src/tests/b_unique_asc_con/src/types.pr.rs deleted file mode 100644 index e84858e..0000000 --- a/src/tests/b_unique_asc_con/src/types.pr.rs +++ /dev/null @@ -1,10 +0,0 @@ -/*SPEC* -property unique<T> { - \c <: (Container) -> ((for-all-elems c) \a -> ((unique-count? a) c)) -} -property ascending<T> { - \c -> ((for-all-consecutive-pairs c) leq?) -} - -type StrictlyAscendingCon<S> = {c impl (Container) | ((unique c) and (ascending c))} -*ENDSPEC*/ diff --git a/src/tests/b_unique_asc_con_ra/Cargo.toml b/src/tests/b_unique_asc_con_ra/Cargo.toml deleted file mode 100644 index bb3fb42..0000000 --- a/src/tests/b_unique_asc_con_ra/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "b_unique_asc_con_ra" -version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] diff --git a/src/tests/b_unique_asc_con_ra/src/main.rs b/src/tests/b_unique_asc_con_ra/src/main.rs deleted file mode 100644 index 2eac169..0000000 --- a/src/tests/b_unique_asc_con_ra/src/main.rs +++ /dev/null @@ -1,11 +0,0 @@ -mod types; -use types::*; - -fn main() { - let mut c = StrictlyAscendingCon::<u32>::new(); - for x in 0..10 { - c.insert(x); - c.insert(x); - } - assert_eq!(c.len(), 10); -} diff --git a/src/tests/b_unique_asc_con_ra/src/types.pr.rs b/src/tests/b_unique_asc_con_ra/src/types.pr.rs deleted file mode 100644 index ed64180..0000000 --- a/src/tests/b_unique_asc_con_ra/src/types.pr.rs +++ /dev/null @@ -1,10 +0,0 @@ -/*SPEC* -property unique<T> { - \c <: (Container) -> ((for-all-elems c) \a -> ((unique-count? a) c)) -} -property ascending<T> { - \c -> ((for-all-consecutive-pairs c) leq?) -} - -type StrictlyAscendingCon<S> = {c impl (Container, Indexable) | ((unique c) and (ascending c))} -*ENDSPEC*/ diff --git a/src/tests/b_unique_con/Cargo.toml b/src/tests/b_unique_con/Cargo.toml deleted file mode 100644 index 3ad6e18..0000000 --- a/src/tests/b_unique_con/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "b_unique_con" -version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] diff --git a/src/tests/b_unique_con/src/main.rs b/src/tests/b_unique_con/src/main.rs deleted file mode 100644 index a2b4246..0000000 --- a/src/tests/b_unique_con/src/main.rs +++ /dev/null @@ -1,11 +0,0 @@ -mod types; -use types::*; - -fn main() { - let mut c = UniqueCon::<u32>::new(); - for x in 0..10 { - c.insert(x); - c.insert(x); - } - assert_eq!(c.len(), 10); -} diff --git a/src/tests/b_unique_con/src/types.pr.rs b/src/tests/b_unique_con/src/types.pr.rs deleted file mode 100644 index 7393cce..0000000 --- a/src/tests/b_unique_con/src/types.pr.rs +++ /dev/null @@ -1,7 +0,0 @@ -/*SPEC* -property unique<T> { - \c <: (Container) -> ((for-all-elems c) \a -> ((unique-count? a) c)) -} - -type UniqueCon<S> = {c impl (Container) | (unique c)} -*ENDSPEC*/ diff --git a/src/tests/b_unique_con_ra/Cargo.toml b/src/tests/b_unique_con_ra/Cargo.toml deleted file mode 100644 index 8bc19d5..0000000 --- a/src/tests/b_unique_con_ra/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "b_unique_con_ra" -version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] diff --git a/src/tests/b_unique_con_ra/src/main.rs b/src/tests/b_unique_con_ra/src/main.rs deleted file mode 100644 index a2b4246..0000000 --- a/src/tests/b_unique_con_ra/src/main.rs +++ /dev/null @@ -1,11 +0,0 @@ -mod types; -use types::*; - -fn main() { - let mut c = UniqueCon::<u32>::new(); - for x in 0..10 { - c.insert(x); - c.insert(x); - } - assert_eq!(c.len(), 10); -} diff --git a/src/tests/b_unique_con_ra/src/types.pr.rs b/src/tests/b_unique_con_ra/src/types.pr.rs deleted file mode 100644 index 7562dd7..0000000 --- a/src/tests/b_unique_con_ra/src/types.pr.rs +++ /dev/null @@ -1,7 +0,0 @@ -/*SPEC* -property unique<T> { - \c <: (Container) -> ((for-all-elems c) \a -> ((unique-count? a) c)) -} - -type UniqueCon<S> = {c impl (Container, Indexable) | (unique c)} -*ENDSPEC*/ diff --git a/src/tests/example_comp/Cargo.toml b/src/tests/example_comp/Cargo.toml deleted file mode 100644 index 67639f2..0000000 --- a/src/tests/example_comp/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "example_comp" -version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] diff --git a/src/tests/example_comp/src/main.rs b/src/tests/example_comp/src/main.rs deleted file mode 100644 index d87425b..0000000 --- a/src/tests/example_comp/src/main.rs +++ /dev/null @@ -1,12 +0,0 @@ -mod types; -use types::*; - -fn main() { - let mut c = StrictlyAscendingCon::<u32>::new(); - for x in 0..10 { - c.insert(x); - c.insert(x); - //c.first(); - } - assert_eq!(c.len(), 10); -} diff --git a/src/tests/example_comp/src/types.pr.rs b/src/tests/example_comp/src/types.pr.rs deleted file mode 100644 index ed64180..0000000 --- a/src/tests/example_comp/src/types.pr.rs +++ /dev/null @@ -1,10 +0,0 @@ -/*SPEC* -property unique<T> { - \c <: (Container) -> ((for-all-elems c) \a -> ((unique-count? a) c)) -} -property ascending<T> { - \c -> ((for-all-consecutive-pairs c) leq?) -} - -type StrictlyAscendingCon<S> = {c impl (Container, Indexable) | ((unique c) and (ascending c))} -*ENDSPEC*/ diff --git a/src/tests/example_stack/Cargo.toml b/src/tests/example_stack/Cargo.toml index 3010313..9827bef 100644 --- a/src/tests/example_stack/Cargo.toml +++ b/src/tests/example_stack/Cargo.toml @@ -6,3 +6,4 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] +primrose-library = { path = "../../crates/library" }
\ No newline at end of file diff --git a/src/tests/example_stack/src/main.rs b/src/tests/example_stack/src/main.rs index daa44d0..d36e683 100644 --- a/src/tests/example_stack/src/main.rs +++ b/src/tests/example_stack/src/main.rs @@ -2,7 +2,7 @@ mod types; use types::*; fn main() { - let mut c = StackCon::<u32>::new(); + let mut c = StackCon::<u32>::default(); for x in 0..10 { c.insert(x); c.insert(x); diff --git a/src/tests/example_unique/Cargo.toml b/src/tests/example_unique/Cargo.toml deleted file mode 100644 index 732c903..0000000 --- a/src/tests/example_unique/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "example_unique" -version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] diff --git a/src/tests/example_unique/src/main.rs b/src/tests/example_unique/src/main.rs deleted file mode 100644 index 0f6c143..0000000 --- a/src/tests/example_unique/src/main.rs +++ /dev/null @@ -1,12 +0,0 @@ -mod types; -use types::*; - -fn main() { - let mut c = UniqueCon::<u32>::new(); - for x in 0..10 { - c.insert(x); - c.insert(x); - //c.first(); - } - assert_eq!(c.len(), 10); -} diff --git a/src/tests/example_unique/src/types.pr.rs b/src/tests/example_unique/src/types.pr.rs deleted file mode 100644 index 7393cce..0000000 --- a/src/tests/example_unique/src/types.pr.rs +++ /dev/null @@ -1,7 +0,0 @@ -/*SPEC* -property unique<T> { - \c <: (Container) -> ((for-all-elems c) \a -> ((unique-count? a) c)) -} - -type UniqueCon<S> = {c impl (Container) | (unique c)} -*ENDSPEC*/ |