Carlos Alcaraz says he "passed the test" after earning a straight-set win on his comeback from injury at the Italian Open.