add two test cases, have source uses ascii only

This commit is contained in:
Giorgio Gallo 2023-04-27 17:53:34 +02:00
parent 053ba7304a
commit 55a8205397

View File

@ -61,7 +61,7 @@ func TestShellVariablesEncoderKeyPrintableNonAlphaNumeric(t *testing.T) {
} }
func TestShellVariablesEncoderKeyPrintableNonAscii(t *testing.T) { func TestShellVariablesEncoderKeyPrintableNonAscii(t *testing.T) {
assertEncodesTo(t, `"bèll": ring!`, "bell='ring!'") assertEncodesTo(t, `"b\u00e9ll": ring!`, "bell='ring!'")
} }
func TestShellVariablesEncoderRootKeyStartingWithDigit(t *testing.T) { func TestShellVariablesEncoderRootKeyStartingWithDigit(t *testing.T) {
@ -72,6 +72,14 @@ func TestShellVariablesEncoderEmptyValue(t *testing.T) {
assertEncodesTo(t, "empty:", "empty=") assertEncodesTo(t, "empty:", "empty=")
} }
func TestShellVariablesEncoderEmptyArray(t *testing.T) {
assertEncodesTo(t, "empty: []", "")
}
func TestShellVariablesEncoderEmptyMap(t *testing.T) {
assertEncodesTo(t, "empty: {}", "")
}
func TestShellVariablesEncoderScalarNode(t *testing.T) { func TestShellVariablesEncoderScalarNode(t *testing.T) {
assertEncodesTo(t, "some string", "value='some string'") assertEncodesTo(t, "some string", "value='some string'")
} }