escape DEL character. fixes #40

This commit is contained in:
Enrique García Cota
2021-11-12 10:48:57 +01:00
parent b611db6bfa
commit df482c613a
2 changed files with 10 additions and 4 deletions

View File

@@ -43,7 +43,12 @@ describe( 'inspect', function()
inspect('Here are some control characters: \0 \1 \6 \17 \27 \31'))
end)
it('escapes unnamed control characters with 3 digits when they are followed by numbers', function()
it('escapes DEL', function()
assert.equals('"DEL: \\127"',
inspect('DEL: \127'))
end)
it('escapes unnamed control characters with 4 digits when they are followed by numbers', function()
assert.equals('"Control chars followed by digits \\0001 \\0011 \\0061 \\0171 \\0271 \\0311"',
inspect('Control chars followed by digits \0001 \0011 \0061 \0171 \0271 \0311'))
end)