Skip to content

Commit

Permalink
Merge 3fb957e into 1f61fac
Browse files Browse the repository at this point in the history
  • Loading branch information
tkf committed Sep 14, 2020
2 parents 1f61fac + 3fb957e commit ed4a0d5
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 3 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,18 @@ on:

jobs:
test:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ["ubuntu-latest"]
julia-version: ['1.5', '1.4', '1.3', '1.2', '1.1', '1.0', 'nightly']
include:
- os: windows-latest
julia-version: 1
- os: windows-latest
julia-version: '1.0'
fail-fast: false
name: Test Julia ${{ matrix.julia-version }}
name: Test Julia ${{ matrix.julia-version }} ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Setup julia
Expand Down
2 changes: 1 addition & 1 deletion src/project_toml_formatting.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function _analyze_project_toml_formatting_2(path::AbstractString, original)

prj = TOML.parse(original)
formatted = sprint(print_project, prj)
if original == formatted
if splitlines(original) == splitlines(formatted)
LazyTestResult(
label,
"Running `Pkg.resolve` on `$(path)` did not change the content.",
Expand Down
2 changes: 2 additions & 0 deletions src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ if !@isdefined(isnothing)
isnothing(x) = x === nothing
end

splitlines(str; kwargs...) = readlines(IOBuffer(str); kwargs...)

askwargs(kwargs) = (; kwargs...)
function askwargs(flag::Bool)
if !flag
Expand Down
10 changes: 10 additions & 0 deletions test/test_project_toml_formatting.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,16 @@ using Test
""",
) true
end
@testset "pass: ignore carriage returns" begin
@test _analyze_project_toml_formatting_2(
path,
join([
"""[deps]\r\n""",
"""Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"\r\n""",
"""Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"\r\n""",
]),
) true
end
@testset "failure: reversed deps" begin
t = _analyze_project_toml_formatting_2(
path,
Expand Down

0 comments on commit ed4a0d5

Please sign in to comment.