tests for balanced.js