~nskaggs/+junk/xenial-test

« back to all changes in this revision

Viewing changes to src/github.com/lxc/lxd/shared/stringset_test.go

  • Committer: Nicholas Skaggs
  • Date: 2016-10-24 20:56:05 UTC
  • Revision ID: nicholas.skaggs@canonical.com-20161024205605-z8lta0uvuhtxwzwl
Initi with beta15

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package shared
 
2
 
 
3
import (
 
4
        "testing"
 
5
)
 
6
 
 
7
func TestStringSetSubset(t *testing.T) {
 
8
        ss := NewStringSet([]string{"one", "two"})
 
9
 
 
10
        if !ss.IsSubset(ss) {
 
11
                t.Error("subests wrong")
 
12
                return
 
13
        }
 
14
 
 
15
        if !ss.IsSubset(NewStringSet([]string{"one", "two", "three"})) {
 
16
                t.Error("subsets wrong")
 
17
                return
 
18
        }
 
19
 
 
20
        if ss.IsSubset(NewStringSet([]string{"four"})) {
 
21
                t.Error("subests wrong")
 
22
                return
 
23
        }
 
24
}