Added test cases for lib.js