Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
5195793
Add new test schema
mradbourne Apr 12, 2024
21e7ee2
Remove ordinal and plural tests as per https://github.com/unicode-org…
mradbourne Apr 15, 2024
677590c
Improve data-model-errors description
mradbourne Apr 15, 2024
6a7214f
Make `scenario` property optional
mradbourne Apr 15, 2024
f5fa711
Schema refactor and typo fix
mradbourne Apr 15, 2024
92c06e3
Minor schema refactors
mradbourne Apr 15, 2024
3a5136b
Remove redundant `type` properties from params
mradbourne Apr 15, 2024
ba74af9
Version test schema
mradbourne Apr 16, 2024
f406915
Rename core to syntax
mradbourne Apr 16, 2024
7c4353e
Add array types to `src` and `expCleanSrc` for readability
mradbourne Apr 16, 2024
ff5f34c
Add formatted-parts schema
mradbourne Apr 17, 2024
d97a41f
Simplify expParts
mradbourne Apr 19, 2024
5481531
Make `name` property required in `var`
mradbourne Apr 19, 2024
8e816db
Fix indentation
mradbourne Apr 19, 2024
0727525
Update README and description
mradbourne Apr 19, 2024
b9fb07b
Update error types
mradbourne Apr 22, 2024
e5f4058
Remove testType property
mradbourne Apr 22, 2024
1242ac7
Allow additional properties in message expression part
mradbourne Apr 22, 2024
8481e37
Remove array version of `src`
mradbourne Apr 23, 2024
3ca3ff6
Disallow presence of both `parts` and `value` in expression part
mradbourne Apr 23, 2024
1ba5f56
Change literal from number to string in test
mradbourne Apr 23, 2024
1ddd4ee
Add missing additionalProperties:false
mradbourne Apr 23, 2024
1c6032c
Change incorrect string literal part to integer expression
mradbourne Apr 23, 2024
d901660
Simplify schema versioning
mradbourne Apr 29, 2024
4fc58e8
Remove outdated description
mradbourne Apr 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/.vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"fileMatch": [
"tests/**/*.json"
],
"url": "./schemas/tests-schema-0.0.1.json"
"url": "./schemas/v0-0-1/tests.schema.json"
}
]
}
206 changes: 206 additions & 0 deletions test/schemas/v0-0-1/formatted-parts.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,206 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://raw.githubusercontent.com/unicode-org/message-format-wg/main/test/schemas/v0-0-1/formatted-parts.schema.json",
"title": "Formatted parts",
"description": "The expected result of formatting the message to parts.",
"type": "array",
"items": {
"oneOf": [
{
"$ref": "#/$defs/messageLiteralPart"
},
{
"$ref": "#/$defs/messageMarkupPart"
},
{
"$ref": "#/$defs/messageExpressionPart"
}
]
},
"$defs": {
"messageLiteralPart": {
"type": "object",
"additionalProperties": false,
"required": [
"type",
"value"
],
"properties": {
"type": {
"const": "literal"
},
"value": {
"type": "string"
}
}
},
"messageMarkupPart": {
"type": "object",
"additionalProperties": false,
"required": [
"type",
"kind",
"name"
],
"properties": {
"type": {
"const": "markup"
},
"kind": {
"enum": [
"open",
"standalone",
"close"
]
},
"source": {
"type": "string"
},
"name": {
"type": "string"
},
"options": {
"type": "object"
}
}
},
"messageExpressionPart": {
"type": "object",
"properties": {
"type": {
"enum": [
"datetime",
"fallback",
"number",
"string",
"unknown"
]
}
},
"oneOf": [
{
"$ref": "#/$defs/messageDateTimePart"
},
{
"$ref": "#/$defs/messageFallbackPart"
},
{
"$ref": "#/$defs/messageNumberPart"
},
{
"$ref": "#/$defs/messageStringPart"
},
{
"$ref": "#/$defs/messageUnknownPart"
}
]
},
"messageDateTimePart": {
"type": "object",
"additionalProperties": false,
"required": [
"type",
"source",
"locale",
"parts"
],
"properties": {
"type": {
"const": "datetime"
},
"source": {
"type": "string"
},
"locale": {
"type": "string"
},
"parts": {
"type": "array",
"items": {}
}
}
},
"messageFallbackPart": {
"type": "object",
"required": [
"type",
"source"
],
"properties": {
"type": {
"const": "fallback"
},
"source": {
"type": "string"
}
}
},
"messageNumberPart": {
"type": "object",
"additionalProperties": false,
"required": [
"type",
"source",
"locale",
"parts"
],
"properties": {
"type": {
"const": "number"
},
"source": {
"type": "string"
},
"locale": {
"type": "string"
},
"parts": {
"type": "array",
"items": {}
}
}
},
"messageStringPart": {
"type": "object",
"additionalProperties": false,
"required": [
"type",
"source",
"locale",
"value"
],
"properties": {
"type": {
"const": "string"
},
"source": {
"type": "string"
},
"locale": {
"type": "string"
},
"value": {
"type": "string"
}
}
},
"messageUnknownPart": {
"type": "object",
"additionalProperties": false,
"required": [
"type",
"source",
"value"
],
"properties": {
"type": {
"const": "unknown"
},
"source": {
"type": "string"
},
"value": {}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://raw.githubusercontent.com/unicode-org/message-format-wg/main/test/schemas/tests-schema-0.0.1.json",
"title": "MessageFormat 2 data-driven tests source",
"description": "This documents the format of MessageFormat 2 source test data.",
"$id": "https://raw.githubusercontent.com/unicode-org/message-format-wg/main/test/schemas/v0-0-1/tests.schema.json",
"title": "MessageFormat 2 data-driven tests",
"description": "This is the main schema for MessageFormat 2 test source data.",
"type": "object",
"additionalProperties": false,
"required": [
Expand Down Expand Up @@ -276,118 +276,7 @@
}
},
"expParts": {
"description": "The expected result of formatting the message to parts.",
"type": "array",
"items": {
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"enum": [
"markup",
"literal",
"fallback"
]
},
"kind": {},
"name": {},
"value": {},
"source": {}
},
"oneOf": [
{
"additionalProperties": false,
"required": [
"kind",
"name"
],
"properties": {
"type": {
"const": "markup"
},
"kind": {
"enum": [
"standalone",
"open",
"close"
]
},
"name": {
"type": "string"
},
"options": {
"$ref": "#/$defs/expPartOptions"
}
}
},
{
"additionalProperties": false,
"required": [
"value",
"valueType"
],
"properties": {
"type": {
"const": "literal"
},
"value": {
"type": "number"
},
"valueType": {
"enum": [
"integer"
]
},
"options": {
"$ref": "#/$defs/expPartOptions"
}
}
},
{
"additionalProperties": false,
"required": [
"value"
],
"properties": {
"type": {
"const": "literal"
},
"value": {
"type": "string"
},
"options": {
"$ref": "#/$defs/expPartOptions"
}
}
},
{
"additionalProperties": false,
"required": [
"source"
],
"properties": {
"type": {
"const": "fallback"
},
"source": {
"type": "string"
}
}
}
]
}
},
"expPartOptions": {
"description": "Expected option value within a part.",
"type": "object",
"additionalProperties": {
"type": [
"string",
"number"
]
}
"$ref": "formatted-parts.schema.json"
},
"expErrors": {
"description": "The runtime errors expected to be emitted when formatting the message. If expErrors is either absent or empty, the message must be formatted without errors.",
Expand Down