Enum.k 436 B

12345678910111213141516171819202122
  1. invoke {
  2. enum E { A, B, C }
  3. enum E1 { A, B, C }
  4. assert E.A is E
  5. assert E.B is E
  6. assert E.C is E
  7. assert E1.A is not E
  8. assert Nil is not E
  9. assert E1.A !~ E.A
  10. assert E1.A <!=> E.A
  11. assert E is Enumerable
  12. assert E is Iterable
  13. for Val in E {
  14. assert Val is E
  15. }
  16. for { name: Val } in E {
  17. assert Val is E
  18. assert E[name] ~~ Val
  19. assert E[name] <=> Val
  20. }
  21. }