Debian Codegraph @

real_test.go

raw symbols SCIP
1 package berscip-go gomod github.com/go-asn1-ber/asn1-ber . `github.com/go-asn1-ber/asn1-ber`/
2
3 import (
4 "mathscip-go gomod github.com/golang/go/src go1.13 math/"
5 "testingscip-go gomod github.com/golang/go/src go1.13 testing/"
6 )
7
8 var negativeZeroscip-go gomod github.com/go-asn1-ber/asn1-ber . `github.com/go-asn1-ber/asn1-ber`/negativeZero. = mathscip-go gomod github.com/golang/go/src go1.13 math/.Copysignscip-go gomod github.com/golang/go/src go1.13 math/Copysign().(0, -1)
9
10 func TestRealEncodingscip-go gomod github.com/go-asn1-ber/asn1-ber . `github.com/go-asn1-ber/asn1-ber`/TestRealEncoding().(t *testingscip-go gomod github.com/golang/go/src go1.13 testing/.Tscip-go gomod github.com/golang/go/src go1.13 testing/T#) {
11 for _, value := range []float64{
12 0.15625,
13 -0.15625,
14 mathscip-go gomod github.com/golang/go/src go1.13 math/.Infscip-go gomod github.com/golang/go/src go1.13 math/Inf().(1),
15 mathscip-go gomod github.com/golang/go/src go1.13 math/.Infscip-go gomod github.com/golang/go/src go1.13 math/Inf().(-1),
16 mathscip-go gomod github.com/golang/go/src go1.13 math/.NaNscip-go gomod github.com/golang/go/src go1.13 math/NaN().(),
17 negativeZeroscip-go gomod github.com/go-asn1-ber/asn1-ber . `github.com/go-asn1-ber/asn1-ber`/negativeZero.,
18 0.0,
19 } {
20 enc := encodeFloatscip-go gomod github.com/go-asn1-ber/asn1-ber . `github.com/go-asn1-ber/asn1-ber`/encodeFloat().(value)
21 dec, err := ParseRealscip-go gomod github.com/go-asn1-ber/asn1-ber . `github.com/go-asn1-ber/asn1-ber`/ParseReal().(enc)
22 if err != nil {
23 t.Errorfscip-go gomod github.com/golang/go/src go1.13 testing/common#Errorf().("Failed to decode %f (%v): %s", value, enc, err)
24 }
25 if dec != value {
26 if !(mathscip-go gomod github.com/golang/go/src go1.13 math/.IsNaNscip-go gomod github.com/golang/go/src go1.13 math/IsNaN().(dec) && mathscip-go gomod github.com/golang/go/src go1.13 math/.IsNaNscip-go gomod github.com/golang/go/src go1.13 math/IsNaN().(value)) {
27 t.Errorfscip-go gomod github.com/golang/go/src go1.13 testing/common#Errorf().("decoded value != orig: %f <=> %f", value, dec)
28 }
29 }
30 }
31 }