Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[refactor]: replace verbose completion tests with snapshot-based macro invocations #1780

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,401 changes: 339 additions & 1,062 deletions kclvm/tools/src/LSP/src/completion.rs

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
source: tools/src/LSP/src/completion.rs
assertion_line: 1233
expression: "format! (\"{:?}\", got_labels)"
---
[" True"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
source: tools/src/LSP/src/completion.rs
assertion_line: 1241
expression: "format! (\"{:?}\", got_labels)"
---
[" {}"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
source: tools/src/LSP/src/completion.rs
assertion_line: 1225
expression: "format! (\"{:?}\", got_labels)"
---
[" 1"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
source: tools/src/LSP/src/completion.rs
assertion_line: 1217
expression: "format! (\"{:?}\", got_labels)"
---
[" []"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
source: tools/src/LSP/src/completion.rs
assertion_line: 1249
expression: "format! (\"{:?}\", got_labels)"
---
[" sub.Person1{}"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
source: tools/src/LSP/src/completion.rs
assertion_line: 1209
expression: "format! (\"{:?}\", got_labels)"
---
[" \"abc\"", " \"def\""]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
source: tools/src/LSP/src/completion.rs
assertion_line: 1201
expression: "format! (\"{:?}\", got_labels)"
---
[" False", " True"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
source: tools/src/LSP/src/completion.rs
assertion_line: 1185
expression: "format! (\"{:?}\", got_labels)"
---
["age", "name"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
source: tools/src/LSP/src/completion.rs
assertion_line: 1353
expression: "format! (\"{:?}\", got_labels)"
---
["Person", "Person{}", "name"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
source: tools/src/LSP/src/completion.rs
assertion_line: 1329
expression: "format! (\"{:?}\", got_labels)"
---
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
source: tools/src/LSP/src/completion.rs
assertion_line: 1105
expression: "format! (\"{:?}\", got_labels)"
---
["age", "name"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
source: tools/src/LSP/src/completion.rs
assertion_line: 1113
expression: "format! (\"{:?}\", got_labels)"
---
["capitalize(…)", "count(…)", "endswith(…)", "find(…)", "format(…)", "index(…)", "isalnum(…)", "isalpha(…)", "isdigit(…)", "islower(…)", "isspace(…)", "istitle(…)", "isupper(…)", "join(…)", "lower(…)", "lstrip(…)", "removeprefix(…)", "removesuffix(…)", "replace(…)", "rfind(…)", "rindex(…)", "rsplit(…)", "rstrip(…)", "split(…)", "splitlines(…)", "startswith(…)", "strip(…)", "title(…)", "upper(…)"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
source: tools/src/LSP/src/completion.rs
assertion_line: 1193
expression: "format! (\"{:?}\", got_labels)"
---
["base64", "collection", "crypto", "datetime", "file", "json", "manifests", "math", "net", "regex", "runtime", "template", "units", "yaml"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
source: tools/src/LSP/src/completion.rs
assertion_line: 1121
expression: "format! (\"{:?}\", got_labels)"
---
["file1", "file2", "subpkg"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
source: tools/src/LSP/src/completion.rs
assertion_line: 1129
expression: "format! (\"{:?}\", got_labels)"
---
["Person1"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
source: tools/src/LSP/src/completion.rs
assertion_line: 1361
expression: "format! (\"{:?}\", got_labels)"
---
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
source: tools/src/LSP/src/completion.rs
assertion_line: 1369
expression: "format! (\"{:?}\", got_labels)"
---
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
source: tools/src/LSP/src/completion.rs
assertion_line: 1145
expression: "format! (\"{:?}\", got_labels)"
---
["capitalize(…)", "count(…)", "endswith(…)", "find(…)", "format(…)", "index(…)", "isalnum(…)", "isalpha(…)", "isdigit(…)", "islower(…)", "isspace(…)", "istitle(…)", "isupper(…)", "join(…)", "lower(…)", "lstrip(…)", "removeprefix(…)", "removesuffix(…)", "replace(…)", "rfind(…)", "rindex(…)", "rsplit(…)", "rstrip(…)", "split(…)", "splitlines(…)", "startswith(…)", "strip(…)", "title(…)", "upper(…)"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
source: tools/src/LSP/src/completion.rs
assertion_line: 1137
expression: "format! (\"{:?}\", got_labels)"
---
["ceil(…)", "exp(…)", "expm1(…)", "factorial(…)", "floor(…)", "gcd(…)", "isfinite(…)", "isinf(…)", "isnan(…)", "log(…)", "log10(…)", "log1p(…)", "log2(…)", "modf(…)", "pow(…)", "sqrt(…)"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
source: tools/src/LSP/src/completion.rs
assertion_line: 1337
expression: "format! (\"{:?}\", got_labels)"
---
["cpu", "memory"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
source: tools/src/LSP/src/completion.rs
assertion_line: 1097
expression: "format! (\"{:?}\", got_labels)"
---
["", "age", "math", "name", "subpkg"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
source: tools/src/LSP/src/completion.rs
assertion_line: 1265
expression: "format! (\"{:?}\", got_labels)"
---
["\n\nAttributes\n----------\nname: \nworkloadType: \nreplica: \n\nExamples\n--------\n"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
source: tools/src/LSP/src/completion.rs
assertion_line: 1321
expression: "format! (\"{:?}\", got_labels)"
---
["Params", "Params{}", "max", "min"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
source: tools/src/LSP/src/completion.rs
assertion_line: 1257
expression: "format! (\"{:?}\", got_labels)"
---
["Base", "Base{}", "Config", "Config{}", "Name", "Name{}", "Person", "Person(b){}", "abs(…)", "all_true(…)", "any_true(…)", "bin(…)", "bool(…)", "dict(…)", "float(…)", "hex(…)", "int(…)", "isnullish(…)", "isunique(…)", "len(…)", "list(…)", "max(…)", "min(…)", "multiplyof(…)", "n", "oct(…)", "option(…)", "ord(…)", "p", "pow(…)", "print(…)", "range(…)", "round(…)", "sorted(…)", "str(…)", "sum(…)", "typeof(…)", "zip(…)"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
source: tools/src/LSP/src/completion.rs
assertion_line: 1313
expression: "format! (\"{:?}\", got_labels)"
---
["name"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
source: tools/src/LSP/src/completion.rs
assertion_line: 1377
expression: "format! (\"{:?}\", got_labels)"
---
["name"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
source: tools/src/LSP/src/completion.rs
assertion_line: 1385
expression: "format! (\"{:?}\", got_labels)"
---
["name"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
source: tools/src/LSP/src/completion.rs
assertion_line: 1153
expression: "format! (\"{:?}\", got_labels)"
---
["a"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
source: tools/src/LSP/src/completion.rs
assertion_line: 1273
expression: "format! (\"{:?}\", got_labels)"
---
["capitalize(…)", "count(…)", "endswith(…)", "find(…)", "format(…)", "index(…)", "isalnum(…)", "isalpha(…)", "isdigit(…)", "islower(…)", "isspace(…)", "istitle(…)", "isupper(…)", "join(…)", "lower(…)", "lstrip(…)", "removeprefix(…)", "removesuffix(…)", "replace(…)", "rfind(…)", "rindex(…)", "rsplit(…)", "rstrip(…)", "split(…)", "splitlines(…)", "startswith(…)", "strip(…)", "title(…)", "upper(…)"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
source: tools/src/LSP/src/completion.rs
assertion_line: 1289
expression: "format! (\"{:?}\", got_labels)"
---
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
source: tools/src/LSP/src/completion.rs
assertion_line: 1297
expression: "format! (\"{:?}\", got_labels)"
---
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
source: tools/src/LSP/src/completion.rs
assertion_line: 1281
expression: "format! (\"{:?}\", got_labels)"
---
["capitalize(…)", "count(…)", "endswith(…)", "find(…)", "format(…)", "index(…)", "isalnum(…)", "isalpha(…)", "isdigit(…)", "islower(…)", "isspace(…)", "istitle(…)", "isupper(…)", "join(…)", "lower(…)", "lstrip(…)", "removeprefix(…)", "removesuffix(…)", "replace(…)", "rfind(…)", "rindex(…)", "rsplit(…)", "rstrip(…)", "split(…)", "splitlines(…)", "startswith(…)", "strip(…)", "title(…)", "upper(…)"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
source: tools/src/LSP/src/completion.rs
assertion_line: 1305
expression: "format! (\"{:?}\", got_labels)"
---
["capitalize(…)", "count(…)", "endswith(…)", "find(…)", "format(…)", "index(…)", "isalnum(…)", "isalpha(…)", "isdigit(…)", "islower(…)", "isspace(…)", "istitle(…)", "isupper(…)", "join(…)", "lower(…)", "lstrip(…)", "removeprefix(…)", "removesuffix(…)", "replace(…)", "rfind(…)", "rindex(…)", "rsplit(…)", "rstrip(…)", "split(…)", "splitlines(…)", "startswith(…)", "strip(…)", "title(…)", "upper(…)"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
source: tools/src/LSP/src/completion.rs
assertion_line: 1161
expression: "format! (\"{:?}\", got_labels)"
---
["capitalize(…)", "count(…)", "endswith(…)", "find(…)", "format(…)", "index(…)", "isalnum(…)", "isalpha(…)", "isdigit(…)", "islower(…)", "isspace(…)", "istitle(…)", "isupper(…)", "join(…)", "lower(…)", "lstrip(…)", "removeprefix(…)", "removesuffix(…)", "replace(…)", "rfind(…)", "rindex(…)", "rsplit(…)", "rstrip(…)", "split(…)", "splitlines(…)", "startswith(…)", "strip(…)", "title(…)", "upper(…)"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
source: tools/src/LSP/src/completion.rs
assertion_line: 1177
expression: "format! (\"{:?}\", got_labels)"
---
["capitalize(…)", "count(…)", "endswith(…)", "find(…)", "format(…)", "index(…)", "isalnum(…)", "isalpha(…)", "isdigit(…)", "islower(…)", "isspace(…)", "istitle(…)", "isupper(…)", "join(…)", "lower(…)", "lstrip(…)", "removeprefix(…)", "removesuffix(…)", "replace(…)", "rfind(…)", "rindex(…)", "rsplit(…)", "rstrip(…)", "split(…)", "splitlines(…)", "startswith(…)", "strip(…)", "title(…)", "upper(…)"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
source: tools/src/LSP/src/completion.rs
assertion_line: 1089
expression: "format! (\"{:?}\", got_labels)"
---
["", "Config", "Config{}", "P", "Person", "Person1{}", "Person{}", "P{}", "aaaa", "math", "n", "p", "p1", "p2", "p3", "p4", "subpkg"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
source: tools/src/LSP/src/completion.rs
assertion_line: 1169
expression: "format! (\"{:?}\", got_labels)"
---
["Config", "Config{}", "P", "Person", "Person1{}", "Person{}", "P{}", "aaaa", "math", "n", "p", "p1", "p2", "p3", "p4", "pkg", "subpkg"]
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@

[dependencies]
k8s = { oci = "oci://ghcr.io/kcl-lang/k8s", tag = "1.28" }

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[package]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[package]
1 change: 1 addition & 0 deletions kclvm/tools/src/LSP/src/test_data/goto_def_test/kcl.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[package]
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@
name = "dep-with-line"
full_name = "dep-with-line_0.0.1"
version = "0.0.1"
sum = "O2Z1djaB1lC38kNfhwUUYAlqGKE7seUqqys3DPcJfEw="
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@ version = "0.0.4"

[dependencies]
konfig = { git = "https://github.com/awesome-kusion/konfig.git", tag = "v0.0.1" }

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
[dependencies.konfig]
name = "konfig"
full_name = "_"
sum = "XFvHdBAoY/+qpJWmj8cjwOwZO8a3nX/7SE35cTxQOFU="
url = "https://github.com/awesome-kusion/konfig.git"
git_tag = "v0.0.1"
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ name = "pkg_mod"
pkg_mod_test = { path = "../../pkg_mod_test" }

[profile]
entries = ["../base/base.k", "main.k", "${pkg_mod_test:KCL_MOD}/pkg1/a.k"]
entries = ["../base/base.k", "main.k", "${pkg_mod_test:KCL_MOD}/pkg1/a.k"]
Loading