Skip to content

Commit

Permalink
Test case and fix for missing mapped values in array
Browse files Browse the repository at this point in the history
Addresses: #43
  • Loading branch information
der committed Sep 17, 2022
1 parent b22fcbd commit 149f8ad
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/main/java/com/epimorphics/dclib/values/ValueArray.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
package com.epimorphics.dclib.values;

import com.epimorphics.dclib.framework.ConverterProcess;
import com.epimorphics.dclib.framework.NullResult;
import com.epimorphics.util.NameUtils;

import java.util.ArrayList;
Expand Down Expand Up @@ -333,7 +334,11 @@ public interface MapValue {
public ValueArray applyFunction(MapValue map) {
Value[] result = new Value[ value.length ];
for (int i = 0; i < value.length; i++) {
result[i] = map.map( value[i]);
try {
result[i] = map.map( value[i]);
} catch (NullResult n) {
result[i] = new ValueNull();
}
}
return new ValueArray(result);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,11 @@ public void testBugs() throws IOException {

checkAgainstExpected("test/bugCases/accidental-lang.yaml", "test/bugCases/accidental-lang.csv", "test/bugCases/accidental-lang.ttl");
}


@Test
public void testArrayMap() throws IOException {
checkAgainstExpected("test/arrayMap/resource-media-type.yaml", "test/arrayMap/resource_media_types.csv", "test/arrayMap/expected.ttl");
}
@Test
public void testDateParseFailure() throws IOException {
// A failure to parse a date shouldn't break the whole template, or should it
Expand Down

0 comments on commit 149f8ad

Please sign in to comment.