Skip to content

Commit 1ad9af0

Browse files
committed
Fix retcode and properly test shape
1 parent 6d02348 commit 1ad9af0

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

generate_data/jzarr/generate_data.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,16 @@
22
# https://stackoverflow.com/a/6393573/2700168
33
cd "${0%/*}"
44

5+
set -e
6+
set -u
7+
set -x
8+
59
mvn clean package
6-
java -cp target/jzarr-1.0.0.jar zarr_implementations.jzarr.App "$@"
10+
java -cp target/jzarr-1.0.0.jar zarr_implementations.jzarr.App "$@" && {
11+
# Workaround for: https://github.com/bcdev/jzarr/issues/25
12+
find ../../data/jzarr* -name .zarray -exec sed -ibak 's/>u1/|u1/' {} \;
13+
} || {
14+
echo jzarr failed
15+
exit 2
16+
}
717

8-
# Workaround for: https://github.com/bcdev/jzarr/issues/25
9-
find ../../data/jzarr* -name .zarray -exec sed -ibak 's/>u1/|u1/' {} \;

generate_data/jzarr/src/main/java/zarr_implementations/jzarr/App.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,10 @@ public static void main(String args[]) throws Exception {
7878
String dsname = args[2];
7979
ZarrArray verification = ZarrGroup.open(fpath).openArray(dsname);
8080
int[] shape = verification.getShape();
81-
if (!Arrays.equals(new int[]{}, shape)) {
81+
if (!Arrays.equals(SHAPE, shape)) {
8282
throw new RuntimeException(String.format(
83-
"shape-mismatch expected:{} found:{}",
84-
SHAPE, shape
83+
"shape-mismatch expected:%s found:%s",
84+
Arrays.toString(SHAPE), Arrays.toString(shape)
8585
));
8686
}
8787
return; // EARLY EXIT

0 commit comments

Comments
 (0)