| 1 | // vtest retry: 3 |
| 2 | import v.tests.project_with_c_code_2.modc |
| 3 | |
| 4 | fn test_using_c_code_in_the_same_module_works() { |
| 5 | x := modc.new_vtype(123) |
| 6 | modc.destroy_vtype(x) |
| 7 | assert true |
| 8 | } |
| 9 | |
| 10 | fn test_enum_with_dups_on_the_cside() { |
| 11 | for e in [modc.MyEnum.unknown, .name1, .name2, .name3, .name4, .name5, .name6, .common_name1, |
| 12 | .common_name2, .common_name3] { |
| 13 | println('>>> e: ${e} | int(e): ${int(e)}') |
| 14 | } |
| 15 | assert modc.MyEnum.name1 == modc.MyEnum.common_name1 |
| 16 | assert modc.MyEnum.name2 == modc.MyEnum.common_name2 |
| 17 | assert modc.MyEnum.name3 == modc.MyEnum.common_name3 |
| 18 | assert modc.MyEnum.name4 != modc.MyEnum.common_name1 |
| 19 | assert modc.MyEnum.name5 != modc.MyEnum.common_name2 |
| 20 | assert modc.MyEnum.name6 != modc.MyEnum.common_name3 |
| 21 | } |
| 22 | |