-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
markused: mark explicitly all used array and map methods with `-skip-…
- Loading branch information
Showing
9 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,6 +58,8 @@ jobs: | |
run: v -o v2 cmd/v && ./v2 -o v3 cmd/v && ./v3 -o v4 cmd/v | ||
- name: v self compilation with -skip-unused | ||
run: v -skip-unused -o v2 cmd/v && ./v2 -skip-unused -o v3 cmd/v && ./v3 -skip-unused -o v4 cmd/v | ||
- name: Test vlib modules with -skip-unused | ||
run: v -skip-unused test vlib/builtin/ vlib/math vlib/flag/ vlib/os/ vlib/strconv/ | ||
- name: v doctor | ||
run: v doctor | ||
- name: Verify `v test` works | ||
|
@@ -178,6 +180,8 @@ jobs: | |
- name: V self compilation with -parallel-cc | ||
run: | | ||
v -o v2 -parallel-cc cmd/v | ||
- name: Test vlib modules with -skip-unused | ||
run: v -skip-unused test vlib/builtin/ vlib/math vlib/flag/ vlib/os/ vlib/strconv/ | ||
- name: Build modules | ||
run: | | ||
v build-module vlib/os | ||
|
@@ -215,6 +219,8 @@ jobs: | |
# uses: coverallsapp/[email protected] | ||
# with: | ||
# github-token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Test vlib modules with -skip-unused | ||
run: v -skip-unused test vlib/builtin/ vlib/math vlib/flag/ vlib/os/ vlib/strconv/ | ||
|
||
clang: | ||
runs-on: ubuntu-20.04 | ||
|
@@ -277,6 +283,8 @@ jobs: | |
- name: Build examples with -autofree | ||
run: | | ||
v -autofree -experimental -o tetris examples/tetris/tetris.v | ||
- name: Test vlib modules with -skip-unused | ||
run: v -skip-unused test vlib/builtin/ vlib/math vlib/flag/ vlib/os/ vlib/strconv/ | ||
- name: Build modules | ||
run: | | ||
v build-module vlib/os | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[vlib/v/tests/skip_unused/string_array_methods.vv:11] aa: ['hi', '1', '5', '3'] | ||
[vlib/v/tests/skip_unused/string_array_methods.vv:12] bb: ['1', '3', '5', 'hi'] |
2 changes: 2 additions & 0 deletions
2
vlib/v/tests/skip_unused/string_array_methods.skip_unused.run.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[vlib/v/tests/skip_unused/string_array_methods.vv:11] aa: ['hi', '1', '5', '3'] | ||
[vlib/v/tests/skip_unused/string_array_methods.vv:12] bb: ['1', '3', '5', 'hi'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
aa := ['hi', '1', '5', '3'] | ||
bb := aa.sorted_with_compare(fn (a &string, b &string) int { | ||
if a < b { | ||
return -1 | ||
} | ||
if a > b { | ||
return 1 | ||
} | ||
return 0 | ||
}) | ||
dump(aa) | ||
dump(bb) |