Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit48dccd9

Browse files
committed
added complete tests
1 parentfd0d115 commit48dccd9

20 files changed

+8871
-935
lines changed

‎JSONML.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ private static Object parse(
163163
// attribute = value
164164

165165
attribute = (String)token;
166-
if (!arrayForm && (attribute =="tagName" ||attribute =="childNode")) {
166+
if (!arrayForm && (attribute.equals("tagName") ||attribute.equals("childNode"))) {
167167
throwx.syntaxError("Reserved attribute.");
168168
}
169169
token =x.nextToken();
@@ -462,4 +462,4 @@ public static String toString(JSONObject jo) throws JSONException {
462462
}
463463
returnsb.toString();
464464
}
465-
}
465+
}

‎JSONTokener.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ public char skipTo(char to) throws JSONException {
403403
intstartIndex =this.index;
404404
intstartCharacter =this.character;
405405
intstartLine =this.line;
406-
this.reader.mark(Integer.MAX_VALUE);
406+
this.reader.mark(1000000);
407407
do {
408408
c =this.next();
409409
if (c ==0) {
@@ -443,4 +443,4 @@ public String toString() {
443443
return" at " +this.index +" [character " +this.character +" line " +
444444
this.line +"]";
445445
}
446-
}
446+
}

‎Test.java

Lines changed: 0 additions & 931 deletions
This file was deleted.

‎tests/SampleResourceBundle_en_US.java

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
* File: SampleResourceBundle_en_US.java
3+
* Author: JSON.org
4+
*/
5+
packageorg.json.tests;
6+
7+
importjava.util.*;
8+
9+
/**
10+
* The Class SampleResourceBundle_en_US.
11+
*/
12+
publicclassSampleResourceBundle_en_USextendsListResourceBundle {
13+
14+
/* (non-Javadoc)
15+
* @see java.util.ListResourceBundle#getContents()
16+
*/
17+
@Override
18+
publicObject[][]getContents() {
19+
returncontents;
20+
}
21+
22+
/** The contents. */
23+
privateObject[][]contents = {
24+
{"ASCII","American Standard Code for Information Interchange" },
25+
{"JAVA.desc","Just Another Vague Acronym" },
26+
{"JAVA.data","Sweet language" },
27+
{"JSON","JavaScript Object Notation" },
28+
};
29+
}

‎tests/SampleResourceBundle_fr.java

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* File: SampleResourceBundle_fr.java
3+
* Author: JSON.org
4+
*/
5+
packageorg.json.tests;
6+
7+
importjava.util.*;
8+
9+
/**
10+
* The Class SampleResourceBundle_fr.
11+
*/
12+
publicclassSampleResourceBundle_frextendsListResourceBundle {
13+
14+
/* (non-Javadoc)
15+
* @see java.util.ListResourceBundle#getContents()
16+
*/
17+
@Override
18+
publicObject[][]getContents() {
19+
returncontents;
20+
}
21+
22+
/** The contents. */
23+
privateObject[][]contents = {
24+
{"ASCII","Number that represent chraracters" },
25+
{"JAVA","The language you are running to see this" },
26+
{"JSON","What are we testing?" },
27+
};
28+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp