FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
lpython/integration_tests/enum_03.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_03.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
33 lines (28 loc) · 930 Bytes
Breadcrumbs
lpython
/
integration_tests
/
enum_03.py
Copy path
File metadata and controls
33 lines (28 loc) · 930 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
32
33
from
enum
import
Enum
from
ltypes
import
i32
class
NegativeNumbers
(
Enum
):
a
:
i32
=
-
1
b
:
i32
=
-
3
c
:
i32
=
-
5
d
:
i32
=
0
e
:
i32
=
1
f
:
i32
=
3
g
:
i32
=
5
class
WholeNumbers
(
Enum
):
h
:
i32
=
0
i
:
i32
=
1
j
:
i32
=
3
k
:
i32
=
5
def
test_negative_numbers
():
assert
NegativeNumbers
.
a
.
value
+
NegativeNumbers
.
b
.
value
+
NegativeNumbers
.
c
.
value
==
-
9
assert
NegativeNumbers
.
e
.
value
+
NegativeNumbers
.
f
.
value
+
NegativeNumbers
.
g
.
value
==
9
assert
NegativeNumbers
.
d
.
value
==
0
def
test_whole_numbers
():
assert
WholeNumbers
.
k
.
value
+
WholeNumbers
.
i
.
value
+
WholeNumbers
.
j
.
value
==
9
assert
WholeNumbers
.
h
.
value
==
0
print
(
WholeNumbers
.
k
.
name
,
WholeNumbers
.
i
.
name
,
WholeNumbers
.
j
.
name
)
print
(
WholeNumbers
.
k
.
value
,
WholeNumbers
.
i
.
value
,
WholeNumbers
.
j
.
value
)
print
(
WholeNumbers
.
h
.
name
)
print
(
WholeNumbers
.
h
.
value
)
test_negative_numbers
()
test_whole_numbers
()
Back
|
FazBrowse Home
|
New Git URL