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

Appearance settings

Commit 48dccd9

Browse filesBrowse files
committed
added complete tests
1 parent fd0d115 commit 48dccd9
Copy full SHA for 48dccd9
Expand file treeCollapse file tree

20 files changed

+8871
-935
lines changed
Open diff view settings
Collapse file

‎JSONML.java‎

Copy file name to clipboardExpand all lines: JSONML.java
+2-2Lines 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
throw x.syntaxError("Reserved attribute.");
168168
}
169169
token = x.nextToken();
@@ -462,4 +462,4 @@ public static String toString(JSONObject jo) throws JSONException {
462462
}
463463
return sb.toString();
464464
}
465-
}
465+
}
Collapse file

‎JSONTokener.java‎

Copy file name to clipboardExpand all lines: JSONTokener.java
+2-2Lines 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
int startIndex = this.index;
404404
int startCharacter = this.character;
405405
int startLine = 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+
}
Collapse file

‎Test.java‎

Copy file name to clipboardExpand all lines: Test.java
-931Lines changed: 0 additions & 931 deletions
This file was deleted.
Collapse file
+29Lines 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+
package org.json.tests;
6+
7+
import java.util.*;
8+
9+
/**
10+
* The Class SampleResourceBundle_en_US.
11+
*/
12+
public class SampleResourceBundle_en_US extends ListResourceBundle {
13+
14+
/* (non-Javadoc)
15+
* @see java.util.ListResourceBundle#getContents()
16+
*/
17+
@Override
18+
public Object[][] getContents() {
19+
return contents;
20+
}
21+
22+
/** The contents. */
23+
private Object[][] 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+
}
Collapse file

‎tests/SampleResourceBundle_fr.java‎

Copy file name to clipboard
+28Lines 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+
package org.json.tests;
6+
7+
import java.util.*;
8+
9+
/**
10+
* The Class SampleResourceBundle_fr.
11+
*/
12+
public class SampleResourceBundle_fr extends ListResourceBundle {
13+
14+
/* (non-Javadoc)
15+
* @see java.util.ListResourceBundle#getContents()
16+
*/
17+
@Override
18+
public Object[][] getContents() {
19+
return contents;
20+
}
21+
22+
/** The contents. */
23+
private Object[][] 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.