helper_test.go 589 B

123456789101112131415161718192021222324252627282930
  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 scope
  11. import (
  12. "testing"
  13. )
  14. func TestScopeConversion(t *testing.T) {
  15. vs := NewScope("foo")
  16. vs.SetValue("a", 1)
  17. vs.SetValue("b", 2)
  18. vs.SetValue("c", 3)
  19. vs2 := ToScope("foo", ToObject(vs))
  20. if vs.String() != vs2.String() {
  21. t.Error("Unexpected result:", vs.String(), vs2.String())
  22. return
  23. }
  24. }