Skip to content

ExUnit: Fails to correctly highlight diffs in tuples with lists in them #13348

@Munksgaard

Description

@Munksgaard

Elixir and Erlang/OTP versions

$ elixir --version
Erlang/OTP 25 [erts-13.2.2.5] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit:ns]

Elixir 1.16.1 (compiled with Erlang/OTP 25)

Operating system

NixOS

Current behavior

Here is my test file:

defmodule HighlightingTest do
  use ExUnit.Case, async: true

  test "correct1" do
    val = {[:foo]}
    assert ^val = {[:bar]}
  end

  test "correct2" do
    val = [:foo]
    assert ^val = [:bar]
  end

  test "correct3" do
    val = {:foo}
    assert ^val = {:bar}
  end

  test "incorrectly colored" do
    val = [{:foo}]
    assert ^val = [{:bar}]
  end
end

And here is the colored output I get from running mix test on the file:

screenshot

Notice that in the last test the entire {:bar} is highlighted in green, instead of just :bar, as in the rest of the tests.

Expected behavior

Only :bar is highlighted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions