summaryrefslogtreecommitdiff
path: root/test_util/src
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2023-05-22 21:28:36 -0400
committerGitHub <noreply@github.com>2023-05-22 21:28:36 -0400
commitbb37dfb5b79c0e5ae18d34f01313cb1f39d7a2dd (patch)
treeeed3c2a5ed443933e6809b4c9541c75b651fb38f /test_util/src
parent58782589528dc442e2a1fdf6d98454cbf01ac2ad (diff)
feat(lsp): support lockfile and node_modules directory (#19203)
This adds support for the lockfile and node_modules directory to the lsp. In the case of the node_modules directory, it is only enabled when explicitly opted into via `"nodeModulesDir": true` in the configuration file. This is to reduce the language server automatically modifying the node_modules directory when the user doesn't want it to. Closes #16510 Closes #16373
Diffstat (limited to 'test_util/src')
-rw-r--r--test_util/src/assertions.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/test_util/src/assertions.rs b/test_util/src/assertions.rs
index a004530b6..29066ded0 100644
--- a/test_util/src/assertions.rs
+++ b/test_util/src/assertions.rs
@@ -1,6 +1,16 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
#[macro_export]
+macro_rules! assert_starts_with {
+ ($string:expr, $($test:expr),+) => {
+ let string = $string; // This might be a function call or something
+ if !($(string.starts_with($test))||+) {
+ panic!("{:?} does not start with {:?}", string, [$($test),+]);
+ }
+ }
+}
+
+#[macro_export]
macro_rules! assert_ends_with {
($left:expr, $right:expr $(,)?) => {
match (&$left, &$right) {