MCPcopy Create free account
hub / github.com/LPC4/Full-Stack / enum_argument_is_passed_by_value

Function enum_argument_is_passed_by_value

tests/integration/hll_conformance.rs:1793–1815  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1791
1792#[test]
1793fn result_ok_and_err_dispatch() {
1794 // Result<i32, i32> returned from a function and matched at the call site.
1795 assert_exit(
1796 r#"
1797parse: (n: i32) -> Result<i32, i32> {
1798 if n < 0 {
1799 return Err(n)
1800 }
1801 return Ok(n * 2)
1802}
1803
1804main: () -> i32 {
1805 r: Result<i32, i32> = parse(21)
1806 match r {
1807 Ok(v) -> {
1808 return v
1809 }
1810 Err(e) -> {
1811 return e
1812 }
1813 }
1814 return -1
1815}
1816"#,
1817 42,
1818 );

Callers

nothing calls this directly

Calls 1

assert_exitFunction · 0.85

Tested by

no test coverage detected