New unit test for is_primary function