Skip to content

Commit

Permalink
add and update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lijunchen committed Sep 26, 2024
1 parent 976dd3b commit b8a04c5
Show file tree
Hide file tree
Showing 17 changed files with 80 additions and 0 deletions.
1 change: 1 addition & 0 deletions crates/moon/tests/cmd_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ fn cmd_test() {
expect_test::expect![[r#"
[
${WORK_DIR}/cond_comp.in/moon.test, ok,
${WORK_DIR}/fuzzy_matching/moon.test, ok,
${WORK_DIR}/moon_build_package.in/moon.test, ok,
${WORK_DIR}/moon_info_001.in/moon.test, ok,
${WORK_DIR}/moon_info_002.in/moon.test, ok,
Expand Down
2 changes: 2 additions & 0 deletions crates/moon/tests/test_cases/fuzzy_matching/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
target/
.mooncakes/
1 change: 1 addition & 0 deletions crates/moon/tests/test_cases/fuzzy_matching/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# username/hello
10 changes: 10 additions & 0 deletions crates/moon/tests/test_cases/fuzzy_matching/moon.mod.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "username/hello",
"version": "0.1.0",
"readme": "README.md",
"repository": "",
"license": "",
"keywords": [],
"description": "",
"source": "src"
}
36 changes: 36 additions & 0 deletions crates/moon/tests/test_cases/fuzzy_matching/moon.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
$ moon test -p username/hello/x --sort-input --no-parallelize
x blackbox test
x inline test
x whitebox test
Total tests: 3, passed: 3, failed: 0.

$ moon test -p x --sort-input --no-parallelize
x blackbox test
x inline test
x whitebox test
x_y blackbox test
x_y inline test
x_y whitebox test
Total tests: 6, passed: 6, failed: 0.

$ moon test -p x/y --sort-input --no-parallelize
x_y blackbox test
x_y inline test
x_y whitebox test
Total tests: 3, passed: 3, failed: 0.

$ moon test -p u/h/x/y --sort-input --no-parallelize
x_y blackbox test
x_y inline test
x_y whitebox test
Total tests: 3, passed: 3, failed: 0.

$ moon test -p y --sort-input --no-parallelize
x_y blackbox test
x_y inline test
x_y whitebox test
y blackbox test
y inline test
y whitebox test
Total tests: 6, passed: 6, failed: 0.

3 changes: 3 additions & 0 deletions crates/moon/tests/test_cases/fuzzy_matching/src/x/lib.mbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
test {
println("x inline test")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
3 changes: 3 additions & 0 deletions crates/moon/tests/test_cases/fuzzy_matching/src/x/x_test.mbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
test {
println("x blackbox test")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
test {
println("x whitebox test")
}
3 changes: 3 additions & 0 deletions crates/moon/tests/test_cases/fuzzy_matching/src/x/y/lib.mbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
test {
println("x_y inline test")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
test {
println("x_y blackbox test")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
test {
println("x_y whitebox test")
}
3 changes: 3 additions & 0 deletions crates/moon/tests/test_cases/fuzzy_matching/src/y/lib.mbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
test {
println("y inline test")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
3 changes: 3 additions & 0 deletions crates/moon/tests/test_cases/fuzzy_matching/src/y/y_test.mbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
test {
println("y blackbox test")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
test {
println("y whitebox test")
}

0 comments on commit b8a04c5

Please sign in to comment.