summaryrefslogtreecommitdiff
path: root/lib/splay/tests/splay.t
diff options
context:
space:
mode:
authorSébastien Dailly <sebastien@dailly.me>2026-04-30 09:16:03 +0200
committerSébastien Dailly <sebastien@dailly.me>2026-05-06 16:45:25 +0200
commit960d5b8f2728f71dd9ce038d527844d82ca2f0f2 (patch)
tree9a15dc43f91a0b58a3aaa10223bba35abf7ef5f2 /lib/splay/tests/splay.t
parenta5efd7d15b4d049a4ed539ed5d9c2f1037d00973 (diff)
Allow updates for existing contents
Diffstat (limited to 'lib/splay/tests/splay.t')
-rw-r--r--lib/splay/tests/splay.t24
1 files changed, 17 insertions, 7 deletions
diff --git a/lib/splay/tests/splay.t b/lib/splay/tests/splay.t
index 64f77a6..7b49803 100644
--- a/lib/splay/tests/splay.t
+++ b/lib/splay/tests/splay.t
@@ -1,8 +1,18 @@
-Tests for the splay tree. The tree representation used in the tests follow the
-dot syntax
+Tests for the splay tree.
See https://en.wikipedia.org/wiki/Splay_tree
+The test build a splay tree with the node given as argument, then display the
+representation using the dot syntax.
+
+ $ tests --splay_tree \
+ > --help
+ Start the tests
+ --add Add an element in the tree
+ --del Remove an element from the tree
+ --get Get an element from the tree
+ -help Display this list of options
+ --help Display this list of options
The root is the latest inserted node:
@@ -17,7 +27,7 @@ The root is the latest inserted node:
"5" -> leaf_1
leaf_2 [shape=point]
"5" -> leaf_2
- }
+ }
$ tests --splay_tree \
> --add 3 \
@@ -30,7 +40,7 @@ The root is the latest inserted node:
"3" -> leaf_1
leaf_2 [shape=point]
"5" -> leaf_2
- }
+ }
Collecting an element in the tree will push this node at the root:
@@ -50,7 +60,7 @@ Collecting an element in the tree will push this node at the root:
"3" -> leaf_2
leaf_3 [shape=point]
"3" -> leaf_3
- }
+ }
$ tests --splay_tree \
> --add 1 \
@@ -72,7 +82,7 @@ Collecting an element in the tree will push this node at the root:
"4" -> leaf_3
leaf_4 [shape=point]
"4" -> leaf_4
- }
+ }
Removing an element from the tree modify the structure
@@ -89,5 +99,5 @@ Removing an element from the tree modify the structure
"3" -> leaf_1
leaf_2 [shape=point]
"3" -> leaf_2
- }
+ }