aboutsummaryrefslogtreecommitdiff
path: root/crates/test_utils/src
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-06-15 10:02:53 +0100
committerGitHub <[email protected]>2020-06-15 10:02:53 +0100
commitdb6100dbaa4f09543c7e6f2ab9986daa55919ad5 (patch)
tree165cdcd914e8f201fb44e4ab7e5c04cf72994195 /crates/test_utils/src
parent672d160b013df82b1729fd3db130ff7b6f9b5b31 (diff)
parentb5c4f2faa2a39bad9af35e7d90e9ed6151a6a0d5 (diff)
Merge #4889
4889: Deprecate hir::Path::from_ast r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/test_utils/src')
-rw-r--r--crates/test_utils/src/lib.rs12
1 files changed, 5 insertions, 7 deletions
diff --git a/crates/test_utils/src/lib.rs b/crates/test_utils/src/lib.rs
index 2141bfc20..981565cd7 100644
--- a/crates/test_utils/src/lib.rs
+++ b/crates/test_utils/src/lib.rs
@@ -10,17 +10,17 @@
10pub mod mark; 10pub mod mark;
11 11
12use std::{ 12use std::{
13 fs, 13 env, fs,
14 path::{Path, PathBuf}, 14 path::{Path, PathBuf},
15}; 15};
16 16
17pub use ra_cfg::CfgOptions; 17use serde_json::Value;
18use stdx::split1; 18use stdx::split1;
19use text_size::{TextRange, TextSize};
19 20
21pub use ra_cfg::CfgOptions;
20pub use relative_path::{RelativePath, RelativePathBuf}; 22pub use relative_path::{RelativePath, RelativePathBuf};
21pub use rustc_hash::FxHashMap; 23pub use rustc_hash::FxHashMap;
22use serde_json::Value;
23use text_size::{TextRange, TextSize};
24 24
25pub use difference::Changeset as __Changeset; 25pub use difference::Changeset as __Changeset;
26 26
@@ -625,8 +625,6 @@ pub fn skip_slow_tests() -> bool {
625 should_skip 625 should_skip
626} 626}
627 627
628const REWRITE: bool = false;
629
630/// Asserts that `expected` and `actual` strings are equal. If they differ only 628/// Asserts that `expected` and `actual` strings are equal. If they differ only
631/// in trailing or leading whitespace the test won't fail and 629/// in trailing or leading whitespace the test won't fail and
632/// the contents of `actual` will be written to the file located at `path`. 630/// the contents of `actual` will be written to the file located at `path`.
@@ -642,7 +640,7 @@ fn assert_equal_text(expected: &str, actual: &str, path: &Path) {
642 fs::write(path, actual).unwrap(); 640 fs::write(path, actual).unwrap();
643 return; 641 return;
644 } 642 }
645 if REWRITE { 643 if env::var("UPDATE_EXPECTATIONS").is_ok() {
646 println!("rewriting {}", pretty_path.display()); 644 println!("rewriting {}", pretty_path.display());
647 fs::write(path, actual).unwrap(); 645 fs::write(path, actual).unwrap();
648 return; 646 return;