github.com/xyproto/gopher-lua@v1.0.2/_glua-tests/os.lua (about)

     1  local osname = "linux"
     2  if string.find(os.getenv("OS") or "", "Windows") then
     3    osname = "windows"
     4  end
     5  
     6  if osname == "linux" then
     7    -- travis ci failed to start date command?
     8    -- assert(os.execute("date") == 0)
     9    assert(os.execute("date -a") == 1)
    10  else
    11    assert(os.execute("date /T") == 0)
    12    assert(os.execute("md") == 1)
    13  end
    14  
    15  assert(os.getenv("PATH") ~= "")
    16  assert(os.getenv("_____GLUATEST______") == nil)
    17  assert(os.setenv("_____GLUATEST______", "1"))
    18  assert(os.getenv("_____GLUATEST______") == "1")