Skip to content

Commit 26120fb

Browse files
juanperiparroty
andauthored
Update Range to use function syntax (#332)
* add missing step for Cobertura's range * Update Range to use function syntax * run tests in elixir 1.17 * fix test with relative path --------- Co-authored-by: parroty <parroty@users.noreply.github.com>
1 parent d0d8891 commit 26120fb

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

.github/workflows/tests.yml

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ jobs:
1313
elixir: '1.11'
1414
- otp: '26.0'
1515
elixir: '1.15'
16+
- otp: '27.0'
17+
elixir: '1.17'
1618
env:
1719
MIX_ENV: test
1820
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

lib/excoveralls/cobertura.ex

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ defmodule ExCoveralls.Cobertura do
188188
# We use Range.new/3 because using x..y//step would give a syntax error on Elixir < 1.12
189189
defp get_slice_range_for_package_name(c_path), do: Range.new(String.length(c_path) + 1, -1, 1)
190190
else
191-
defp get_slice_range_for_package_name(c_path), do: (String.length(c_path) + 1)..-1
191+
defp get_slice_range_for_package_name(c_path), do: Range.new(String.length(c_path) + 1, -1)
192192
end
193193

194194
defp rate(valid_lines) when length(valid_lines) == 0, do: 0.0

test/settings_test.exs

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ defmodule Excoveralls.SettingsTest do
1515

1616
test "returns default file path" do
1717
assert(Settings.Files.default_file
18-
|> Path.relative_to(File.cwd!) == "lib/excoveralls/../conf/coveralls.json")
18+
|> Path.expand()
19+
|> Path.relative_to(File.cwd!) == "lib/conf/coveralls.json")
1920
end
2021

2122
test "returns custom file path" do

0 commit comments

Comments
 (0)