1
0
mirror of https://github.com/golang/go synced 2024-11-18 16:04:44 -07:00
go/container/intsets/util_test.go
Alan Donovan 61c5c64029 go.tools/container/intsets: Sparse: a space-efficient representation for ordered sets of int values.
intsets.Sparse is a sparse bit vector.  It uses space proportional
to the number of elements, not the maximum element (as is the case		for a dense bit vector).

A forthcoming CL will make use of it in go/pointer, where it reduces
solve time by 78%.  A similar representation is used for Andersen's
analysis in gcc and LLVM.

+ Tests.

LGTM=sameer, crawshaw, gri
R=gri
CC=crawshaw, golang-codereviews, sameer
https://golang.org/cl/10837043
2014-05-14 17:54:14 -04:00

17 lines
375 B
Go

// Copyright 2014 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package intsets
import "testing"
func TestNLZ(t *testing.T) {
if x := nlz(0x0000801000000000); x != 16 {
t.Errorf("bad %d", x)
}
}
// Backdoor for testing.
func (s *Sparse) Check() error { return s.check() }