Page MenuHomePhabricator

in Wikifunctions, there's no way to test that a function returns void instead of another object
Open, LowPublic

Description

I was curious about what the built-in function https://www.wikifunctions.org/wiki/Z860 can do, but its tests are not connected (perhaps because it's a built-in). As a workaround, I made a wrapper function that just calls it using a composition: https://www.wikifunctions.org/wiki/Z21233 .

I made two tests for it. In the first, "de" is supposed to return the language object for German, and it passes.

In the second, I give it a string that is an invalid language code, and I expect it to return Z24/void. If I send the same string in the "Try this function" form, it returns Z24/void, as I would expect. This test fails, however. The failure details are kind of sensible, because deep in the Z5/Error object, there's Z541, which means "Language code not found". But how can I make it into a test that passes?

I've been told on Telegram that this may be a case of T351472, and it sounds right, but that task is much more generic. To be on the safe site, I'm also reporting this one, with a more concrete example.

Event Timeline

Yes, I think that Z60/Natural language should have an identity key, which would make this issue go away.