updated tests to use pattern instead of regex