I am not 100% sure, but I don't think these command set, if can take input from stdin.
I looked up on https://github.com/fish-shell/fish-shell/issues/6173
And it seems that the test in fish is a little odd. I could not work it out. However this works.
if /usr/bin/test (somethingsomeCommand) = "hello" echo t else echo f end in bash it is this
if test "$(somethingsomeCommand)" = "hello" then echo t else echo f fi There must be a better answer. But this worked.