File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -110,8 +110,8 @@ function Convert-JsoncToJson {
110110
111111 # 移除行尾注释 (/*...*/)
112112 # TODO
113- $jsonContent = $jsonContent -replace ' (?m)/\*.*?\*/\s*$' , ' '
114- Write-Debug " 移除行尾注释后:$jsonContent "
113+ # $jsonContent = $jsonContent -replace '(?m)/\*.*?\*/\s*$', ''
114+ # Write-Debug "移除行尾注释后:$jsonContent"
115115
116116 # 移除多行注释 (/*...*/)
117117 $jsonContent = $jsonContent -replace ' (?s)/\*.*?\*/' , ' '
Original file line number Diff line number Diff line change @@ -44,6 +44,19 @@ Describe "Convert-JsoncToJson 函数测试" {
4444 $testJsonc | Out-File - FilePath $testJsoncPath - Encoding utf8
4545
4646 # 新增带$schema的测试用例
47+ # $testJsoncWithSchema = @"
48+ # {
49+ # "`$schema": "http://json-schema.org/draft-07/schema#",
50+ # // 带schema的配置
51+ # "name": "schema_test",
52+ # /**
53+ # * 测试多行需求**/
54+ # "config": {
55+ # "url": "http://example.com", // URL注释
56+ # "path": "some//path" // 包含//的字符串
57+ # }
58+ # }
59+ # "@
4760 $testJsoncWithSchema = @"
4861{
4962 "`$ schema": "http://json-schema.org/draft-07/schema#",
@@ -52,8 +65,8 @@ Describe "Convert-JsoncToJson 函数测试" {
5265 /**
5366 * 测试多行需求**/
5467 "config": {
55- "url": "http://example.com", // URL注释
56- "path": "some//path" // 包含//的字符串
68+ "url": "http://example.com",
69+ "path": "some//path"
5770 }
5871}
5972"@
You can’t perform that action at this time.
0 commit comments