aboutsummaryrefslogtreecommitdiff
path: root/ber/bitstring_test.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2015-07-15 14:14:19 +0200
committerDimitri Sokolyuk <demon@dim13.org>2015-07-15 14:14:19 +0200
commited424d007c1f0830e3c73bcf3e35e93a2f0d22e6 (patch)
tree5aca7b42107c4aab63a8902304bdfe2d478aa981 /ber/bitstring_test.go
parent6d033680eb74abe871e7b261e6911d646f9e365b (diff)
Add setter/getter
Diffstat (limited to 'ber/bitstring_test.go')
-rw-r--r--ber/bitstring_test.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/ber/bitstring_test.go b/ber/bitstring_test.go
index ae4051d..babde4d 100644
--- a/ber/bitstring_test.go
+++ b/ber/bitstring_test.go
@@ -52,3 +52,20 @@ func TestBitString(t *testing.T) {
}
}
}
+
+func TestSet(t *testing.T) {
+ bs := BitString{true, false}
+ bs.Set(3)
+ ex := BitString{true, false, false, true}
+ if !bs.Equal(ex) {
+ t.Error("expexted", ex, "got", bs)
+ }
+ bs.Clear(0)
+ ex = BitString{false, false, false, true}
+ if !bs.Equal(ex) {
+ t.Error("expexted", ex, "got", bs)
+ }
+ if bs.IsSet(0) {
+ t.Error("got", bs)
+ }
+}