[tests] Test chan/func encode, fix ShouldFail tests to actually check the right failure case.