get_version.lua 543 B

12345678910111213141516
  1. unittests.register("test_get_version", function()
  2. local version = core.get_version()
  3. assert(type(version) == "table")
  4. assert(type(version.project) == "string")
  5. assert(type(version.string) == "string")
  6. assert(type(version.proto_min) == "number")
  7. assert(type(version.proto_max) == "number")
  8. assert(version.proto_max >= version.proto_min)
  9. assert(type(version.is_dev) == "boolean")
  10. if version.is_dev then
  11. assert(type(version.hash) == "string")
  12. else
  13. assert(version.hash == nil)
  14. end
  15. end)