golang-image/math/fixed/fixed_test.go
Nigel Tao 5ec5e003b2 math/fixed: new package.
Fixes golang/go#11906

Change-Id: I2b43311ff145e8453cd255f085c82add6da7de5b
Reviewed-on: https://go-review.googlesource.com/12863
Reviewed-by: Rob Pike <r@golang.org>
2015-07-30 06:07:28 +00:00

26 lines
507 B
Go

// Copyright 2015 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 fixed
import (
"testing"
)
func TestInt26_6(t *testing.T) {
got := Int26_6(1<<6 + 1<<4).String()
want := "1:16"
if got != want {
t.Fatalf("got %q, want %q", got, want)
}
}
func TestInt52_12(t *testing.T) {
got := Int52_12(1<<12 + 1<<10).String()
want := "1:1024"
if got != want {
t.Fatalf("got %q, want %q", got, want)
}
}