blob: 2e892a08f312532b1404179bc25b90ed2b0aa24f [file] [log] [blame]
Chris Broadfoot5d516562015-08-25 13:43:02 -07001// 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 Day45c5adc2014-05-15 14:36:15 +10005package remote_api
6
7import (
8"testing"
9)
10
11func TestAppIDRE(t *testing.T) {
12appID := "s~my-appid-539"
13tests := []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}
19for _, v := range tests {
20if g := appIDRE.FindStringSubmatch(v); g == nil || g[1] != appID {
21t.Errorf("appIDRE.FindStringSubmatch(%s) got %q, want %q", v, g, appID)
22}
23}
24}