Skip to content

Commit

Permalink
Bump Elixir requirement, update CI and fix flaky test (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
SteffenDE authored Nov 7, 2024
1 parent 8c3c36a commit 1b74809
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 30 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,27 @@ on:

jobs:
test:
runs-on: ubuntu-16.04
runs-on: ${{ matrix.os }}
env:
MIX_ENV: test
strategy:
fail-fast: false
matrix:
include:
- pair:
elixir: 1.6.6
otp: 19.3.6.13
- pair:
elixir: 1.11.4
otp: 23.2.7
- elixir: 1.12.3
otp: 22.3.4.27
os: ubuntu-20.04
- elixir: 1.17.2
otp: 27.1.2
os: ubuntu-24.04
lint: lint
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: erlef/setup-elixir@v1
with:
otp-version: ${{matrix.pair.otp}}
elixir-version: ${{matrix.pair.elixir}}
otp-version: ${{matrix.otp}}
elixir-version: ${{matrix.elixir}}

- name: Install Dependencies
run: mix deps.get --only test
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ defmodule MakeupElixir.Mixfile do
[
app: :makeup_elixir,
version: @version,
elixir: "~> 1.6",
elixir: "~> 1.12",
start_permanent: Mix.env() == :prod,
deps: deps(),
package: package(),
Expand Down
2 changes: 1 addition & 1 deletion mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
"makeup": {:hex, :makeup, "1.2.0", "b92e9476c62534bd0e5ea9b9fcf36536ca929b6842549832c71d2533cdbe72f7", [:mix], [{:nimble_parsec, "~> 1.4", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "a7af3614f63cbfde2bbe5823cb3e5369317feca391c3a1f96dab8b6b8b09fdf9"},
"nimble_parsec": {:hex, :nimble_parsec, "1.4.0", "51f9b613ea62cfa97b25ccc2c1b4216e81df970acd8e16e8d1bdc58fef21370d", [:mix], [], "hexpm", "9c565862810fb383e9838c1dd2d7d2c437b3d13b267414ba6af33e50d2d1cf28"},
"statistex": {:hex, :statistex, "1.0.0", "f3dc93f3c0c6c92e5f291704cf62b99b553253d7969e9a5fa713e5481cd858a5", [:mix], [], "hexpm", "ff9d8bee7035028ab4742ff52fc80a2aa35cece833cf5319009b52f1b5a86c27"},
"unicode": {:hex, :unicode, "1.19.0", "264191eacb1d44039d0dbb9fd936c557431825373b6e7b18d77e80cb0cc344bd", [:mix], [], "hexpm", "ae83bbf54429a67bc6fa9c941a6e9f0ec38dd9c2a32b21583ad511d3b6555631"},
"unicode": {:hex, :unicode, "1.20.0", "10189cfe98b03ebb8be6efd00df0936c1c94d75bfbd62cba2bdf958fef3ee4a7", [:mix], [], "hexpm", "fa581cf80b3b1b7f42e4d24a69109dfac465cec27a62c661306c81f4ab35894c"},
"unicode_set": {:hex, :unicode_set, "1.4.0", "d7f005d5227768fb13a507433925b685be76acfbe6e5a25323c8231b54f59a96", [:mix], [{:nimble_parsec, "~> 1.2.2 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}, {:unicode, "~> 1.13", [hex: :unicode, repo: "hexpm", optional: false]}], "hexpm", "096d84ecd1f7965b0f0073f00a51bdc9c8d400f085730fcee6f735f1c2d676ef"},
}
24 changes: 24 additions & 0 deletions test/makeup/lexers/elixir_lexer/elixir_lexer_sigil_lexer_test.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
defmodule ElixirLexerSigilLexerTest do
use ExUnit.Case, async: false
import Makeup.Lexers.ElixirLexer.Testing, only: [lex: 1]

describe "custom lexers for sigils" do
test "can register a custom lexer" do
defmodule MyCustomLexer do
def lex(input) do
[{:keyword, %{}, input}]
end
end

Makeup.Lexers.ElixirLexer.register_sigil_lexer("H", MyCustomLexer)

assert lex("~H|Hello, world!|") == [
{:string_sigil, %{}, "~H|"},
{:keyword, %{}, "Hello, world!"},
{:string_sigil, %{}, "|"}
]
after
Application.put_env(:makeup_elixir, :sigil_lexers, %{})
end
end
end
18 changes: 0 additions & 18 deletions test/makeup/lexers/elixir_lexer/elixir_lexer_tokenizer_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -695,22 +695,4 @@ defmodule ElixirLexerTokenizerTestSnippet do
{:punctuation, %{group_id: "group-1"}, "}"}
]
end

describe "custom lexers for sigils" do
test "can register a custom lexer" do
defmodule MyCustomLexer do
def lex(input) do
[{:keyword, %{}, input}]
end
end

Makeup.Lexers.ElixirLexer.register_sigil_lexer("H", MyCustomLexer)

assert lex("~H|Hello, world!|") == [
{:string_sigil, %{}, "~H|"},
{:keyword, %{}, "Hello, world!"},
{:string_sigil, %{}, "|"}
]
end
end
end

0 comments on commit 1b74809

Please sign in to comment.