feat(package): migrator: something

This commit is contained in:
2025-12-04 21:02:38 +00:00
parent dfa76b2a19
commit b786098867
12 changed files with 226 additions and 120 deletions

View File

@@ -1,32 +1,32 @@
answer="$(printf '%s' 'some text' | hemar -c)"
expected="$(printf '%s' '[
{
"type": "text",
"value": "some text"
}
]')"
json_diff "$answer" "$expected"
answer="$(printf '%s' 'some [] {} text' | hemar -c)"
expected="$(printf '%s' '[
{
"type": "text",
"value": "some [] {} text"
}
]')"
json_diff "$answer" "$expected"
answer="$(printf '%s' 'some {' | hemar -c)"
expected="$(printf '%s' '[
{
"type": "text",
"value": "some {"
}
]')"
json_diff "$answer" "$expected"
#answer="$(printf '%s' 'some text' | hemar -c)"
#
#expected="$(printf '%s' '[
# {
# "type": "text",
# "value": "some text"
# }
#]')"
#
#json_diff "$answer" "$expected"
#
#answer="$(printf '%s' 'some [] {} text' | hemar -c)"
#
#expected="$(printf '%s' '[
# {
# "type": "text",
# "value": "some [] {} text"
# }
#]')"
#
#json_diff "$answer" "$expected"
#
#answer="$(printf '%s' 'some {' | hemar -c)"
#
#expected="$(printf '%s' '[
# {
# "type": "text",
# "value": "some {"
# }
#]')"
#
#json_diff "$answer" "$expected"

View File

@@ -1,38 +1,38 @@
answer="$(printf '%s' 'text begind {[ "inn \\e\"r"-t\"ext ]}' | hemar -c)"
expected="$(printf '%s' '[
{
"type": "text",
"value": "text begind "
},
{
"type": "interpolation",
"path": "inn \\e\"r-t\"ext"
}
]')"
json_diff "$answer" "$expected"
[ "$(printf '%s' "$answer" | yq '.[1] | .path')" = 'inn \e"r-t"ext' ] || {
log error 'unexpected'
exit 1
}
answer="$(printf '%s' 'text begind {[ [" "] ]}' | hemar -c)"
expected="$(printf '%s' '[
{
"type": "text",
"value": "text begind "
},
{
"type": "interpolation",
"path": "[ ]"
}
]')"
json_diff "$answer" "$expected"
answer="$(printf '%s' 'text begind {[ [" "\ ] ]}' | hemar -c)"
json_diff "$answer" "$expected"
#answer="$(printf '%s' 'text begind {[ "inn \\e\"r"-t\"ext ]}' | hemar -c)"
#
#expected="$(printf '%s' '[
# {
# "type": "text",
# "value": "text begind "
# },
# {
# "type": "interpolation",
# "path": "inn \\e\"r-t\"ext"
# }
#]')"
#
#json_diff "$answer" "$expected"
#
#[ "$(printf '%s' "$answer" | yq '.[1] | .path')" = 'inn \e"r-t"ext' ] || {
# log error 'unexpected'
# exit 1
#}
#
#answer="$(printf '%s' 'text begind {[ [" "] ]}' | hemar -c)"
#
#expected="$(printf '%s' '[
# {
# "type": "text",
# "value": "text begind "
# },
# {
# "type": "interpolation",
# "path": "[ ]"
# }
#]')"
#
#json_diff "$answer" "$expected"
#
#answer="$(printf '%s' 'text begind {[ [" "\ ] ]}' | hemar -c)"
#
#json_diff "$answer" "$expected"