-
Notifications
You must be signed in to change notification settings - Fork 472
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
H3 CLI Hierarchical Subcommands (#846)
* H3 CLI Hierarchical Subcommands * Update compactCells and uncompactCells tests to also work if a build directory is set * Attempt some newline mangling shenanigans to get Windows testing working * Lol, how did this work before? What casting magic is the GNU libc doing? * Revert "Lol, how did this work before? What casting magic is the GNU libc doing?" This reverts commit 7549c75. * Accidentally committed the wrong file * Minor refactor to eliminate the string copy * DRY the parsing logic * Use sscanf and the %n 'formatter' that I wasn't aware of before * More simplification of the parsing logic * Update src/apps/filters/h3.c Co-authored-by: Isaac Brodsky <isaac@isaacbrodsky.com> * Update the cellsOffset type, too --------- Co-authored-by: Isaac Brodsky <isaac@isaacbrodsky.com>
- Loading branch information
1 parent
d6f2701
commit 7ce561c
Showing
15 changed files
with
546 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
add_h3_cli_test(testCliCellToCenterChild "cellToCenterChild -c 85283473fffffff --resolution 7" "872834700ffffff") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
add_h3_cli_test(testCliCellToChildPos "cellToChildPos -c 85283473fffffff -r 3" "25") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
add_h3_cli_test(testCliCellToChildren "cellToChildren -c 85283473fffffff -r 6" "[ \"862834707ffffff\", \"86283470fffffff\", \"862834717ffffff\", \"86283471fffffff\", \"862834727ffffff\", \"86283472fffffff\", \"862834737ffffff\" ]") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
add_h3_cli_test(testCliCellToChildrenSize "cellToChildrenSize -c 85283473fffffff -r 6" "7") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
add_h3_cli_test(testCliCellToParent "cellToParent -c 8928342e20fffff --resolution 3" "832834fffffffff") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
add_h3_cli_test(testCliChildPosToCell "childPosToCell -c 85283473fffffff -r 7 -p 42" "872834730ffffff") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
add_h3_cli_test(testCliCompactCellsFile1 "compactCells -f ${PROJECT_SOURCE_DIR}/tests/inputfiles/compact_test1.txt | tr -s '\\\\r\\\\n' ',' | tr -s '\\\\n' ','" "85283447fffffff,8528340ffffffff,8528340bfffffff,85283457fffffff,85283443fffffff,8528344ffffffff,852836b7fffffff,8528342bfffffff,8528343bfffffff,85283407fffffff,85283403fffffff,8528341bfffffff,8428347ffffffff,") | ||
add_h3_cli_test(testCliCompactCellsFile2 "compactCells -f ${PROJECT_SOURCE_DIR}/tests/inputfiles/compact_test2.txt | tr -s '\\\\r\\\\n' ',' | tr -s '\\\\n' ','" "85283447fffffff,8528340ffffffff,8528340bfffffff,85283457fffffff,85283443fffffff,8528344ffffffff,852836b7fffffff,8528342bfffffff,8528343bfffffff,85283407fffffff,85283403fffffff,8528341bfffffff,8428347ffffffff,") | ||
add_h3_cli_test(testCliCompactCellsFile3 "compactCells -f ${PROJECT_SOURCE_DIR}/tests/inputfiles/compact_test3.txt | tr -s '\\\\r\\\\n' ',' | tr -s '\\\\n' ','" "85283447fffffff,8528340ffffffff,8528340bfffffff,85283457fffffff,85283443fffffff,8528344ffffffff,852836b7fffffff,8528342bfffffff,8528343bfffffff,85283407fffffff,85283403fffffff,8528341bfffffff,8428347ffffffff,") | ||
add_h3_cli_test(testCliCompactCellsStdin1 "compactCells -f -- < ${PROJECT_SOURCE_DIR}/tests/inputfiles/compact_test1.txt | tr -s '\\\\r\\\\n' ',' | tr -s '\\\\n' ','" "85283447fffffff,8528340ffffffff,8528340bfffffff,85283457fffffff,85283443fffffff,8528344ffffffff,852836b7fffffff,8528342bfffffff,8528343bfffffff,85283407fffffff,85283403fffffff,8528341bfffffff,8428347ffffffff,") | ||
add_h3_cli_test(testCliCompactCellsStdin2 "compactCells -f -- < ${PROJECT_SOURCE_DIR}/tests/inputfiles/compact_test2.txt | tr -s '\\\\r\\\\n' ',' | tr -s '\\\\n' ','" "85283447fffffff,8528340ffffffff,8528340bfffffff,85283457fffffff,85283443fffffff,8528344ffffffff,852836b7fffffff,8528342bfffffff,8528343bfffffff,85283407fffffff,85283403fffffff,8528341bfffffff,8428347ffffffff,") | ||
add_h3_cli_test(testCliCompactCellsStdin3 "compactCells -f -- < ${PROJECT_SOURCE_DIR}/tests/inputfiles/compact_test3.txt | tr -s '\\\\r\\\\n' ',' | tr -s '\\\\n' ','" "85283447fffffff,8528340ffffffff,8528340bfffffff,85283457fffffff,85283443fffffff,8528344ffffffff,852836b7fffffff,8528342bfffffff,8528343bfffffff,85283407fffffff,85283403fffffff,8528341bfffffff,8428347ffffffff,") | ||
add_h3_cli_test(testCliCompactCellsArg1 "compactCells -c \"\\\\`cat ${PROJECT_SOURCE_DIR}/tests/inputfiles/compact_test1.txt\\\\`\" | tr -s '\\\\r\\\\n' ',' | tr -s '\\\\n' ','" "85283447fffffff,8528340ffffffff,8528340bfffffff,85283457fffffff,85283443fffffff,8528344ffffffff,852836b7fffffff,8528342bfffffff,8528343bfffffff,85283407fffffff,85283403fffffff,8528341bfffffff,8428347ffffffff,") | ||
add_h3_cli_test(testCliCompactCellsArg2 "compactCells -c \\\\`cat ${PROJECT_SOURCE_DIR}/tests/inputfiles/compact_test2.txt\\\\` | tr -s '\\\\r\\\\n' ',' | tr -s '\\\\n' ','" "85283447fffffff,8528340ffffffff,8528340bfffffff,85283457fffffff,85283443fffffff,8528344ffffffff,852836b7fffffff,8528342bfffffff,8528343bfffffff,85283407fffffff,85283403fffffff,8528341bfffffff,8428347ffffffff,") | ||
add_h3_cli_test(testCliCompactCellsArg3 "compactCells -c \\\\`cat ${PROJECT_SOURCE_DIR}/tests/inputfiles/compact_test3.txt\\\\` | tr -s '\\\\r\\\\n' ',' | tr -s '\\\\n' ','" "85283447fffffff,8528340ffffffff,8528340bfffffff,85283457fffffff,85283443fffffff,8528344ffffffff,852836b7fffffff,8528342bfffffff,8528343bfffffff,85283407fffffff,85283403fffffff,8528341bfffffff,8428347ffffffff,") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
add_h3_cli_test(testCliUncompactCellsFile1 "uncompactCells -r 5 -f ${PROJECT_SOURCE_DIR}/tests/inputfiles/uncompact_test1.txt | tr -s '\\\\r\\\\n' ',' | tr -s '\\\\n' ','" "85283447fffffff,8528340ffffffff,8528340bfffffff,85283457fffffff,85283443fffffff,8528344ffffffff,852836b7fffffff,8528342bfffffff,8528343bfffffff,85283407fffffff,85283403fffffff,8528341bfffffff,85283463fffffff,85283467fffffff,8528346bfffffff,8528346ffffffff,85283473fffffff,85283477fffffff,8528347bfffffff,") | ||
add_h3_cli_test(testCliUncompactCellsFile2 "uncompactCells -r 5 -f ${PROJECT_SOURCE_DIR}/tests/inputfiles/uncompact_test2.txt | tr -s '\\\\r\\\\n' ',' | tr -s '\\\\n' ','" "85283447fffffff,8528340ffffffff,8528340bfffffff,85283457fffffff,85283443fffffff,8528344ffffffff,852836b7fffffff,8528342bfffffff,8528343bfffffff,85283407fffffff,85283403fffffff,8528341bfffffff,85283463fffffff,85283467fffffff,8528346bfffffff,8528346ffffffff,85283473fffffff,85283477fffffff,8528347bfffffff,") | ||
add_h3_cli_test(testCliUncompactCellsFile3 "uncompactCells -r 5 -f ${PROJECT_SOURCE_DIR}/tests/inputfiles/uncompact_test3.txt | tr -s '\\\\r\\\\n' ',' | tr -s '\\\\n' ','" "85283447fffffff,8528340ffffffff,8528340bfffffff,85283457fffffff,85283443fffffff,8528344ffffffff,852836b7fffffff,8528342bfffffff,8528343bfffffff,85283407fffffff,85283403fffffff,8528341bfffffff,85283463fffffff,85283467fffffff,8528346bfffffff,8528346ffffffff,85283473fffffff,85283477fffffff,8528347bfffffff,") | ||
add_h3_cli_test(testCliUncompactCellsStdin1 "uncompactCells -r 5 -f -- < ${PROJECT_SOURCE_DIR}/tests/inputfiles/uncompact_test1.txt | tr -s '\\\\r\\\\n' ',' | tr -s '\\\\n' ','" "85283447fffffff,8528340ffffffff,8528340bfffffff,85283457fffffff,85283443fffffff,8528344ffffffff,852836b7fffffff,8528342bfffffff,8528343bfffffff,85283407fffffff,85283403fffffff,8528341bfffffff,85283463fffffff,85283467fffffff,8528346bfffffff,8528346ffffffff,85283473fffffff,85283477fffffff,8528347bfffffff,") | ||
add_h3_cli_test(testCliUncompactCellsStdin2 "uncompactCells -r 5 -f -- < ${PROJECT_SOURCE_DIR}/tests/inputfiles/uncompact_test2.txt | tr -s '\\\\r\\\\n' ',' | tr -s '\\\\n' ','" "85283447fffffff,8528340ffffffff,8528340bfffffff,85283457fffffff,85283443fffffff,8528344ffffffff,852836b7fffffff,8528342bfffffff,8528343bfffffff,85283407fffffff,85283403fffffff,8528341bfffffff,85283463fffffff,85283467fffffff,8528346bfffffff,8528346ffffffff,85283473fffffff,85283477fffffff,8528347bfffffff,") | ||
add_h3_cli_test(testCliUncompactCellsStdin3 "uncompactCells -r 5 -f -- < ${PROJECT_SOURCE_DIR}/tests/inputfiles/uncompact_test3.txt | tr -s '\\\\r\\\\n' ',' | tr -s '\\\\n' ','" "85283447fffffff,8528340ffffffff,8528340bfffffff,85283457fffffff,85283443fffffff,8528344ffffffff,852836b7fffffff,8528342bfffffff,8528343bfffffff,85283407fffffff,85283403fffffff,8528341bfffffff,85283463fffffff,85283467fffffff,8528346bfffffff,8528346ffffffff,85283473fffffff,85283477fffffff,8528347bfffffff,") | ||
add_h3_cli_test(testCliUncompactCellsArg1 "uncompactCells -r 5 -c \"\\\\`cat ${PROJECT_SOURCE_DIR}/tests/inputfiles/uncompact_test1.txt\\\\`\" | tr -s '\\\\r\\\\n' ',' | tr -s '\\\\n' ','" "85283447fffffff,8528340ffffffff,8528340bfffffff,85283457fffffff,85283443fffffff,8528344ffffffff,852836b7fffffff,8528342bfffffff,8528343bfffffff,85283407fffffff,85283403fffffff,8528341bfffffff,85283463fffffff,85283467fffffff,8528346bfffffff,8528346ffffffff,85283473fffffff,85283477fffffff,8528347bfffffff,") | ||
add_h3_cli_test(testCliUncompactCellsArg2 "uncompactCells -r 5 -c \"\\\\`cat ${PROJECT_SOURCE_DIR}/tests/inputfiles/uncompact_test2.txt\\\\`\" | tr -s '\\\\r\\\\n' ',' | tr -s '\\\\n' ','" "85283447fffffff,8528340ffffffff,8528340bfffffff,85283457fffffff,85283443fffffff,8528344ffffffff,852836b7fffffff,8528342bfffffff,8528343bfffffff,85283407fffffff,85283403fffffff,8528341bfffffff,85283463fffffff,85283467fffffff,8528346bfffffff,8528346ffffffff,85283473fffffff,85283477fffffff,8528347bfffffff,") | ||
add_h3_cli_test(testCliUncompactCellsArg3 "uncompactCells -r 5 -c \\\\`cat ${PROJECT_SOURCE_DIR}/tests/inputfiles/uncompact_test3.txt\\\\` | tr -s '\\\\r\\\\n' ',' | tr -s '\\\\n' ','" "85283447fffffff,8528340ffffffff,8528340bfffffff,85283457fffffff,85283443fffffff,8528344ffffffff,852836b7fffffff,8528342bfffffff,8528343bfffffff,85283407fffffff,85283403fffffff,8528341bfffffff,85283463fffffff,85283467fffffff,8528346bfffffff,8528346ffffffff,85283473fffffff,85283477fffffff,8528347bfffffff,") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
"85283473fffffff", | ||
"85283447fffffff", | ||
"8528347bfffffff", | ||
"85283463fffffff", | ||
"85283477fffffff", | ||
"8528340ffffffff", | ||
"8528340bfffffff", | ||
"85283457fffffff", | ||
"85283443fffffff", | ||
"8528344ffffffff", | ||
"852836b7fffffff", | ||
"8528346bfffffff", | ||
"8528346ffffffff", | ||
"85283467fffffff", | ||
"8528342bfffffff", | ||
"8528343bfffffff", | ||
"85283407fffffff", | ||
"85283403fffffff", | ||
"8528341bfffffff" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
"85283473fffffff","85283447fffffff","8528347bfffffff","85283463fffffff","85283477fffffff","8528340ffffffff","8528340bfffffff","85283457fffffff","85283443fffffff","8528344ffffffff","852836b7fffffff","8528346bfffffff","8528346ffffffff","85283467fffffff","8528342bfffffff","8528343bfffffff","85283407fffffff","85283403fffffff","8528341bfffffff" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
85283473fffffff,85283447fffffff,8528347bfffffff,85283463fffffff,85283477fffffff,8528340ffffffff,8528340bfffffff,85283457fffffff,85283443fffffff,8528344ffffffff,852836b7fffffff,8528346bfffffff,8528346ffffffff,85283467fffffff,8528342bfffffff,8528343bfffffff,85283407fffffff,85283403fffffff,8528341bfffffff |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[ | ||
"85283447fffffff", | ||
"8528340ffffffff", | ||
"8528340bfffffff", | ||
"85283457fffffff", | ||
"85283443fffffff", | ||
"8528344ffffffff", | ||
"852836b7fffffff", | ||
"8528342bfffffff", | ||
"8528343bfffffff", | ||
"85283407fffffff", | ||
"85283403fffffff", | ||
"8528341bfffffff", | ||
"8428347ffffffff" | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
85283447fffffff | ||
8528340ffffffff | ||
8528340bfffffff | ||
85283457fffffff | ||
85283443fffffff | ||
8528344ffffffff | ||
852836b7fffffff | ||
8528342bfffffff | ||
8528343bfffffff | ||
85283407fffffff | ||
85283403fffffff | ||
8528341bfffffff | ||
8428347ffffffff |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
85283447fffffff,8528340ffffffff,8528340bfffffff,85283457fffffff,85283443fffffff,8528344ffffffff,852836b7fffffff,8528342bfffffff,8528343bfffffff,85283407fffffff,85283403fffffff,8528341bfffffff,8428347ffffffff |