Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(12)

Unified Diff: test/ken/cplx3.go

Issue 5554056: code review 5554056: test: split golden.out into expected output per test (Closed)
Patch Set: diff -r 13bba29cb074 https://go.googlecode.com/hg/ Created 13 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/ken/cplx0.out ('k') | test/ken/cplx5.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/ken/cplx3.go
===================================================================
--- a/test/ken/cplx3.go
+++ b/test/ken/cplx3.go
@@ -19,10 +19,29 @@
func main() {
c0 := C1
c0 = (c0 + c0 + c0) / (c0 + c0 + 3i)
- println(c0)
+ r, i := real(c0), imag(c0)
+ d := r - 1.292308
+ if d < 0 {
+ d = - d
+ }
+ if d > 1e-6 {
+ println(r, "!= 1.292308")
+ panic(0)
+ }
+ d = i + 0.1384615
+ if d < 0 {
+ d = - d
+ }
+ if d > 1e-6 {
+ println(i, "!= -0.1384615")
+ panic(0)
+ }
c := *(*complex128)(unsafe.Pointer(&c0))
- println(c)
+ if c != c0 {
+ println(c, "!=", c)
+ panic(0)
+ }
var a interface{}
switch c := reflect.ValueOf(a); c.Kind() {
« no previous file with comments | « test/ken/cplx0.out ('k') | test/ken/cplx5.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b