Update test framework: fix run_tests.py to support all test files, add auto-import-check for test files

This commit is contained in:
qiaoxinjiu
2026-05-09 15:11:30 +08:00
parent eb053a347f
commit eaba8328da
21739 changed files with 2236758 additions and 719 deletions

25
node_modules/bintrees/examples/client.html generated vendored Normal file
View File

@@ -0,0 +1,25 @@
<!doctype html>
<html>
<head>
<title>simple browser test</title>
<script src="../dist/rbtree.js"></script>
<script src="../dist/bintree.js"></script>
<script>
function test(tree) {
var tree = new tree(function(a,b) { return a - b; });
tree.insert(1);
tree.insert(2);
tree.insert(3);
tree.remove(2);
tree.each(function(d) {
console.log(d);
});
}
test(RBTree);
test(BinTree);
</script>
</head>
<body>
This test just makes sure the script loads and <em>something</em> works. More comprehensive tests are located in the /test directory.
</body>
</html>

13
node_modules/bintrees/examples/node.js generated vendored Normal file
View File

@@ -0,0 +1,13 @@
var Tree = require('..').RBTree;
// create a new tree, pass in the compare function
var tree = new Tree(function(a, b) { return a - b; });
// do some inserts
tree.insert(1);
tree.insert(2);
tree.insert(3);
tree.remove(2);
// get smallest item
tree.min();