[unit tests] add some unit tests

Not all pass right now, happy for tests to be changed/deleted if not applicable.