Skip to content

Commit d15af5a

Browse files
authored
Strip final line endings (fix #42) (#44)
1 parent 276e3b0 commit d15af5a

File tree

3 files changed

+47
-4
lines changed

3 files changed

+47
-4
lines changed

appveyor.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
environment:
2+
matrix:
3+
- julia_version: 1.0
4+
- julia_version: 1
5+
- julia_version: nightly
6+
7+
platform:
8+
- x86 # 32-bit
9+
- x64 # 64-bit
10+
11+
# # Uncomment the following lines to allow failures on nightly julia
12+
# # (tests will run but not make your overall status red)
13+
# matrix:
14+
# allow_failures:
15+
# - julia_version: nightly
16+
17+
branches:
18+
only:
19+
- master
20+
- /release-.*/
21+
22+
notifications:
23+
- provider: Email
24+
on_build_success: false
25+
on_build_failure: false
26+
on_build_status_changed: false
27+
28+
install:
29+
- ps: iex ((new-object net.webclient).DownloadString("https://raw.githubusercontent.com/JuliaCI/Appveyor.jl/version-1/bin/install.ps1"))
30+
31+
build_script:
32+
- echo "%JL_BUILD_SCRIPT%"
33+
- C:\julia\bin\julia -e "%JL_BUILD_SCRIPT%"
34+
35+
test_script:
36+
- echo "%JL_TEST_SCRIPT%"
37+
- C:\julia\bin\julia -e "%JL_TEST_SCRIPT%"
38+
39+
# # Uncomment to support code coverage upload. Should only be enabled for packages
40+
# # which would have coverage gaps without running on Windows
41+
# on_success:
42+
# - echo "%JL_CODECOV_SCRIPT%"
43+
# - C:\julia\bin\julia -e "%JL_CODECOV_SCRIPT%"

src/CodeTracking.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ function definition(::Type{String}, method::Method)
215215
lineindex -= 1
216216
line -= 1
217217
end
218-
return src[istart:iend-1], line
218+
return chomp(src[istart:iend-1]), line
219219
end
220220

221221
"""

test/runtests.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ isdefined(Main, :Revise) ? includet("script.jl") : include("script.jl")
2121
@test whereis(trace[3]) === nothing
2222

2323
src, line = definition(String, m)
24-
@test src == """
24+
@test src == chomp("""
2525
function f1(x, y)
2626
# A comment
2727
return x + y
2828
end
29-
"""
29+
""")
3030
@test line == 2
3131

3232
m = first(methods(f2))
@@ -127,4 +127,4 @@ l = @__LINE__
127127
def, line = definition(String, @which d_34(1, 2))
128128
@test line == l - 3
129129
@test def == "(d_34)(x::T, y::T) where {T<:Number} = x === y"
130-
end
130+
end

0 commit comments

Comments
 (0)