It should be the following.
pm.test("Name", function(){
pm.expect(inputName.toUpperCase()).to.eql(resName.toUpperCase());
})`
Because you aren’t calling the toUpperCase() function properly, the way you had it is basically comparing the text [Function: toUpperCase] for both variables. (Therefore passing each time).