fix bug in slice names for primitive types on choices

This commit is contained in:
Grahame Grieve 2020-01-14 14:29:54 +11:00
parent bd1d677ab8
commit c8c5c0e769
2 changed files with 7 additions and 2 deletions

View File

@ -1580,7 +1580,7 @@ public class ProfileUtilities extends TranslatingUtilities {
String tn = ed.getSliceName().substring(rn.length());
if (isDataType(tn)) {
typeList.add(new TypeSlice(ed, tn));
} else if (isDataType(Utilities.uncapitalize(tn))) {
} else if (isPrimitive(Utilities.uncapitalize(tn))) {
typeList.add(new TypeSlice(ed, Utilities.uncapitalize(tn)));
}
} else if (!ed.hasSliceName() && !s.equals("[x]")) {

View File

@ -107,6 +107,7 @@ public class SnapShotGenerationTests {
private boolean sort;
private boolean fail;
private boolean newSliceProcessing;
private boolean debug;
private List<Rule> rules = new ArrayList<>();
private StructureDefinition source;
private StructureDefinition included;
@ -119,6 +120,7 @@ public class SnapShotGenerationTests {
sort = "true".equals(test.getAttribute("sort"));
fail = "true".equals(test.getAttribute("fail"));
newSliceProcessing = !"false".equals(test.getAttribute("new-slice-processing"));
debug = "true".equals(test.getAttribute("debug"));
id = test.getAttribute("id");
include = test.getAttribute("include");
@ -189,6 +191,9 @@ public class SnapShotGenerationTests {
public boolean isNewSliceProcessing() {
return newSliceProcessing;
}
public boolean isDebug() {
return debug;
}
}
public class TestPKP implements ProfileKnowledgeProvider {
@ -480,7 +485,7 @@ public class SnapShotGenerationTests {
ProfileUtilities pu = new ProfileUtilities(TestingUtilities.context(), messages , new TestPKP());
pu.setNewSlicingProcessing(test.isNewSliceProcessing());
pu.setThrowException(false);
pu.setDebug(true);
pu.setDebug(test.isDebug());
pu.setIds(test.getSource(), false);
if (test.isSort()) {
List<String> errors = new ArrayList<String>();