Skip to content

Commit 99802ac

Browse files
Enhanced the "special characters" tests to verify PR APIDevTools#90
1 parent 9420095 commit 99802ac

File tree

5 files changed

+39
-10
lines changed

5 files changed

+39
-10
lines changed
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
definitions:
2-
$ref: "__(%7B%5B%20!%20%25%20%26%20%24%20%23%20%40%20%60%20~%20%2C)%7D%5D__/__(%7B%5B%20!%20%25%20%26%20%24%20%23%20%40%20%60%20~%20%2C)%7D%5D__.json"
2+
foo:
3+
$ref: "__(%7B%5B%20!%20%25%20%26%20%24%20%23%20%40%20%60%20~%20%2C)%7D%5D__/__(%7B%5B%20!%20%25%20%26%20%24%20%23%20%40%20%60%20~%20%2C)%7D%5D__.json#/definitions/foo"
4+
"__<({[ ! % & $ # @ + = ? \\ / \" ' ' ` ~ , ; : >)}]__":
5+
$ref: "__(%7B%5B%20!%20%25%20%26%20%24%20%23%20%40%20%60%20~%20%2C)%7D%5D__/__(%7B%5B%20!%20%25%20%26%20%24%20%23%20%40%20%60%20~%20%2C)%7D%5D__.json#/definitions/__%3C(%7B%5B%20!%20%25%20%26%20%24%20%23%20%40%20%2B%20%3D%20%3F%20%5C%20%2F%20%22%20'%20'%20%60%20~%20%2C%20%3B%20%3A%20%3E)%7D%5D__"
Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
{
2-
"type": "object",
3-
"description": "Testing file/folder names with spaces and special characters"
2+
"definitions": {
3+
"foo": {
4+
"type": "object",
5+
"description": "Testing file/folder names with spaces and special characters"
6+
},
7+
"__<({[ ! % & $ # @ + = ? \\ / \" ' ' ` ~ , ; : >)}]__": {
8+
"type": "object",
9+
"description": "Testing internal $refs with spaces and special characters"
10+
}
11+
}
412
}

test/specs/__({[ ! % & $ # @ ` ~ ,)}]__/special-characters.dereferenced.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,14 @@
44
helper.dereferenced.specialCharacters =
55
{
66
definitions: {
7-
description: 'Testing file/folder names with spaces and special characters',
8-
type: 'object'
7+
foo: {
8+
type: 'object',
9+
description: 'Testing file/folder names with spaces and special characters'
10+
},
11+
"__<({[ ! % & $ # @ + = ? \\ / \" ' ' ` ~ , ; : >)}]__": {
12+
type: 'object',
13+
description: 'Testing internal $refs with spaces and special characters'
14+
}
915
}
1016
};
1117
}());

test/specs/__({[ ! % & $ # @ ` ~ ,)}]__/special-characters.parsed.js

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,26 @@
55
{
66
schema: {
77
definitions: {
8-
$ref: '__(%7B%5B%20!%20%25%20%26%20%24%20%23%20%40%20%60%20~%20%2C)%7D%5D__/__(%7B%5B%20!%20%25%20%26%20%24%20%23%20%40%20%60%20~%20%2C)%7D%5D__.json'
8+
foo: {
9+
$ref: '__(%7B%5B%20!%20%25%20%26%20%24%20%23%20%40%20%60%20~%20%2C)%7D%5D__/__(%7B%5B%20!%20%25%20%26%20%24%20%23%20%40%20%60%20~%20%2C)%7D%5D__.json#/definitions/foo'
10+
},
11+
"__<({[ ! % & $ # @ + = ? \\ / \" ' ' ` ~ , ; : >)}]__": {
12+
$ref: "__(%7B%5B%20!%20%25%20%26%20%24%20%23%20%40%20%60%20~%20%2C)%7D%5D__/__(%7B%5B%20!%20%25%20%26%20%24%20%23%20%40%20%60%20~%20%2C)%7D%5D__.json#/definitions/__%3C(%7B%5B%20!%20%25%20%26%20%24%20%23%20%40%20%2B%20%3D%20%3F%20%5C%20%2F%20%22%20'%20'%20%60%20~%20%2C%20%3B%20%3A%20%3E)%7D%5D__"
13+
}
914
}
1015
},
1116

1217
file: {
13-
type: 'object',
14-
description: 'Testing file/folder names with spaces and special characters'
18+
definitions: {
19+
foo: {
20+
type: 'object',
21+
description: 'Testing file/folder names with spaces and special characters'
22+
},
23+
"__<({[ ! % & $ # @ + = ? \\ / \" ' ' ` ~ , ; : >)}]__": {
24+
type: 'object',
25+
description: 'Testing internal $refs with spaces and special characters'
26+
}
27+
}
1528
}
1629
};
1730

test/specs/__({[ ! % & $ # @ ` ~ ,)}]__/special-characters.spec.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
describe('File names with special characters', function () {
1+
describe.only('File names with special characters', function () {
22
'use strict';
33

44
it('should parse successfully', function () {
@@ -41,4 +41,3 @@ describe('File names with special characters', function () {
4141
});
4242
});
4343
});
44-

0 commit comments

Comments
 (0)