Skip to content

Commit

Permalink
add ut for splitset in optimized storage
Browse files Browse the repository at this point in the history
  • Loading branch information
mredolatti committed Jul 14, 2023
1 parent c585ee5 commit ecb327b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion splitio/commitversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ This file is created automatically, please do not edit
*/

// CommitVersion is the version of the last commit previous to release
const CommitVersion = "cf92e16"
const CommitVersion = "c585ee5"
17 changes: 17 additions & 0 deletions splitio/proxy/storage/optimized/changesummary_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,24 @@ func TestSizeBoundaries(t *testing.T) {
if err != ErrUnknownChangeNumber {
t.Error("should have gotten unknown CN error. Got: ", err)
}
}

func TestSplitSet(t *testing.T) {
ss := newSplitSet()
ss.update([]SplitMinimalView{{Name: "s1"}, {Name: "s2"}}, nil)
if !ss.contains("s1") || !ss.contains("s2") {
t.Error("splitSet should contain s1 & s2")
}

clone := ss.clone()
if !clone.contains("s1") || !clone.contains("s2") {
t.Error("splitSet should contain s1 & s2")
}

ss.update(nil, []SplitMinimalView{{Name: "s2"}})
if !clone.contains("s1") {
t.Error("splitSet should contain s1")
}
}

/* TEST PLAN!
Expand Down

0 comments on commit ecb327b

Please sign in to comment.