Repository navigation
Expand file tree
/
Copy pathcomparisons_test.go
More file actions
137 lines (106 loc) · 2.22 KB
/
Copy pathcomparisons_test.go
File metadata and controls
137 lines (106 loc) · 2.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
package float
import (
"testing"
)
func TestX80_Eq(t *testing.T) {
one := X80One
two := newFromHexString("40008000000000000000")
a := one.Add(one)
if !a.Eq(two) {
t.Errorf("Eq failed: compared %v and %v, expected equal", a, two)
}
if a.Eq(one) {
t.Error("Eq failed")
}
if a.Eq(X80NaN) {
t.Error("Eq failed")
}
if X80InfNeg.Eq(X80InfPos) {
t.Error("Eq failed")
}
}
func TestX80_Le(t *testing.T) {
one := X80One
two := newFromHexString("40008000000000000000")
a := one.Add(one)
if !a.Le(two) {
t.Errorf("Le failed: compared %v and %v, expected equal", a, two)
}
if a.Le(one) {
t.Error("LE failed")
}
if a.Le(X80NaN) {
t.Error("LE failed")
}
if X80InfNeg.Gt(X80InfPos) {
t.Error("LE failed")
}
}
func TestX80_Lt(t *testing.T) {
one := X80One
two := newFromHexString("40008000000000000000")
a := one.Add(one)
if !a.Ge(two) {
t.Errorf("Ge failed: compared %v and %v, expected equal", a, two)
}
if a.Lt(one) {
t.Errorf("Eq failed")
}
if a.Lt(X80NaN) {
t.Errorf("Eq failed")
}
if X80InfNeg.Ge(X80InfPos) {
t.Errorf("Eq failed")
}
}
func TestX80_EqSignaling(t *testing.T) {
one := X80One
two := newFromHexString("40008000000000000000")
a := one.Add(one)
if !a.EqSignaling(two) {
t.Errorf("Eq failed: compared %v and %v, expected equal", a, two)
}
if a.EqSignaling(one) {
t.Error("Eq failed")
}
if a.EqSignaling(X80NaN) {
t.Error("Eq failed")
}
if X80InfNeg.EqSignaling(X80InfPos) {
t.Error("Eq failed")
}
}
func TestX80_LtQuiet(t *testing.T) {
one := X80One
two := newFromHexString("40008000000000000000")
a := one.Add(one)
if !a.GeQuiet(two) {
t.Errorf("Ge failed: compared %v and %v, expected equal", a, two)
}
if a.LtQuiet(one) {
t.Errorf("LtQuiet failed")
}
if a.LtQuiet(X80NaN) {
t.Errorf("LtQuiet failed")
}
if X80InfNeg.GeQuiet(X80InfPos) {
t.Errorf("LtQuiet failed")
}
}
func TestX80_LeQuiet(t *testing.T) {
one := X80One
two := newFromHexString("40008000000000000000")
a := one.Add(one)
if !a.LeQuiet(two) {
t.Errorf("Le failed: compared %v and %v, expected equal", a, two)
}
if a.LeQuiet(one) {
t.Error("LE failed")
}
if a.LeQuiet(X80NaN) {
t.Error("LE failed")
}
if X80InfNeg.GtQuiet(X80InfPos) {
t.Error("LE failed")
}
}