Skip to content

Commit

Permalink
copy enhanced test cases from DTDL repo (#133)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrdouceur authored Sep 23, 2024
1 parent c4c990d commit 0b77d9d
Show file tree
Hide file tree
Showing 2,545 changed files with 73,035 additions and 70,379 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2288,6 +2288,7 @@ public void TestParser_Requirement_2(string testName)
[DataRow("Requirement-ClassTelemetryTypeIncludesMaterialV3")]
[DataRow("Requirement-ClassTelemetryTypeIncludesNotDtmiNorTermV3")]
[DataRow("Requirement-ClassTelemetryTypeStringOrArrayV3")]
[DataRow("Requirement-ContextArrayAllStringsV3")]
[DataRow("Requirement-ContextDtdlPrecedesOrOnlyV3")]
[DataRow("Requirement-ContextDtmiWithVersionQuantV3")]
[DataRow("Requirement-ContextStringOrArrayQuantV3")]
Expand Down Expand Up @@ -2855,6 +2856,7 @@ public void TestParser_Requirement_3(string testName)
[DataRow("Requirement-ClassTelemetryTypeIncludesMaterialV4")]
[DataRow("Requirement-ClassTelemetryTypeIncludesNotDtmiNorTermV4")]
[DataRow("Requirement-ClassTelemetryTypeStringOrArrayV4")]
[DataRow("Requirement-ContextArrayAllStringsV4")]
[DataRow("Requirement-ContextDtdlPrecedesOrOnlyV4")]
[DataRow("Requirement-ContextDtmiWithVersionQuantV4")]
[DataRow("Requirement-ContextStringOrArrayQuantV4")]
Expand Down
26 changes: 16 additions & 10 deletions test-cases/generated/LocalDefinitionPrefixBadDtmiV3.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,20 @@
"foo": "dtmi:foo:"
}
],
"@id": "dtmi:test:aTelemetry;1",
"@type": [
"Telemetry",
"Length"
],
"name": "height",
"schema": "double",
"unit": "foo:a/b"
"@id": "dtmi:test:Sensor;1",
"@type": "Interface",
"contents": [
{
"@id": "dtmi:test:aTelemetry;1",
"@type": [
"Telemetry",
"Length"
],
"name": "height",
"schema": "double",
"unit": "foo:a/b"
}
]
}
],
"expect": {
Expand All @@ -40,15 +46,15 @@
"Property": "unit",
"Value": "foo:a/b",
"PrimaryIndex": 0,
"PrimaryStart": 16
"PrimaryStart": 20
},
{
"ValidationID": "dtmi:dtdl:parsingError:objectCountBelowMin",
"PrimaryID": "dtmi:test:aTelemetry;1",
"SecondaryID": null,
"Property": "unit",
"PrimaryIndex": 0,
"PrimaryStart": 16
"PrimaryStart": 20
}
]
}
Expand Down
26 changes: 16 additions & 10 deletions test-cases/generated/LocalDefinitionPrefixBadDtmiV4.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,20 @@
"foo": "dtmi:foo:"
}
],
"@id": "dtmi:test:aTelemetry;1",
"@type": [
"Telemetry",
"Length"
],
"name": "height",
"schema": "double",
"unit": "foo:a/b"
"@id": "dtmi:test:Sensor;1",
"@type": "Interface",
"contents": [
{
"@id": "dtmi:test:aTelemetry;1",
"@type": [
"Telemetry",
"Length"
],
"name": "height",
"schema": "double",
"unit": "foo:a/b"
}
]
}
],
"expect": {
Expand All @@ -40,15 +46,15 @@
"Property": "unit",
"Value": "foo:a/b",
"PrimaryIndex": 0,
"PrimaryStart": 16
"PrimaryStart": 20
},
{
"ValidationID": "dtmi:dtdl:parsingError:objectCountBelowMin",
"PrimaryID": "dtmi:test:aTelemetry;1",
"SecondaryID": null,
"Property": "unit",
"PrimaryIndex": 0,
"PrimaryStart": 16
"PrimaryStart": 20
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
"input": [
{
"@context": "dtmi:dtdl:context;3",
"@id": "dtmi:example:zatz_delta;1",
"@id": "dtmi:example:flunn_xi;1",
"@type": "Interface",
"contents": {
"@type": "Property",
"name": "zatz_gamma",
"name": "flunn_nu",
"schema": {
"@context": [],
"@type": "Array",
Expand All @@ -29,11 +29,11 @@
"input": [
{
"@context": "dtmi:dtdl:context;3",
"@id": "dtmi:example:zatz_zeta;1",
"@id": "dtmi:example:flunn_pi;1",
"@type": "Interface",
"contents": {
"@type": "Property",
"name": "zatz_epsilon",
"name": "flunn_omicron",
"schema": {
"@type": "Array",
"elementSchema": "dateTime"
Expand All @@ -50,10 +50,10 @@
"input": [
{
"@context": "dtmi:dtdl:context;3",
"@id": "dtmi:example:zatz_theta;1",
"@id": "dtmi:example:flunn_sigma;1",
"@type": "Interface",
"schemas": {
"@id": "dtmi:example:zatz_eta;1",
"@id": "dtmi:example:flunn_rho;1",
"@type": "Array",
"elementSchema": "double"
}
Expand All @@ -68,10 +68,10 @@
"input": [
{
"@context": "dtmi:dtdl:context;3",
"@id": "dtmi:example:zatz_kappa;1",
"@id": "dtmi:example:flunn_upsilon;1",
"@type": "Interface",
"schemas": {
"@id": "dtmi:example:zatz_iota;1",
"@id": "dtmi:example:flunn_tau;1",
"@type": "Array",
"elementSchema": "duration"
}
Expand All @@ -86,10 +86,10 @@
"input": [
{
"@context": "dtmi:dtdl:context;3",
"@id": "dtmi:example:zatz_mu;1",
"@id": "dtmi:example:flunn_chi;1",
"@type": "Interface",
"schemas": {
"@id": "dtmi:example:zatz_lambda;1",
"@id": "dtmi:example:flunn_phi;1",
"@type": "Array",
"elementSchema": "float"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
"input": [
{
"@context": "dtmi:dtdl:context;4",
"@id": "dtmi:example:zatz_alpha;1",
"@id": "dtmi:example:yekk_yuzz;1",
"@type": "Interface",
"contents": {
"@type": "Property",
"name": "floob_hi",
"name": "yekk_omega",
"schema": {
"@context": [],
"@type": "Array",
Expand All @@ -29,11 +29,11 @@
"input": [
{
"@context": "dtmi:dtdl:context;4",
"@id": "dtmi:example:zatz_gamma;1",
"@id": "dtmi:example:yekk_um;1",
"@type": "Interface",
"contents": {
"@type": "Property",
"name": "zatz_beta",
"name": "yekk_wum",
"schema": {
"@type": "Array",
"elementSchema": "boolean"
Expand All @@ -50,10 +50,10 @@
"input": [
{
"@context": "dtmi:dtdl:context;4",
"@id": "dtmi:example:zatz_epsilon;1",
"@id": "dtmi:example:yekk_fuddle;1",
"@type": "Interface",
"schemas": {
"@id": "dtmi:example:zatz_delta;1",
"@id": "dtmi:example:yekk_humpf;1",
"@type": "Array",
"elementSchema": "bytes"
}
Expand All @@ -68,10 +68,10 @@
"input": [
{
"@context": "dtmi:dtdl:context;4",
"@id": "dtmi:example:zatz_eta;1",
"@id": "dtmi:example:yekk_nuh;1",
"@type": "Interface",
"schemas": {
"@id": "dtmi:example:zatz_zeta;1",
"@id": "dtmi:example:yekk_glikk;1",
"@type": "Array",
"elementSchema": "date"
}
Expand All @@ -86,10 +86,10 @@
"input": [
{
"@context": "dtmi:dtdl:context;4",
"@id": "dtmi:example:zatz_iota;1",
"@id": "dtmi:example:yekk_quan;1",
"@type": "Interface",
"schemas": {
"@id": "dtmi:example:zatz_theta;1",
"@id": "dtmi:example:yekk_snee;1",
"@type": "Array",
"elementSchema": "dateTime"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
"input": [
{
"@context": "dtmi:dtdl:context;4",
"@id": "dtmi:example:gamma_pi;1",
"@id": "dtmi:example:kappa_lambda;1",
"@type": "Interface",
"contents": {
"@type": "Property",
"name": "gamma_omicron",
"name": "kappa_kappa",
"schema": {
"@id": "dtmi:foo:epsilon_chi;1",
"@type": "Array",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
"input": [
{
"@context": "dtmi:dtdl:context;2",
"@id": "dtmi:example:pi_xi;1",
"@id": "dtmi:example:pi_sigma;1",
"@type": "Interface",
"schemas": {
"@id": "dtmi:example:pi_mu;1",
"@id": "dtmi:example:pi_pi;1",
"@type": "Array",
"dtmi:dtdl:property:comment;2": "pi_nu",
"elementSchema": "double"
"dtmi:dtdl:property:comment;2": "pi_rho",
"elementSchema": "float"
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
"input": [
{
"@context": "dtmi:dtdl:context;3",
"@id": "dtmi:example:itch_yekk;1",
"@id": "dtmi:example:hi_mu;1",
"@type": "Interface",
"schemas": {
"@id": "dtmi:example:itch_flunn;1",
"@id": "dtmi:example:hi_kappa;1",
"@type": "Array",
"dtmi:dtdl:property:comment;3": "itch_itch",
"elementSchema": "time"
"dtmi:dtdl:property:comment;3": "hi_lambda",
"elementSchema": "date"
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
"input": [
{
"@context": "dtmi:dtdl:context;4",
"@id": "dtmi:example:itch_jogg;1",
"@id": "dtmi:example:beta_psi;1",
"@type": "Interface",
"schemas": {
"@id": "dtmi:example:itch_floob;1",
"@id": "dtmi:example:beta_phi;1",
"@type": "Array",
"dtmi:dtdl:property:comment;4": "itch_zatz",
"elementSchema": "string"
"dtmi:dtdl:property:comment;4": "beta_chi",
"elementSchema": "uuid"
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
"input": [
{
"@context": "dtmi:dtdl:context;2",
"@id": "dtmi:example:rho_vroo;1",
"@id": "dtmi:example:sigma_gamma;1",
"@type": "Interface",
"schemas": {
"@id": "dtmi:example:rho_itch;1",
"@id": "dtmi:example:sigma_alpha;1",
"@type": "Array",
"dtmi:dtdl:property:description;2": [
"rho_yekk"
"sigma_beta"
],
"elementSchema": "float"
"elementSchema": "long"
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
"input": [
{
"@context": "dtmi:dtdl:context;3",
"@id": "dtmi:example:vroo_wum;1",
"@id": "dtmi:example:alpha_itch;1",
"@type": "Interface",
"schemas": {
"@id": "dtmi:example:vroo_omega;1",
"@id": "dtmi:example:alpha_jogg;1",
"@type": "Array",
"dtmi:dtdl:property:description;3": [
"vroo_yuzz"
"alpha_flunn"
],
"elementSchema": "date"
"elementSchema": "double"
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
"input": [
{
"@context": "dtmi:dtdl:context;4",
"@id": "dtmi:example:vroo_psi;1",
"@id": "dtmi:example:delta_theta;1",
"@type": "Interface",
"schemas": {
"@id": "dtmi:example:vroo_phi;1",
"@id": "dtmi:example:delta_zeta;1",
"@type": "Array",
"dtmi:dtdl:property:description;4": [
"vroo_chi"
"delta_eta"
],
"elementSchema": "duration"
"elementSchema": "integer"
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
"input": [
{
"@context": "dtmi:dtdl:context;2",
"@id": "dtmi:example:tau_um;1",
"@id": "dtmi:example:tau_nuh;1",
"@type": "Interface",
"schemas": {
"@id": "dtmi:example:tau_yuzz;1",
"@id": "dtmi:example:tau_fuddle;1",
"@type": "Array",
"dtmi:dtdl:property:displayName;2": [
"tau_wum"
"tau_glikk"
],
"elementSchema": "long"
"elementSchema": "time"
}
}
]
Expand Down
Loading

0 comments on commit 0b77d9d

Please sign in to comment.