Skip to content

Commit ef5bc08

Browse files
authored
Workaround printf moving to the stdlib (#93)
* Workaround printf moving to the stdlib * More fixes for 0.7
1 parent 2e27add commit ef5bc08

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

src/BenchmarkTools.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ using Compat
66
using JSON
77
using Base.Iterators
88

9+
if VERSION >= v"0.7.0-DEV.3052"
10+
using Printf
11+
end
12+
913
const BENCHMARKTOOLS_VERSION = v"0.2.2"
1014

1115
##############

src/groups.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,13 @@ end
1919
# Dict-like methods #
2020
#-------------------#
2121

22+
if VERSION < v"0.7.0-DEV.2731"
23+
const empty = similar
24+
end
25+
2226
@compat Base.:(==)(a::BenchmarkGroup, b::BenchmarkGroup) = a.tags == b.tags && a.data == b.data
2327
Base.copy(group::BenchmarkGroup) = BenchmarkGroup(copy(group.tags), copy(group.data))
24-
Base.similar(group::BenchmarkGroup) = BenchmarkGroup(copy(group.tags), similar(group.data))
28+
Base.similar(group::BenchmarkGroup) = BenchmarkGroup(copy(group.tags), empty(group.data))
2529
Base.isempty(group::BenchmarkGroup) = isempty(group.data)
2630
Base.length(group::BenchmarkGroup) = length(group.data)
2731
Base.getindex(group::BenchmarkGroup, i...) = getindex(group.data, i...)

test/ExecutionTests.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ module ExecutionTests
33
using BenchmarkTools
44
using Compat
55
using Compat.Test
6-
@static if VERSION >= v"0.7.0-DEV.2655" # IterativeEigenSolvers to stdlib
6+
if VERSION >= v"0.7.0-DEV.3019"
7+
using IterativeEigensolvers
8+
elseif VERSION >= v"0.7.0-DEV.2655"
79
using IterativeEigenSolvers
810
end
911

@@ -170,7 +172,7 @@ let fname = tempname()
170172
@test a === nothing
171173
end
172174
end
173-
s = readstring(fname)
175+
s = read(fname, String)
174176
try
175177
@test ismatch(r"[0-9.]+ \w*s \([0-9]* allocations?: [0-9]+ bytes\)", s)
176178
catch

0 commit comments

Comments
 (0)