Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 5 additions & 34 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,46 +9,18 @@ on:
jobs:
build:
name: Build and test
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
strategy:
matrix:
include:
- elixir-version: 1.9.4
otp-version: 20.3
- elixir-version: 1.9.4
otp-version: 21.3
- elixir-version: 1.9.4
otp-version: 22.3
- elixir-version: 1.10.4
otp-version: 21.3
- elixir-version: 1.10.4
otp-version: 22.3
- elixir-version: 1.10.4
otp-version: 23.3
- elixir-version: 1.11.4
otp-version: 21.3
- elixir-version: 1.11.4
otp-version: 22.3
- elixir-version: 1.11.4
otp-version: 23.3
- elixir-version: 1.11.4
otp-version: 24.3
- elixir-version: 1.12.3
otp-version: 22.3
- elixir-version: 1.12.3
otp-version: 23.3
- elixir-version: 1.12.3
otp-version: 24.3
- elixir-version: 1.13.4
otp-version: 22.3
- elixir-version: 1.13.4
otp-version: 23.3
- elixir-version: 1.13.4
otp-version: 24.3
- elixir-version: 1.13.4
otp-version: 25.3
- elixir-version: 1.14.5
otp-version: 23.3
- elixir-version: 1.14.5
otp-version: 24.3
- elixir-version: 1.14.5
Expand All @@ -72,12 +44,11 @@ jobs:
- elixir-version: 1.17.3
otp-version: 26.2
- elixir-version: 1.17.3
otp-version: 27.2
- elixir-version: 1.18.1
otp-version: 27.3
- elixir-version: 1.18.4
otp-version: 26.2
- elixir-version: 1.18.1
otp-version: 27.2

- elixir-version: 1.18.4
otp-version: 27.3
steps:
- uses: actions/checkout@v3
- name: Set up Elixir
Expand Down
16 changes: 6 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,16 +164,12 @@ For a guided tour and deep dive of Patch, see the [Guide Book](https://hexdocs.p

Tests automatically run against a matrix of OTP and Elixir Versions, see the [ci.yml](https://github.com/ihumanable/patch/tree/master/.github/workflows/ci.yml) for details.

| OTP \ Elixir | 1.9 | 1.10 | 1.11 | 1.12 | 1.13 | 1.14 | 1.15 | 1.16 | 1.17 | 1.18 |
|:------------:|:----:|:----:|:----:|:----:|:----:|:----:|:----:|:----:|:----:|:----:|
| 20 | ✅ | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A |
| 21 | ✅ | ✅ | ✅ | N/A | N/A | N/A | N/A | N/A | N/A | N/A |
| 22 | ✅ | ✅ | ✅ | ✅ | ✅ | N/A | N/A | N/A | N/A | N/A |
| 23 | N/A | ✅ | ✅ | ✅ | ✅ | ✅ | N/A | N/A | N/A | N/A |
| 24 | N/A | N/A | ✅ | ✅ | ✅ | ✅ | ✅ | N/A | N/A | N/A |
| 25 | N/A | N/A | N/A | N/A | ✅ | ✅ | ✅ | ✅ | ✅ | ? |
| 26 | N/A | N/A | N/A | N/A | N/A | ✅ | ✅ | ✅ | ✅ | ✅ |
| 27 | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | ✅ | ✅ |
| OTP \ Elixir | 1.11 | 1.12 | 1.13 | 1.14 | 1.15 | 1.16 | 1.17 | 1.18 |
|:------------:|:----:|:----:|:----:|:----:|:----:|:----:|:----:|:----:|
| 24 | ✅ | ✅ | ✅ | ✅ | ✅ | N/A | N/A | N/A |
| 25 | N/A | N/A | ✅ | ✅ | ✅ | ✅ | ✅ | N/A |
| 26 | N/A | N/A | N/A | ✅ | ✅ | ✅ | ✅ | ✅ |
| 27 | N/A | N/A | N/A | N/A | N/A | N/A | ✅ | ✅ |

## Limitations

Expand Down
3 changes: 2 additions & 1 deletion lib/patch/mock/code/queries/exports.ex
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ defmodule Patch.Mock.Code.Queries.Exports do
abstract_forms
|> Enum.filter(&match?({:attribute, _, :export, _}, &1))
|> Enum.reduce([], fn {_, _, _, exports}, acc ->
Keyword.merge(acc, exports)
[exports | acc]
end)
|> List.flatten()
end
end
23 changes: 23 additions & 0 deletions test/unit/patch/mock/code/queries/exports_test.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
defmodule Patch.Test.Unit.Patch.Mock.Code.Queries.ExportsTest do
use ExUnit.Case

alias Patch.Mock.Code.Queries.Exports

describe "query/1" do
test "handles functions with multiple arities declared across multiple exports" do
forms = [
{:attribute, 1, :export, [a: 1]},
{:attribute, 1, :export, [a: 2]}
]

expected = Enum.sort([a: 1, a: 2])

actual =
forms
|> Exports.query()
|> Enum.sort()

assert expected == actual
end
end
end