chore: format

pull/1119/head
zachdaniel 6 years ago
parent 21a1c1403c
commit e97873ddae
  1. 55
      apps/block_scout_web/test/block_scout_web/views/abi_encoded_value_view_test.exs

@ -28,31 +28,33 @@ defmodule BlockScoutWeb.ABIEncodedValueViewTest do
end end
test "it formats lists with newlines and spaces" do test "it formats lists with newlines and spaces" do
expected = String.trim(""" expected =
[ String.trim("""
1, [
2, 1,
3, 2,
4 3,
] 4
""") ]
""")
assert value_html("uint[]", [1, 2, 3, 4]) == expected assert value_html("uint[]", [1, 2, 3, 4]) == expected
end end
test "it formats nested lists with nested depth" do test "it formats nested lists with nested depth" do
expected = String.trim(""" expected =
[ String.trim("""
[ [
1, [
2 1,
], 2
[ ],
3, [
4 3,
4
]
] ]
] """)
""")
assert value_html("uint[][]", [[1, 2], [3, 4]]) == expected assert value_html("uint[][]", [[1, 2], [3, 4]]) == expected
end end
@ -61,14 +63,15 @@ defmodule BlockScoutWeb.ABIEncodedValueViewTest do
address = "0x0000000000000000000000000000000000000000" address = "0x0000000000000000000000000000000000000000"
address_link = ~s(<a href=\"/address/#{address}\" target=\"_blank\">#{address}</a>) address_link = ~s(<a href=\"/address/#{address}\" target=\"_blank\">#{address}</a>)
expected = String.trim(""" expected =
[ String.trim("""
#{address_link}, [
#{address_link}, #{address_link},
#{address_link}, #{address_link},
#{address_link} #{address_link},
] #{address_link}
""") ]
""")
address_bytes = "0x0000000000000000000000000000000000000000" |> String.trim_leading("0x") |> Base.decode16!() address_bytes = "0x0000000000000000000000000000000000000000" |> String.trim_leading("0x") |> Base.decode16!()

Loading…
Cancel
Save