Skip to content

Commit

Permalink
Changed tests to not worry about ordering of k/vs in maps.
Browse files Browse the repository at this point in the history
  • Loading branch information
oubiwann committed Mar 5, 2024
1 parent 467a5b1 commit 6f8222e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
jobs:

builds:
name: Erlang ${{ matrix.otp_version }} build
name: Erlang ${{ matrix.otp-version }} build
runs-on: ubuntu-latest

strategy:
Expand Down Expand Up @@ -43,18 +43,18 @@ jobs:
run: rebar3 demo

older-builds:
name: Erlang ${{ matrix.otp_version }} build (old)
name: Erlang ${{ matrix.otp-version }} build (old)
runs-on: ubuntu-20.04

strategy:
matrix:
otp_version: ['21', '22', '23']
otp-version: ['21', '22', '23']

steps:
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.otp_version }}
otp-version: ${{ matrix.otp-version }}
rebar3-version: '3.15'
- name: Compile
run: rebar3 compile
Expand Down
18 changes: 10 additions & 8 deletions test/logjam_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,23 @@ map_depth(_) ->
Map = #{a => #{b => #{c => #{d => x}},
f => g},
1 => #{2 => #{3 => x}}},
?assertEqual(
"a_f=g a_b_c=... 1_2_3=x ",
lists:flatten(
Result1 = lists:flatten(
logjam:format(#{level => info, msg => {report, Map}, meta => #{}},
#{template => Template,
map_depth => 3})
)
),
),
?assertEqual(
"a=... 1=... ",
lists:flatten(
2,
length(string:split(Result1, "...", all))
),
Result2 = lists:flatten(
logjam:format(#{level => info, msg => {report, Map}, meta => #{}},
#{template => Template,
map_depth => 1})
)
),
?assertEqual(
3,
length(string:split(Result2, "...", all))
),

ok.
Expand Down

0 comments on commit 6f8222e

Please sign in to comment.