Jatin Lodhia | 06b6d1f | 2015-06-12 11:06:15 -0700 | [diff] [blame] | 1 | // Copyright 2015 The Vanadium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style |
| 3 | // license that can be found in the LICENSE file. |
| 4 | |
| 5 | package server |
| 6 | |
| 7 | import ( |
| 8 | "testing" |
| 9 | ) |
| 10 | |
Jatin Lodhia | 06b6d1f | 2015-06-12 11:06:15 -0700 | [diff] [blame] | 11 | func TestStKey(t *testing.T) { |
Adam Sadovsky | a31a7cd | 2015-07-08 10:44:07 -0700 | [diff] [blame] | 12 | tests := []struct { |
| 13 | appName string |
| 14 | dbName string |
| 15 | stKey string |
| 16 | }{ |
| 17 | {"app1", "db1", "$dbInfo:app1:db1"}, |
| 18 | } |
| 19 | for _, test := range tests { |
| 20 | got, want := dbInfoStKey(&app{name: test.appName}, test.dbName), test.stKey |
| 21 | if got != want { |
| 22 | t.Errorf("wrong stKey: got %q, want %q", got, want) |
| 23 | } |
Jatin Lodhia | 06b6d1f | 2015-06-12 11:06:15 -0700 | [diff] [blame] | 24 | } |
| 25 | } |