Skip to content

Commit f83e5b3

Browse files
committed
typo
1 parent b1202f0 commit f83e5b3

File tree

1 file changed

+27
-27
lines changed

1 file changed

+27
-27
lines changed

test/functional.jl

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ let (:)(a,b) = (i for i in Base.:(:)(1,10) if i%2==0)
236236
@test Int8[ i for i = 1:2 ] == [2,4,6,8,10]
237237
end
238238

239-
@testset "Basic tests of Fix1, Fix2, and FixN" begin
239+
@testset "Basic tests of Fix1, Fix2, and Fix" begin
240240
function test_fix1(Fix1=Base.Fix1)
241241
increment = Fix1(+, 1)
242242
@test increment(5) == 6
@@ -278,49 +278,49 @@ end
278278
test_fix2()
279279

280280
# Now, repeat the Fix1 and Fix2 tests, but
281-
# with a FixN lambda function used in their place
282-
test_fix1((op, arg) -> Base.FixN(op, Val(1), arg))
283-
test_fix2((op, arg) -> Base.FixN(op, Val(2), arg))
281+
# with a Fix lambda function used in their place
282+
test_fix1((op, arg) -> Base.Fix(op, Val(1), arg))
283+
test_fix2((op, arg) -> Base.Fix(op, Val(2), arg))
284284

285-
# Now, we do more complex tests of FixN:
286-
let FixN=Base.FixN
285+
# Now, we do more complex tests of Fix:
286+
let Fix=Base.Fix
287287
@testset "Argument Fixation" begin
288288
f = (x, y, z) -> x + y * z
289-
fixed_f1 = FixN(f, Val(1), 10)
289+
fixed_f1 = Fix(f, Val(1), 10)
290290
@test fixed_f1(2, 3) == 10 + 2 * 3
291291

292-
fixed_f2 = FixN(f, Val(2), 5)
292+
fixed_f2 = Fix(f, Val(2), 5)
293293
@test fixed_f2(1, 4) == 1 + 5 * 4
294294

295-
fixed_f3 = FixN(f, Val(3), 3)
295+
fixed_f3 = Fix(f, Val(3), 3)
296296
@test fixed_f3(1, 2) == 1 + 2 * 3
297297
end
298298
@testset "Helpful errors" begin
299299
g = (x, y) -> x - y
300300
# Test minimum N
301-
fixed_g1 = FixN(g, Val(1), 100)
301+
fixed_g1 = Fix(g, Val(1), 100)
302302
@test fixed_g1(40) == 100 - 40
303303

304304
# Test maximum N
305-
fixed_g2 = FixN(g, Val(2), 100)
305+
fixed_g2 = Fix(g, Val(2), 100)
306306
@test fixed_g2(150) == 150 - 100
307307

308308
# One over
309-
fixed_g3 = FixN(g, Val(3), 100)
309+
fixed_g3 = Fix(g, Val(3), 100)
310310
@test_throws ArgumentError fixed_g3(1)
311311
@test_throws(
312-
"expected at least 2 arguments to a `FixN` function with `N=3`",
312+
"expected at least 2 arguments to a `Fix` function with `N=3`",
313313
fixed_g3(1)
314314
)
315315
end
316316
@testset "Type Stability and Inference" begin
317317
h = (x, y) -> x / y
318-
fixed_h = FixN(h, Val(2), 2.0)
318+
fixed_h = Fix(h, Val(2), 2.0)
319319
@test @inferred(fixed_h(4.0)) == 2.0
320320
end
321321
@testset "Interaction with varargs" begin
322322
vararg_f = (x, y, z...) -> x + 10 * y + sum(z; init=zero(x))
323-
fixed_vararg_f = FixN(vararg_f, Val(2), 6)
323+
fixed_vararg_f = Fix(vararg_f, Val(2), 6)
324324

325325
# Can call with variable number of arguments:
326326
@test fixed_vararg_f(1, 2, 3, 4) == 1 + 10 * 6 + sum((2, 3, 4))
@@ -330,31 +330,31 @@ end
330330
end
331331
@testset "Errors should propagate normally" begin
332332
error_f = (x, y) -> sin(x * y)
333-
fixed_error_f = FixN(error_f, Val(2), Inf)
333+
fixed_error_f = Fix(error_f, Val(2), Inf)
334334
@test_throws DomainError fixed_error_f(10)
335335
end
336-
@testset "Chaining FixN together" begin
337-
f1 = FixN(*, Val(1), "1")
338-
f2 = FixN(f1, Val(1), "2")
339-
f3 = FixN(f2, Val(1), "3")
336+
@testset "Chaining Fix together" begin
337+
f1 = Fix(*, Val(1), "1")
338+
f2 = Fix(f1, Val(1), "2")
339+
f3 = Fix(f2, Val(1), "3")
340340
@test f3() == "123"
341341

342-
g1 = FixN(*, Val(2), "1")
343-
g2 = FixN(g1, Val(2), "2")
344-
g3 = FixN(g2, Val(2), "3")
342+
g1 = Fix(*, Val(2), "1")
343+
g2 = Fix(g1, Val(2), "2")
344+
g3 = Fix(g2, Val(2), "3")
345345
@test g3("") == "123"
346346

347347
# Equivalent to:
348-
h = FixN(*, Val(1), "1", "2", "3")
348+
h = Fix(*, Val(1), "1", "2", "3")
349349
@test h() == "123"
350350
end
351351

352-
@testset "varargs inside FixN" begin
353-
lazy_sum = FixN(+, Val(1), 1, 2, 3, 4, 5)
352+
@testset "varargs inside Fix" begin
353+
lazy_sum = Fix(+, Val(1), 1, 2, 3, 4, 5)
354354
@test lazy_sum() == sum((1, 2, 3, 4, 5))
355355

356356
joiner(t...) = join(t, " ")
357-
string_inside = FixN(joiner, Val(3), "third", "fourth", "fifth")
357+
string_inside = Fix(joiner, Val(3), "third", "fourth", "fifth")
358358
@test string_inside("first", "second", "sixth") == "first second third fourth fifth sixth"
359359
# Still type stable:
360360
@inferred string_inside("first", "second", "sixth")

0 commit comments

Comments
 (0)