// ── ILEmitterTests_Integration__CrossNamespace_EnumMatched ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Integration.cs::CrossNamespace_EnumMatched topic: enum status: verified // verified behavior: Test.go(...) == "E" namespace Model enum Role { admin editor viewer } // ── ILEmitterTests2__Enum_ExplicitValues_CorrectConstants ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests2.cs::Enum_ExplicitValues_CorrectConstants topic: enum status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test enum Priority { low = 1 medium = 5 high = 10 } func test() -> int { return 0 } // ── ILEmitterTests2__Enum_Member_Access_And_Comparison_Pin ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests2.cs::Enum_Member_Access_And_Comparison_Pin topic: enum status: verified // verified behavior: Test.test(...) == 2 namespace Test enum Suit { hearts, diamonds, clubs, spades } func is_red(s: Suit) -> bool { if s == .hearts { return true } if s == .diamonds { return true } return false } func test() -> int { var red = 0 if is_red(.hearts) { red = red + 1 } if is_red(.diamonds) { red = red + 1 } if is_red(.clubs) { red = red + 1 } if is_red(.spades) { red = red + 1 } return red } // ── ILEmitterTests2__Enum_MixedAutoAndExplicit ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests2.cs::Enum_MixedAutoAndExplicit topic: enum status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test enum Level { a b = 10 c } func test() -> int { return 0 } // ── ILEmitterTests3__Enum_Cases_Have_Sequential_Values ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Enum_Cases_Have_Sequential_Values topic: enum status: verified // verified behavior: Test.test(...) == 210 namespace Test enum Code { a, b, c } func ord(c: Code) -> int { if c == .a { return 0 } if c == .b { return 1 } if c == .c { return 2 } return -1 } func test() -> int { return ord(.a) + ord(.b) * 10 + ord(.c) * 100 } // ── IndexDiagnosticTests__IndexingEnum_Errors ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: IndexDiagnosticTests.cs::IndexingEnum_Errors topic: enum status: verified // verified behavior: reports diagnostic ES2145 namespace Test enum E { a b c } func f(e: E) -> int { return e[0] } // ── TranspilerTests__Transpiles_Enum_Declaration ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: TranspilerTests.cs::Transpiles_Enum_Declaration topic: enum status: verified // compiles cleanly (no auto-run claim was extracted) namespace Dir pub enum Direction { north south } // ── ILEmitterTests3__Enum_Equality ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Enum_Equality topic: enum status: unverified // verified behavior: Test.test(...) == true namespace Test enum Code { a, b, c } func test() -> bool { let x = Code.a let y = Code.a return x == y }