-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[guess-root] add tests to document the behavior of preexisting commands.
Summary: This test documents how some commands use invalid roots as the starting place for searching for a valid root while others just reject the invalid root. It also provides a usage of the type-at-pos command where the optional file argument has been elided. Reviewed By: mvitousek Differential Revision: D15582376 fbshipit-source-id: 5851d038684e35d87f9729da29b38e91af12ed9e
- Loading branch information
1 parent
e9c2e9e
commit a05cbb2
Showing
7 changed files
with
83 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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
shell: test.sh | ||
auto_start: false |
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,11 @@ | ||
[ignore] | ||
|
||
[include] | ||
|
||
[libs] | ||
|
||
[lints] | ||
|
||
[options] | ||
|
||
[strict] |
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,5 @@ | ||
// @flow | ||
|
||
let y = 0; | ||
function f(x = y) {} | ||
function g({x = y}) {} |
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,5 @@ | ||
// @flow | ||
|
||
let y = 0; | ||
function f(x = y) {} | ||
function g({x = y}) {} |
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,30 @@ | ||
nothing | ||
with file | ||
with file and config | ||
number | ||
no-config/d2.js:3:5,3:5 | ||
with bad root directory | ||
number | ||
-:3:5,3:5 | ||
with bad root directory, and file | ||
number | ||
no-config/d2.js:3:5,3:5 | ||
with bad root directory, and file | ||
number | ||
no-config/d2.js:3:5,3:5 | ||
with file batch coverage | ||
|
||
Coverage results from 1 file(s): | ||
|
||
no-config/d2.js: 88.89% (8 of 9 expressions) | ||
|
||
----------------------------------- | ||
Aggregate coverage statistics | ||
----------------------------------- | ||
Files : 1 | ||
Expressions : | ||
Covered : 8 | ||
Total : 9 | ||
Covered Percentage : 88.89% | ||
|
||
with bad root directory, and file batch coverage |
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,5 @@ | ||
// @flow | ||
|
||
let y = 0; | ||
function f(x = y) {} | ||
function g({x = y}) {} |
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,25 @@ | ||
#!/bin/bash | ||
|
||
echo "nothing" | ||
assert_exit "$EXIT_COULD_NOT_FIND_FLOWCONFIG" "$FLOW" type-at-pos 3 5 < d0.js | ||
|
||
echo "with file" | ||
assert_exit "$EXIT_COULD_NOT_FIND_FLOWCONFIG" "$FLOW" type-at-pos no-config/d1.js 3 5 | ||
|
||
echo "with file and config" | ||
assert_ok "$FLOW" type-at-pos --strip-root config/no-config/d2.js 3 5 | ||
|
||
echo "with bad root directory" | ||
assert_ok "$FLOW" type-at-pos --root ./config/no-config 3 5 < ./config/no-config/d2.js | ||
|
||
echo "with bad root directory, and file" | ||
assert_ok "$FLOW" type-at-pos --strip-root --root ./config/no-config ./config/no-config/d2.js 3 5 | ||
|
||
echo "with bad root directory, and file" | ||
assert_ok "$FLOW" type-at-pos --strip-root --root ./config/no-config ./config/no-config/d2.js 3 5 | ||
|
||
echo "with file batch coverage" | ||
assert_ok "$FLOW" batch-coverage --strip-root ./config/no-config/d2.js | ||
|
||
echo "with bad root directory, and file batch coverage" | ||
assert_exit "$EXIT_COULD_NOT_FIND_FLOWCONFIG" "$FLOW" batch-coverage --root ./config/no-config ./config/no-config/d2.js |