IC: added converter test case (#17688)
* IC: added converter test case * IC: make converter example work
This commit is contained in:
parent
8aa5991bea
commit
1822ed384a
4 changed files with 30 additions and 3 deletions
2
tests/ic/mdefconverter.nim
Normal file
2
tests/ic/mdefconverter.nim
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
|
||||
converter toBool*(x: int): bool = x != 0
|
||||
18
tests/ic/tconverter.nim
Normal file
18
tests/ic/tconverter.nim
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
discard """
|
||||
output: "yes"
|
||||
"""
|
||||
|
||||
import mdefconverter
|
||||
|
||||
echo "yes"
|
||||
|
||||
#!EDIT!#
|
||||
|
||||
discard """
|
||||
output: "converted int to bool"
|
||||
"""
|
||||
|
||||
import mdefconverter
|
||||
|
||||
if 4:
|
||||
echo "converted int to bool"
|
||||
Loading…
Add table
Add a link
Reference in a new issue