Skip to content

Commit

Permalink
add font test (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
sharkAndshark authored Oct 28, 2023
1 parent 9c51d46 commit 328d98a
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 1 deletion.
2 changes: 2 additions & 0 deletions tests/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -168,3 +168,5 @@ sprites:
paths: tests/fixtures/sprites/src1
sources:
mysrc: tests/fixtures/sprites/src2
fonts:
- tests/fixtures/fonts
17 changes: 16 additions & 1 deletion tests/expected/configured/catalog_cfg.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,20 @@
]
}
},
"fonts": {}
"fonts": {
"Overpass Mono Light": {
"family": "Overpass Mono",
"style": "Light",
"glyphs": 931,
"start": 0,
"end": 64258
},
"Overpass Mono Regular": {
"family": "Overpass Mono",
"style": "Regular",
"glyphs": 931,
"start": 0,
"end": 64258
}
}
}
Binary file added tests/expected/configured/font_1.pbf
Binary file not shown.
Binary file added tests/expected/configured/font_2.pbf
Binary file not shown.
Binary file added tests/expected/configured/font_3.pbf
Binary file not shown.
2 changes: 2 additions & 0 deletions tests/expected/given_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -164,3 +164,5 @@ sprites:
paths: tests/fixtures/sprites/src1
sources:
mysrc: tests/fixtures/sprites/src2
fonts:
- tests/fixtures/fonts
Binary file added tests/fixtures/fonts/overpass-mono-regular.ttf
Binary file not shown.
Binary file not shown.
12 changes: 12 additions & 0 deletions tests/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,14 @@ test_png()
fi
}

test_font(){
FILENAME="$TEST_OUT_DIR/$1.pbf"
URL="$MARTIN_URL/$2"

echo "Testing $(basename "$FILENAME") from $URL"
$CURL "$URL" > "$FILENAME"
}

# Delete a line from a file $1 that matches parameter $2
remove_line()
{
Expand Down Expand Up @@ -268,6 +276,10 @@ test_png spr_cmp sprite/src1,mysrc.png
test_jsn spr_cmp_2x sprite/src1,[email protected]
test_png spr_cmp_2x sprite/src1,[email protected]

test_font font_1 font/Overpass%20Mono%20Light/0-255
test_font font_2 font/Overpass%20Mono%20Regular/0-255
test_font font_3 font/Overpass%20Mono%20Regular%2COverpass%20Mono%20Light/0-255

kill_process $PROCESS_ID
validate_log "${TMP_DIR}/test_log_2.txt"

Expand Down

0 comments on commit 328d98a

Please sign in to comment.