Use better str<->String comparisons

Best practices is to convert String.as_slice() rather than
"string literal".to_string(). Even though they're just in tests so
the extra allocation doesn't matter, best to just get in the habit.