Skip to content

Commit

Permalink
fix compile error && add gitignore
Browse files Browse the repository at this point in the history
  • Loading branch information
wenshao committed Apr 17, 2022
1 parent 7287f79 commit bae7900
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 31 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
*.tar.gz
*.rar

*.iml

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
/.idea/
Expand Down
9 changes: 9 additions & 0 deletions fastjson1_compatible/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,15 @@

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M6</version>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,80 +4,107 @@
import com.alibaba.fastjson.JSONException;
import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertThrows;

public class Issue3689 {

@Test(expected = JSONException.class)
@Test
public void test_without_type_0_meaningles_char() {
JSONArray.parseArray("dfdfdf");
assertThrows(com.alibaba.fastjson2.JSONException.class, () -> {
JSONArray.parseArray("dfdfdf");
});
}

@Test(expected = JSONException.class)
@Test
public void test_without_type_1_meaningles_char() {
JSONArray.parseArray("/dfdfdf");
assertThrows(com.alibaba.fastjson2.JSONException.class, () -> {
JSONArray.parseArray("/dfdfdf");
});
}

@Test(expected = JSONException.class)
@Test
public void test_without_type_2_meaningles_char() {
JSONArray.parseArray("//dfdfdf");
assertThrows(com.alibaba.fastjson2.JSONException.class, () -> {
JSONArray.parseArray("//dfdfdf");
});
}

@Test(expected = JSONException.class)
@Test
public void test_without_type_3_meaningles_char() {
JSONArray.parseArray("///dfdfdf");
assertThrows(com.alibaba.fastjson2.JSONException.class, () -> {
JSONArray.parseArray("///dfdfdf");
});
}

@Test(expected = JSONException.class)
@Test
public void test_without_type_4_meaningles_char() {
JSONArray.parseArray("////dfdfdf");
assertThrows(com.alibaba.fastjson2.JSONException.class, () -> {
JSONArray.parseArray("////dfdfdf");
});
}

@Test(expected = JSONException.class)
@Test
public void test_without_type_5_meaningles_char() {
JSONArray.parseArray("/////dfdfdf");
assertThrows(com.alibaba.fastjson2.JSONException.class, () -> {
JSONArray.parseArray("/////dfdfdf");
});
}

@Test(expected = JSONException.class)
@Test
public void test_without_type_6_meaningles_char() {
JSONArray.parseArray("//////dfdfdf");
assertThrows(com.alibaba.fastjson2.JSONException.class, () -> {
JSONArray.parseArray("//////dfdfdf");
});
}

@Test(expected = JSONException.class)
@Test
public void test_with_type_0_meaningles_char() {
JSONArray.parseArray("dfdfdf", String.class);
assertThrows(com.alibaba.fastjson.JSONException.class, () -> {
JSONArray.parseArray("dfdfdf", String.class);
});
}

@Test(expected = JSONException.class)
@Test
public void test_with_type_1_meaningles_char() {
JSONArray.parseArray("/dfdfdf", String.class);
assertThrows(com.alibaba.fastjson.JSONException.class, () -> {
JSONArray.parseArray("/dfdfdf", String.class);
});
}

@Test(expected = JSONException.class)
@Test
public void test_with_type_2_meaningles_char() {
JSONArray.parseArray("//dfdfdf", String.class);
assertThrows(com.alibaba.fastjson.JSONException.class, () -> {
JSONArray.parseArray("//dfdfdf", String.class);
});

}

@Test(expected = JSONException.class)
@Test
public void test_with_type_3_meaningles_char() {
JSONArray.parseArray("///dfdfdf", String.class);

assertThrows(com.alibaba.fastjson.JSONException.class, () -> {
JSONArray.parseArray("///dfdfdf", String.class);
});
}

@Test(expected = JSONException.class)
@Test
public void test_with_type_4_meaningles_char() {
JSONArray.parseArray("////dfdfdf", String.class);

assertThrows(com.alibaba.fastjson.JSONException.class, () -> {
JSONArray.parseArray("////dfdfdf", String.class);
});
}

@Test(expected = JSONException.class)
@Test
public void test_with_type_5_meaningles_char() {
JSONArray.parseArray("/////dfdfdf", String.class);

assertThrows(com.alibaba.fastjson.JSONException.class, () -> {
JSONArray.parseArray("/////dfdfdf", String.class);
});
}

@Test(expected = JSONException.class)
@Test
public void test_with_type_6_meaningles_char() {
JSONArray.parseArray("//////dfdfdf", String.class);
assertThrows(JSONException.class, () -> {
JSONArray.parseArray("//////dfdfdf", String.class);
});
}

@Test
Expand Down

0 comments on commit bae7900

Please sign in to comment.