Elixir, Bitcoin, Testing, Software Development, Programming.
invalid binaries can’t be encoded by mistake: First we’ll test that short binaries are rejected: property "rejects short binaries" do check all bits <- integer(1..8), <<_::size(bits), data::bits>> <- binary(max_length: 16) do assert Bip39.Mnemonic.encode(data) == {:error, :invalid_data} end end