Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Formatter bug with bitstring value #14394

Closed
LostKobrakai opened this issue Apr 3, 2025 · 1 comment
Closed

Formatter bug with bitstring value #14394

LostKobrakai opened this issue Apr 3, 2025 · 1 comment

Comments

@LostKobrakai
Copy link
Contributor

Elixir and Erlang/OTP versions

Erlang/OTP 27 [erts-15.2] [source] [64-bit] [smp:14:14] [ds:14:14:10] [async-threads:1] [jit]

Interactive Elixir (1.18.1) - press Ctrl+C to exit (type h() ENTER for help)

Operating system

Mac OS X

Current behavior

defmodule ATest do
  describe "encode/2" do
    # DPT 24
    test "DPST 24-1" do
      assert {:ok,
              <<0x54, 0x68, 0x69, 0x73, 0x20, 0x66, 0x6F, 0x72, 0x6D, 0x61, 0x74, 0x20, 0x61,
                0x6C, 0x6C, 0x6F, 0x77, 0x73, 0x20, 0x74, 0x72, 0x61, 0x6E, 0x73, 0x6D, 0x69,
                0x73, 0x73, 0x69, 0x6F, 0x6E, 0x20, 0x6F, 0x66, 0x20, 0x76, 0x65, 0x72, 0x79,
                0x20, 0x6C, 0x6F, 0x6E, 0x67, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6E, 0x67, 0x73,
                0x21,
                0x00>>} =
               Dpts.encode("24.001", "This format allows transmission of very long strings!")
    end
  end
end

See the 0x00 in a separate line.

Expected behavior

It should not have a separete line, just like it doesn't if there's less nesting.

@josevalim
Copy link
Member

Fixed by 1481359.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants