Skip to content

Commit 249c0e1

Browse files
committed
Merge branch 'tests-edge-cases' of https://github.com/mathworks/MATLAB-support-for-Zarr-files into tests-edge-cases
tests-edge-cases were merged with updated main online, now need to merge with those changes
2 parents 61deac3 + 591b2ba commit 249c0e1

File tree

5 files changed

+50
-6
lines changed

5 files changed

+50
-6
lines changed

.codespellrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[codespell]
2+
# Ref: https://github.com/codespell-project/codespell#using-a-config-file
3+
skip = .git*,.codespellrc
4+
check-hidden = true
5+
# ignore-regex =
6+
ignore-words-list = ans

.github/workflows/codespell.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Codespell configuration is within .codespellrc
2+
---
3+
name: Codespell
4+
5+
on:
6+
push:
7+
branches: [main]
8+
pull_request:
9+
branches: [main]
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
codespell:
16+
name: Check for spelling errors
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
- name: Annotate locations with typos
23+
uses: codespell-project/codespell-problem-matcher@v1
24+
- name: Codespell
25+
uses: codespell-project/actions-codespell@v2

test/SharedZarrTestSetup.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
ChunkSize = [4 5]
1010

1111
% Path for write tests
12+
GrpPathWrite = "prt_grp_write"
1213
ArrPathWrite = "prt_grp_write/arr1"
1314
end
1415

test/tZarrAttributes.m

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,19 @@
77
function createZarrArrayWithAttrs(testcase)
88
% Create Zarr array and add some attributes.
99
zarrcreate(testcase.ArrPathWrite,testcase.ArrSize);
10+
11+
% Write array attributes
1012
zarrwriteatt(testcase.ArrPathWrite,'scalarText','This is an array attribute.');
1113
zarrwriteatt(testcase.ArrPathWrite,'numericVector',[1,2,3]);
1214
zarrwriteatt(testcase.ArrPathWrite,'numericCellArray',{1,2,3});
1315
zarrwriteatt(testcase.ArrPathWrite,'mixedCellArray',{1,'two',3});
1416
attrStruct.numVal = 10;
1517
attrStruct.strArr = ["array","attribute"];
1618
zarrwriteatt(testcase.ArrPathWrite,'struct',attrStruct);
19+
20+
% Write group attributes
21+
zarrwriteatt(testcase.GrpPathWrite,'grp_description','This is a group');
22+
zarrwriteatt(testcase.GrpPathWrite,'grp_level',1);
1723
end
1824
end
1925

@@ -48,9 +54,10 @@ function verifyArrayAttributeInfo(testcase)
4854

4955
function verifyAttrOverwrite(testcase)
5056
% Verify attribute value after overwrite.
51-
57+
5258
expAttrStr = 'New attribute value';
5359
zarrwriteatt(testcase.ArrPathWrite,'scalarText',expAttrStr);
60+
5461
expAttrDbl = 10;
5562
zarrwriteatt(testcase.ArrPathWrite,'numericVector',expAttrDbl);
5663

@@ -66,11 +73,16 @@ function verifyAttrOverwrite(testcase)
6673
end
6774

6875
function verifyGroupAttributeInfo(testcase)
69-
% Write attribute info using zarrwriteatt function to a group.
70-
testcase.assumeTrue(false,'Filtered until Issue-35 is fixed.');
76+
% Verify group attribute info.
77+
grpInfo = zarrinfo(testcase.GrpPathWrite);
78+
79+
actAttr1 = grpInfo.grp_description;
80+
expAttr1 = 'This is a group';
81+
testcase.verifyEqual(actAttr1,expAttr1,'Failed to verify text attribute.');
7182

72-
% Unable to read attribute data from a group/array created
73-
% using Python.
83+
actAttr2 = grpInfo.grp_level;
84+
expAttr2 = 1;
85+
testcase.verifyEqual(actAttr2,expAttr2,'Failed to verify numeric attribute.');
7486
end
7587

7688
function verifyZarrV3WriteError(testcase)

test/tZarrCreate.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ function invalidSizeInput(testcase)
243243
end
244244

245245
function invalidDatatype(testcase)
246-
% Verify the error when an usupported datatype is used.
246+
% Verify the error when an unsupported datatype is used.
247247
testcase.verifyError(@()zarrcreate(testcase.ArrPathWrite,...
248248
testcase.ArrSize,Datatype="bla"),...
249249
'MATLAB:validators:mustBeMember');

0 commit comments

Comments
 (0)