improved test cases, date validity function and coercetoChar function