Wikipedia:Lua/Modul/JSONutil/Test

Wikipedia:Lua Modul JSONutil Test

Vorlagenprogrammierung Diskussionen Lua Test Unterseiten
Modul Deutsch English

Modul: Dokumentation

Test cases of Lua functions; version: 2020-11-08

fiat

Input Code (fault) String (trailing)
{ "simple": "assignment" } { "simple": "assignment" }
{ "beg": "\"escaped quote", "mid": "escaped\"quote", "end": "escaped quote\"" } { "beg": "\"escaped quote", "mid": "escaped\"quote", "end": "escaped quote\"" }
{ "multiline": "Some textLFin several linesLFalso withTabtabulator" } { "multiline": "Some text\nin several lines\nalso with\ttabulator" }
{ "lineseps": "UxLFstyle andCRApple and MSCRLFDOS" } { "lineseps": "Ux\nstyle and\nApple and MS\nDOS" }
{ "commented": true } // line at end { "commented": true }
{ "commented":// line amidLF true// second lineLF } { "commented": true }
{ "commented": /* middle */true } { "commented": true }
{ "commented":/* middle */"edge" } { "commented":"edge" }
{ "NoComment": "An URL http://example.org/ is not a comment" } { "NoComment": "An URL http://example.org/ is not a comment" }
No JSON Bracket0 No JSON
{ "simple": "assignment" } garbage Trailing garbage
{ "quoting": 'apostrophes' } Qoute 'apostrophes' }
{ "missing": "qoute } QouteEnd qoute }
{ "missing": "qoute (escaped)\" } QouteEnd qoute (escaped)\" }
{ "htab": "h�tab" } ControlChar tab" }
{ "comma": "trailing", } CommaEnd , }
{ "comma": [ "trailing", ] } CommaEnd , ] }
{ "comma": true, } CommaEnd : true, }
{ "unclosed": true BracketCloseLack }
{ "unclosed": "terminating" BracketCloseLack }
{ { "unclosed": 99 BracketCloseLack 2 }
{ "unclosed": [ 42 } BracketCloseLack ]
{ "unclosed": [ 42 ] ] } BracketClosePlus ]
{ "unclosed": [ 42 ] ] ] } BracketClosePlus 2 ]
{ "commented": /* middle true } CommentEnd middle true }

fault

Bracket0
Das erste sichtbare Zeichen muss { sein – Trailing1
BracketCloseLack
Schließende Klammer fehlt für: – Trailing2
BracketClosePlus
Zu viele schließende Klammern: – Trailing3
CommaEnd
Überflüssiges Komma nach letztem Listenelement – Trailing4
CommentEnd
Kommentar beginnt mit /* und wird nicht mit */ beendet – Trailing5
ControlChar
Steuerzeichen gefunden außer LF Tab CR (ASCII < 32) – Trailing6
Qoute
Apostroph statt Anführungszeichen gefunden – Trailing7
QouteEnd
Schließendes Anführungszeichen nicht gefunden – Trailing8
Trailing
Text nach dem Ende des JSON gefunden – Trailing9

fetch

Same cases as with #fiat.


{
"simple": "assignment"
}


{
"beg": "\"escaped quote",
"mid": "escaped\"quote",
"end": "escaped quote\""
}


{
"multiline": "Some text\nin several lines\nalso with\ttabulator"
}


{
"lineseps": "Ux\nstyle and\nApple and MS\nDOS"
}


{
"commented": true
}


{
"commented": true
}


{
"commented": true
}


{
"commented": "edge"
}


{
"NoComment": "An URL http://example.org/ is not a comment"
}


<span class="error">Das erste sichtbare Zeichen muss { sein &#8211; No JSON</span>


<span class="error">Text nach dem Ende des JSON gefunden &#8211; garbage</span>


<span class="error">Apostroph statt Anführungszeichen gefunden &#8211; &#039;apostrophes&#039; }</span>


<span class="error">Schließendes Anführungszeichen nicht gefunden &#8211; qoute }</span>


<span class="error">Schließendes Anführungszeichen nicht gefunden &#8211; qoute (escaped)\&quot; }</span>


<span class="error">Steuerzeichen gefunden außer LF Tab CR (ASCII < 32) &#8211; tab&quot; }</span>


<span class="error">Überflüssiges Komma nach letztem Listenelement &#8211; , }</span>


<span class="error">Überflüssiges Komma nach letztem Listenelement &#8211; , ] }</span>


<span class="error">Überflüssiges Komma nach letztem Listenelement &#8211; : true, }</span>


<span class="error">Schließende Klammer fehlt für: &#8211; }</span>


<span class="error">Schließende Klammer fehlt für: &#8211; }</span>


<span class="error">Schließende Klammer fehlt für: &#8211; 2 }</span>


<span class="error">Schließende Klammer fehlt für: &#8211; ]</span>


<span class="error">Zu viele schließende Klammern: &#8211; ]</span>


<span class="error">Zu viele schließende Klammern: &#8211; 2 ]</span>


<span class="error">Kommentar beginnt mit /* und wird nicht mit */ beendet &#8211; middle true }</span>

Content Disclaimer

Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.

  1. The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
  2. There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
  3. It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
  4. Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
  5. Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.