toml: fix test

pull/13654/head
Ned Palacios 2022-03-04 15:11:14 +08:00
parent 8f1cd11a0a
commit f1f46850aa
1 changed files with 5 additions and 1 deletions

View File

@ -204,7 +204,11 @@ fn to_burntsushi(value ast.Value) string {
ast.DateTime {
// Normalization for json
json_text := json2.Any(value.text).json_str().to_upper().replace(' ', 'T')
typ := if json_text.ends_with('Z') || json_text.all_after('T').contains('-')
// NB: Since encoding strings in JSON now automatically includes quotes,
// I added a somewhat a workaround by adding an ending quote in order to
// recognize properly the date time type. - Ned
typ := if json_text.ends_with('Z"') || json_text.all_after('T').contains('-')
|| json_text.all_after('T').contains('+') {
'datetime'
} else {