Corner case testing untuk validasi parser behavior dengan empty values, mixed arrays (kombinasi string dan object), dan special characters.
Testing edge cases yang mungkin ditemukan di production: config dengan optional values, mixed content types, dan special characters dalam values.
payment:
provider: stripe
ApiSecret:
EmptyObject:
NestedEmpty:
level1:
level2:
level3:
MixedArray:
- simpleString1
- name: objectInArray
value: 123
- simpleString2
- key: anotherObject
type: TEST
subconfig:
StatusCodes:
- 200
- 201
- 204
SpecialChars: "value:with:colons"
MultilineValue: TrxUrlMethod || ':' || relurl || ':' || minifiedMsg
NullishValues:
empty:
zero: 0
false: false
{
"payment": {
"provider": "stripe",
"ApiSecret": "",
"EmptyObject": "",
"NestedEmpty": {
"level1": "",
"level2": {
"level3": ""
}
},
"MixedArray": [
"simpleString1",
{
"name": "objectInArray",
"value": "123",
"subconfig": ""
},
"simpleString2",
{
"key": "anotherObject",
"type": "TEST"
}
],
"StatusCodes": ["200", "201", "204"],
"SpecialChars": "value:with:colons",
"MultilineValue": "TrxUrlMethod || ':' || relurl || ':' || minifiedMsg",
"NullishValues": {
"empty": "",
"zero": "0",
"false": "false"
}
}
}
DECLARE config REFERENCE TO Environment.Variables;
DECLARE success BOOLEAN;
CALL ACE_LIB.getConfig(
'EDGE_CASE_CONFIG',
'payment',
'/path/to/CONFIG3.yaml',
'600',
config
) INTO success;
IF success THEN
-- Empty values menjadi empty string
DECLARE apiSecret CHARACTER config.ApiSecret; -- ""
-- Nested empty values
DECLARE level3 CHARACTER config.NestedEmpty.level2.level3; -- ""
-- Mixed array: bisa string atau object
DECLARE itemRef REFERENCE TO config.MixedArray[1];
WHILE LASTMOVE(itemRef) DO
-- Check if it's object or string
IF itemRef.name IS NOT NULL THEN
-- It's an object
DECLARE itemName CHARACTER itemRef.name;
ELSE
-- It's a simple string
DECLARE itemValue CHARACTER itemRef;
END IF;
MOVE itemRef NEXTSIBLING;
END WHILE;
-- Special characters preserved
DECLARE specialVal CHARACTER config.SpecialChars;
-- Value: "value:with:colons"
END IF;
✅ Empty string values (ApiSecret:)
✅ Nested empty objects
✅ Mixed arrays (strings and objects together)
✅ Special characters in values (: tidak break parser)
✅ Numeric values as strings ("0", "200")
✅ Boolean-like values as strings ("false")
✅ Complex expression strings
key:) → empty string """0", "123")"false", "true")