Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tree-layout-tester

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tree-layout-tester - npm Package Compare versions

Comparing version 0.0.0 to 0.0.1

21

layout_test.js

@@ -15,3 +15,3 @@ //Simple tree data structure

var n = root.n
t.equals(layout.root(n), root.v)
t.equals(layout.root(n), root.v, "root " + n)
var ptr = layout.begin(n)

@@ -34,23 +34,20 @@

function visit(node, parent) {
console.log(node.v, node.h)
t.equals(layout.height(n, node.v), node.h)
t.equals(layout.height(n, node.v), node.h, "height " + n + ", " + node.v)
if(parent) {
t.equals(layout.parent(n, node.v), parent.v)
t.equals(layout.parent(n, node.v), parent.v, "parent " + n + ", " + node.v)
}
if(node.left) {
t.equals(layout.left(n, node.v), node.left.v)
t.equals(layout.left(n, node.v), node.left.v, "left " + n + ", " + node.v)
visit(node.left, node)
}
t.equals(ptr, node.v)
t.equals(ptr, node.v, "next " + n + ", " + node.v)
ptr = layout.next(n, ptr)
if(node.right) {
t.equals(layout.right(n, node.v), node.right.v)
t.equals(layout.right(n, node.v), node.right.v, "right " + n + ", " + node.v)
visit(node.right, node)
}
t.equals(layout.lo(n, node.v), leftAncestor(node))
t.equals(layout.hi(n, node.v), rightAncestor(node))
}
visit(root, null)
t.equals(layout.end(n), ptr)
t.equals(layout.end(n), ptr, "end " + n)

@@ -63,3 +60,3 @@ //Do a reverse traversal

ptr = layout.prev(n, ptr)
t.equals(ptr, node.v)
t.equals(ptr, node.v, "prev " + n + ", " + node.v)
if(node.left) {

@@ -70,3 +67,3 @@ rvisit(node.left)

rvisit(root)
t.equals(layout.begin(n), ptr)
t.equals(layout.begin(n), ptr, "begin " + n)
}

@@ -73,0 +70,0 @@

{
"name": "tree-layout-tester",
"version": "0.0.0",
"version": "0.0.1",
"description": "Tests cases for various tree layout algorithms",

@@ -5,0 +5,0 @@ "main": "layout_test.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc