Skip to content

Commit d6b736c

Browse files
ndmitchellfacebook-github-bot
authored andcommitted
Add another incremental test case
Summary: I was trying to find a bug in invalidate_rdeps using this code. I failed. Way too subtle for me. But might as well keep the test. Reviewed By: kinto0 Differential Revision: D79358374 fbshipit-source-id: 9c92fc5f719e6c8a51d078d0e375e9130a09b885
1 parent d1af10d commit d6b736c

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

pyrefly/lib/test/incremental.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,3 +481,22 @@ fn test_incremental_rdeps() {
481481

482482
i.check(&["foo", "bar"], &[]); // Nothing appears dirty
483483
}
484+
485+
#[test]
486+
fn test_incremental_rdeps_with_new() {
487+
// Make sure we hit the rdeps case
488+
let mut i = Incremental::new();
489+
i.require = Some(Require::Everything); // So we don't invalidate based on require
490+
i.set("foo", "import bar\nclass C: pass\nx = bar.z");
491+
i.set("bar", "import foo\nz = foo.C\nq: type[foo.C] = foo.x");
492+
i.check(&["foo"], &["foo", "bar"]);
493+
494+
i.set(
495+
"foo",
496+
"import bar\nimport baz\nclass Q: pass\nx = bar.z\nclass C: pass",
497+
);
498+
i.set("baz", "import bar");
499+
i.unchecked(&["foo"]);
500+
501+
i.check(&["foo", "bar", "baz"], &[]); // Nothing appears dirty
502+
}

0 commit comments

Comments
 (0)