Refactor tests in linear_search.js