Skip to content

Commit 3b01bb5

Browse files
committed
test: update all tests and docs for v0.10.0-beta.1 lib
Signed-off-by: peefy <xpf6677@163.com>
1 parent 20a216a commit 3b01bb5

File tree

13 files changed

+17
-22
lines changed

13 files changed

+17
-22
lines changed

dotnet/KclLib.Tests/APITest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public void TestListVariablesAPI()
146146
var path = Path.Combine(parentDirectory, "test_data", "schema.k");
147147
args.Files.Add(path);
148148
var result = api.ListVariables(args);
149-
Assert.AreEqual("AppConfig {replicas = 2}", result.Variables["app"].Variables[0].Value, result.ToString());
149+
Assert.AreEqual("AppConfig {\n replicas = 2\n}", result.Variables["app"].Variables[0].Value, result.ToString());
150150
}
151151

152152
[TestMethod]

dotnet/KclLib.Tests/test_data/override_file/main.bak

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
a = 1
2-
32
b = {
43
"a": 1
54
"b": 2

dotnet/KclLib/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,6 @@ The content of `main.k` is
271271

272272
```python
273273
a = 1
274-
275274
b = {
276275
"a": 1
277276
"b": 2

java/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,6 @@ The content of `main.k` is
276276

277277
```python
278278
a = 1
279-
280279
b = {
281280
"a": 1
282281
"b": 2

java/src/test/java/com/kcl/ListVariablesTest.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,15 @@ public void testListVariables() throws Exception {
1919
// Define the variables to test and their expected results
2020
String[][] testCases = { { "a", "1", "", "=" }, { "a1", "2", "", "=" }, { "a3", "3m", "", "=" },
2121
{ "b1", "True", "", "=" }, { "b2", "False", "", "=" }, { "s1", "\"Hello\"", "", "=" },
22-
{ "array1", "[1, 2, 3]", "", "=" }, { "dict1", "{\"a\": 1, \"b\": 2}", "", "=" },
23-
{ "dict1.a", "1", "", ":" }, { "dict1.b", "2", "", ":" }, { "dict2.b.c", "2", "", ":" },
24-
{ "dict2.b.d", "3", "", ":" }, { "sha.name", "\"Hello\"", "", ":" },
25-
{ "sha.ids", "[1, 2, 3]", "", ":" }, { "sha.data.a.b", "{\"c\": 2}", "", ":" },
26-
{ "sha.data.a.b.c", "2", "", ":" }, { "shb.a.name", "\"HelloB\"", "", ":" },
27-
{ "shb.a.ids", "[4, 5, 6]", "", ":" }, { "shb.a.data.d.e", "{\"f\": 3}", "", ":" },
28-
{ "uconfa.name", "\"b\"", "", "=" }, { "c.a", "{name: \"Hello\"}", "", ":" },
29-
{ "c1", "C {}", "C", "=" }, { "c2", "a.b.C {}", "a.b.C", "=" } };
22+
{ "array1", "[\n 1\n 2\n 3\n]", "", "=" },
23+
{ "dict1", "{\n \"a\": 1\n \"b\": 2\n}", "", "=" }, { "dict1.a", "1", "", ":" },
24+
{ "dict1.b", "2", "", ":" }, { "dict2.b.c", "2", "", ":" }, { "dict2.b.d", "3", "", ":" },
25+
{ "sha.name", "\"Hello\"", "", ":" }, { "sha.ids", "[\n 1\n 2\n 3\n]", "", ":" },
26+
{ "sha.data.a.b", "{\n \"c\": 2\n}", "", ":" }, { "sha.data.a.b.c", "2", "", ":" },
27+
{ "shb.a.name", "\"HelloB\"", "", ":" }, { "shb.a.ids", "[\n 4\n 5\n 6\n]", "", ":" },
28+
{ "shb.a.data.d.e", "{\n \"f\": 3\n}", "", ":" }, { "uconfa.name", "\"b\"", "", "=" },
29+
{ "c.a", "{\n name: \"Hello\"\n}", "", ":" }, { "c1", "C {}", "C", "=" },
30+
{ "c2", "a.b.C {}", "a.b.C", "=" } };
3031

3132
for (String[] testCase : testCases) {
3233
String spec = testCase[0];

kotlin/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,6 @@ The content of `main.k` is
267267

268268
```python
269269
a = 1
270-
271270
b = {
272271
"a": 1
273272
"b": 2

kotlin/src/test/kotlin/com/kcl/ListVariablesTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ class ListVariablesTest {
1515
val args = listVariablesArgs { files += TEST_FILE }
1616
val api = API()
1717
val result = api.listVariables(args)
18-
assertEquals(result.variablesMap["app"]?.variablesList?.get(0)?.value, "AppConfig {replicas: 2}")
18+
assertEquals(result.variablesMap["app"]?.variablesList?.get(0)?.value, "AppConfig {\n replicas: 2\n}")
1919
}
2020
}

kotlin/src/test_data/override_file/main.k.bk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
a = 1
2-
32
b = {
43
"a": 1
54
"b": 2

nodejs/__test__/list_variables.spec.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ import { listVariables, ListVariablesArgs } from '../index.js'
44

55
test('listVariables', (t) => {
66
const result = listVariables(new ListVariablesArgs(['__test__/test_data/schema.k'], []))
7-
t.is(result.variables['app'][0].value, 'AppConfig {replicas: 2}')
7+
t.is(result.variables['app'][0].value, 'AppConfig {\n replicas: 2\n}')
88
})

python/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,6 @@ import kcl_lib.api as api
227227
args = api.ListVariables_Args(files=[TEST_FILE])
228228
api = api.API()
229229
result = api.list_variables(args)
230-
assert result.variables["app"].variables[0].value == "AppConfig {replicas: 2}"
231230
```
232231

233232
</p>
@@ -311,7 +310,6 @@ The content of `main.k` is
311310

312311
```python
313312
a = 1
314-
315313
b = {
316314
"a": 1
317315
"b": 2

0 commit comments

Comments
 (0)