@@ -89,7 +89,7 @@ defmodule Ecto.Integration.MathTest do
89
89
90
90
query = from ( p in Product , select: fragment ( "acos(?)" , p . price ) )
91
91
92
- [ nil ] = TestRepo . all ( query )
92
+ assert [ nil ] = TestRepo . all ( query )
93
93
end
94
94
95
95
test "decimal below -1.0" do
@@ -98,7 +98,7 @@ defmodule Ecto.Integration.MathTest do
98
98
99
99
query = from ( p in Product , select: fragment ( "acos(?)" , p . price ) )
100
100
101
- [ nil ] = TestRepo . all ( query )
101
+ assert [ nil ] = TestRepo . all ( query )
102
102
end
103
103
104
104
test "decimal at 0.3" do
@@ -108,31 +108,34 @@ defmodule Ecto.Integration.MathTest do
108
108
query = from ( p in Product , select: fragment ( "acos(?)" , p . price ) )
109
109
110
110
# Right now, sqlite will return the acos function as an IEEE float
111
- [ 1.2661036727794992 ] = TestRepo . all ( query )
111
+ [ num ] = TestRepo . all ( query )
112
+ assert_in_delta num , 1.266103672779499 , 0.000000000000001
112
113
end
113
114
114
115
test "float above 1.0" do
115
116
TestRepo . insert! ( % Vec3f { x: 1.1 , y: 1.2 , z: 1.3 } )
116
117
117
118
query = from ( v in Vec3f , select: fragment ( "acos(?)" , v . x ) )
118
119
119
- [ nil ] = TestRepo . all ( query )
120
+ assert [ nil ] = TestRepo . all ( query )
120
121
end
121
122
122
123
test "float below -1.0" do
123
124
TestRepo . insert! ( % Vec3f { x: - 1.1 , y: 1.2 , z: 1.3 } )
124
125
125
126
query = from ( v in Vec3f , select: fragment ( "acos(?)" , v . x ) )
126
127
127
- [ nil ] = TestRepo . all ( query )
128
+ assert [ nil ] = TestRepo . all ( query )
128
129
end
129
130
130
131
test "float at 0.3" do
131
132
TestRepo . insert! ( % Vec3f { x: 0.3 , y: 1.2 , z: 1.3 } )
132
133
133
134
query = from ( v in Vec3f , select: fragment ( "acos(?)" , v . x ) )
134
135
135
- [ 1.2661036727794992 ] = TestRepo . all ( query )
136
+ [ num ] = TestRepo . all ( query )
137
+
138
+ assert_in_delta num , 1.266103672779499 , 0.000000000000001
136
139
end
137
140
end
138
141
end
0 commit comments