Chris Broadfoot | 5d51656 | 2015-08-25 13:43:02 -0700 | [diff] [blame] | 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 | |
Dave Day | 45c5adc | 2014-05-15 14:36:15 +1000 | [diff] [blame] | 5 | package remote_api |
| 6 | |
| 7 | import ( |
| 8 | "testing" |
| 9 | ) |
| 10 | |
| 11 | func TestAppIDRE(t *testing.T) { |
| 12 | appID := "s~my-appid-539" |
| 13 | tests := []string{ |
| 14 | "{rtok: 8306111115908860449, app_id: s~my-appid-539}\n", |
| 15 | "{rtok: 8306111115908860449, app_id: 's~my-appid-539'}\n", |
| 16 | `{rtok: 8306111115908860449, app_id: "s~my-appid-539"}`, |
| 17 | `{rtok: 8306111115908860449, "app_id":"s~my-appid-539"}`, |
| 18 | } |
| 19 | for _, v := range tests { |
| 20 | if g := appIDRE.FindStringSubmatch(v); g == nil || g[1] != appID { |
| 21 | t.Errorf("appIDRE.FindStringSubmatch(%s) got %q, want %q", v, g, appID) |
| 22 | } |
| 23 | } |
| 24 | } |