add tests to cover functions in lib/util.js