summaryrefslogtreecommitdiff
path: root/datastructures/test
diff options
context:
space:
mode:
authorGloria Mundi <gloria@gloria-mundi.eu>2024-03-15 01:48:00 +0100
committerGloria Mundi <gloria@gloria-mundi.eu>2024-03-15 01:48:00 +0100
commite9958381801bf44fd0635aaa1e68541b21e193e0 (patch)
treee463b44786fc02e332e4cc205654858f95820105 /datastructures/test
parent7e24d9d392aff890981f13c299b283189d94a75d (diff)
fix persistent and add test
Diffstat (limited to 'datastructures/test')
-rw-r--r--datastructures/test/persistent.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/datastructures/test/persistent.cpp b/datastructures/test/persistent.cpp
new file mode 100644
index 0000000..d98569b
--- /dev/null
+++ b/datastructures/test/persistent.cpp
@@ -0,0 +1,10 @@
+#include "../persistent.cpp"
+
+int main() {
+ int time = 0;
+ persistent<int> p(time, 0);
+ p.set(1);
+ int t1 = time;
+ p.set(2);
+ assert(p.get(t1) == 1);
+}