test-lib: make test_expect_code a test command