mirror of
https://github.com/hi-language/transpiler.git
synced 2026-01-13 16:18:04 +00:00
Feat: Add test for conditional (ternary) expressions
This commit is contained in:
10
test/src/conditionals.hi
Normal file
10
test/src/conditionals.hi
Normal file
@@ -0,0 +1,10 @@
|
||||
a: 10
|
||||
b: 20
|
||||
max: (a > b) ? { a } : { b }
|
||||
_(max)
|
||||
|
||||
status: "ok"
|
||||
(status == "ok") ? { _("Status is OK") }
|
||||
|
||||
grade: (max > 15) ? { "A" } : { "B" }
|
||||
_(grade)
|
||||
Reference in New Issue
Block a user