platform_test.go 668 B

123456789101112131415161718192021222324252627282930313233343536
  1. package main
  2. import (
  3. "reflect"
  4. "testing"
  5. )
  6. func TestSupportedPlatforms(t *testing.T) {
  7. var ps []Platform
  8. ps = SupportedPlatforms("go1.0")
  9. if !reflect.DeepEqual(ps, Platforms_1_0) {
  10. t.Fatalf("bad: %#v", ps)
  11. }
  12. ps = SupportedPlatforms("go1.1")
  13. if !reflect.DeepEqual(ps, Platforms_1_1) {
  14. t.Fatalf("bad: %#v", ps)
  15. }
  16. ps = SupportedPlatforms("go1.3")
  17. if !reflect.DeepEqual(ps, Platforms_1_3) {
  18. t.Fatalf("bad: %#v", ps)
  19. }
  20. ps = SupportedPlatforms("go1.4")
  21. if !reflect.DeepEqual(ps, Platforms_1_4) {
  22. t.Fatalf("bad: %#v", ps)
  23. }
  24. // Unknown
  25. ps = SupportedPlatforms("foo")
  26. if !reflect.DeepEqual(ps, Platforms_1_4) {
  27. t.Fatalf("bad: %#v", ps)
  28. }
  29. }