summary refs log blame commit diff stats
path: root/tests/modules/tcanimport.nim
blob: bc4e2e53f522d7bebd5e9b746b0618a640aaa77f (plain) (tree)


















                             
discard """
  output: '''ABC
nope'''
"""

template canImport(x): bool =
  compiles:
    import x

when canImport(strutils):
  import strutils
  echo "abc".toUpperAscii
else:
  echo "meh"

when canImport(none):
  echo "what"
else:
  echo "nope"