Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

test(scripts): cover chained crate and prefix alias resolution

Steven Enamakelc3812f22fb01
diff --git a/scripts/__tests__/check-test-ownership.test.mjs b/scripts/__tests__/check-test-ownership.test.mjs
index 85717b2b0f..65ce9381ad 100644
--- a/scripts/__tests__/check-test-ownership.test.mjs
+++ b/scripts/__tests__/check-test-ownership.test.mjs
@@ -96,6 +96,27 @@ test('rejects direct calls through an alias of a grouped implementation prefix',
]);
});
+test('resolves chained crate and implementation-prefix aliases', () => {
+ const source = [
+ 'use tinychannels as tc;',
+ 'use tc::providers as p;',
+ 'p::email_channel::parse("message");',
+ ].join('\n');
+
+ assert.deepEqual(findOwnershipViolations(source, 'tests/email.rs'), [
+ {
+ line: 2,
+ path: 'tinychannels::providers::',
+ reason: 'TinyChannels provider behavior belongs in TinyChannels.',
+ },
+ {
+ line: 3,
+ path: 'tinychannels::providers::',
+ reason: 'TinyChannels provider behavior belongs in TinyChannels.',
+ },
+ ]);
+});
+
test('expands nested grouped imports of TinyChannels provider internals', () => {
const source = `
use tinychannels::{providers::{email_channel::parse}};