client_test.go 704 B

123456789101112131415161718192021222324
  1. // Copyright 2014 Google Inc. All rights reserved.
  2. // Use of this source code is governed by the Apache 2.0
  3. // license that can be found in the LICENSE file.
  4. package remote_api
  5. import (
  6. "testing"
  7. )
  8. func TestAppIDRE(t *testing.T) {
  9. appID := "s~my-appid-539"
  10. tests := []string{
  11. "{rtok: 8306111115908860449, app_id: s~my-appid-539}\n",
  12. "{rtok: 8306111115908860449, app_id: 's~my-appid-539'}\n",
  13. `{rtok: 8306111115908860449, app_id: "s~my-appid-539"}`,
  14. `{rtok: 8306111115908860449, "app_id":"s~my-appid-539"}`,
  15. }
  16. for _, v := range tests {
  17. if g := appIDRE.FindStringSubmatch(v); g == nil || g[1] != appID {
  18. t.Errorf("appIDRE.FindStringSubmatch(%s) got %q, want %q", v, g, appID)
  19. }
  20. }
  21. }