Skip to content

Commit

Permalink
add testcase for issue #956
Browse files Browse the repository at this point in the history
  • Loading branch information
wenshao committed Nov 30, 2022
1 parent 08668a7 commit 5f9a6ea
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions core/src/test/java/com/alibaba/fastjson2/issues/Issue956.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.alibaba.fastjson2.issues;

import com.alibaba.fastjson2.JSONObject;
import com.alibaba.fastjson2.JSONPath;
import org.junit.jupiter.api.Test;

import java.util.LinkedHashMap;
import java.util.Map;

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

public class Issue956 {
@Test
public void test() {
Map data = new LinkedHashMap<>();
JSONPath.set(data, "$.obj['5']", "璁剧疆鎴愬姛");
assertEquals("{\"obj\":{\"5\":\"璁剧疆鎴愬姛\"}}", JSONObject.toJSONString(data));
}
}

0 comments on commit 5f9a6ea

Please sign in to comment.