config_test.go 645 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * ECAL
  3. *
  4. * Copyright 2020 Matthias Ladkau. All rights reserved.
  5. *
  6. * This Source Code Form is subject to the terms of the MIT
  7. * License, If a copy of the MIT License was not distributed with this
  8. * file, You can obtain one at https://opensource.org/licenses/MIT.
  9. */
  10. package config
  11. import (
  12. "testing"
  13. )
  14. func TestConfig(t *testing.T) {
  15. Config[WorkerCount] = 1
  16. if res := Str(WorkerCount); res != "1" {
  17. t.Error("Unexpected result:", res)
  18. return
  19. }
  20. if res := Bool(WorkerCount); !res {
  21. t.Error("Unexpected result:", res)
  22. return
  23. }
  24. if res := Int(WorkerCount); res != 1 {
  25. t.Error("Unexpected result:", res)
  26. return
  27. }
  28. }