FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
lpython/integration_tests/enum_05.py at main · sak-codes/lpython · GitHub
sak-codes
/
lpython
Public
forked from
lcompilers/lpython
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
lpython
/
integration_tests
/
enum_05.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
31 lines (27 loc) · 745 Bytes
Breadcrumbs
lpython
/
integration_tests
/
enum_05.py
Copy path
File metadata and controls
31 lines (27 loc) · 745 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from
ltypes
import
i32
,
ccall
from
enum
import
Enum
@
ccall
class
Color
(
Enum
):
RED
:
i32
=
0
GREEN
:
i32
=
1
BLUE
:
i32
=
2
PINK
:
i32
=
3
WHITE
:
i32
=
4
YELLOW
:
i32
=
5
@
ccall
def
test_selected_color
(
selected_color
:
Color
)
->
i32
:
pass
def
test_colors
():
color
:
Color
=
Color
(
Color
.
BLUE
)
assert
test_selected_color
(
color
)
==
2
color
=
Color
(
Color
.
GREEN
)
assert
test_selected_color
(
color
)
==
1
color
=
Color
(
Color
.
RED
)
assert
test_selected_color
(
color
)
==
0
color
=
Color
(
Color
.
YELLOW
)
assert
test_selected_color
(
color
)
==
5
color
=
Color
(
Color
.
WHITE
)
assert
test_selected_color
(
color
)
==
4
color
=
Color
(
Color
.
PINK
)
assert
test_selected_color
(
color
)
==
3
test_colors
()
Back
|
FazBrowse Home
|
New Git URL