:mag: @aureooms/js-search-tree-spec
Search tree specification for JavaScript. See docs. Parent is @aureooms/js-bst.
// eslint-disable-next-line ava/use-test
import ava from 'ava' ;
import * as spec from '@aureooms/js-search-tree-spec' ;
spec.test(
ava ,
{
name: "DummySearchTree" , // Name for the implementation
empty: compare => new spec.DummySearchTree(compare) , // Return an empty search tree using `compare` to order keys
from: (compare, iterable) => spec.DummySearchTree.from(compare, iterable) , // Return a search tree using `compare` to order keys initialized with the values in iterable
} ,
{
length : true , // Do the implementations maintain a `length` property?
lengths : [0, 1, 16, 17, 31, 32, 33, 63, 64, 65] , // Tree sizes to test.
}
) ;
Description
This package contains a specification test suite for search tree implementations such as @aureooms/js-red-black-tree, @aureooms/js-splay-tree, and @aureooms/js-avl-tree.
