tdistros_detect.nim 476 B

12345678910111213141516171819202122
  1. import distros
  2. discard """
  3. exitcode: 0
  4. output: ""
  5. """
  6. when defined(windows):
  7. doAssert detectOs(Windows) == true
  8. doAssert detectOs(Linux) == false
  9. doAssert detectOs(MacOSX) == false
  10. when defined(linux):
  11. doAssert detectOs(Linux) == true
  12. doAssert detectOs(Windows) == false
  13. doAssert detectOs(MacOSX) == false
  14. when defined(macosx):
  15. doAssert detectOs(MacOSX) == true
  16. doAssert detectOs(Windows) == false
  17. doAssert detectOs(Linux) == false