Skip to content

Randomized test for String.grapheme/1 failed on main #12165

@sabiwara

Description

@sabiwara

Elixir and Erlang/OTP versions

Latest main

Erlang/OTP 25 [erts-13.0] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit]

Elixir 1.15.0-dev (8cb3426) (compiled with Erlang/OTP 25)

Operating system

macOS 12.4

Current behavior

This randomized test failed on my local:

1) test next_grapheme/1 (StringTest)
     test/elixir/string_test.exs:585
     ** (ArgumentError) argument error
     code: for _ <- 1..10 do
     stacktrace:
       :erlang.++([169 | <<246, 64, 171, 154, 65, 19, 36, 158, 149, 178, 14, 30, 207, 173, 107, 0, 158, 226, 147, 219, 216, 205, 41, 36, 210, 58, 180, 125, 221, 110, 143, 48, 16, 140, 197, 61, 57, 234, 234, 35, 242, 4, 247, 230, 125, 234, 117, 199, 126, ...>>], [<<246, 64, 171, 154, 65, 19, 36, 158, 149, 178, 14, 30, 207, 173, 107, 0, 158, 226, 147, 219, 216, 205, 41, 36, 210, 58, 180, 125, 221, 110, 143, 48, 16, 140, 197, 61, 57, 234, 234, 35, 242, 4, 247, 230, 125, 234, 117, 199, 126, ...>>])
       (stdlib 4.0) unicode_util.erl:3168: :unicode_util.gc_ext_pict/3
       (elixir 1.15.0-dev) lib/string.ex:1931: String.next_grapheme/1
       (elixir 1.15.0-dev) lib/stream.ex:1740: Stream.do_unfold/4
       (elixir 1.15.0-dev) lib/enum.ex:375: Enum.all?/2
       test/elixir/string_test.exs:592: anonymous fn/2 in StringTest."test next_grapheme/1"/1
       (elixir 1.15.0-dev) lib/enum.ex:4299: Enum.reduce_range/5
       test/elixir/string_test.exs:589: (test)

Expected behavior

Never fail?
Maybe it would be nice to have a prop-based test for this as well, I will open a PR to stream_data to add one.

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