mirror of
https://github.com/golang/go.git
synced 2025-05-05 23:53:05 +00:00
test pairwise iota assignment
R=rsc DELTA=13 (13 added, 0 deleted, 0 changed) OCL=20638 CL=20641
This commit is contained in:
parent
3f8aa662e9
commit
2fe97c336d
13
test/iota.go
13
test/iota.go
@ -67,6 +67,12 @@ const (
|
||||
t;
|
||||
)
|
||||
|
||||
const (
|
||||
abit, amask = 1 << iota, 1 << iota - 1;
|
||||
bbit, bmask = 1 << iota, 1 << iota - 1;
|
||||
cbit, cmask = 1 << iota, 1 << iota - 1;
|
||||
)
|
||||
|
||||
func main() {
|
||||
assert(x == 0, "x");
|
||||
assert(y == 1, "y");
|
||||
@ -104,4 +110,11 @@ func main() {
|
||||
|
||||
assert(s == "a", "s");
|
||||
assert(t == "b", "t");
|
||||
|
||||
assert(abit == 1, "abit");
|
||||
assert(amask == 0, "amask");
|
||||
assert(bbit == 2, "bbit");
|
||||
assert(bmask == 1, "bmask");
|
||||
assert(cbit == 4, "cbit");
|
||||
assert(cmask == 3, "cmask");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user