Test equality with datatypes with refs.