From 9fc63ebd65c2ba88f86710e20d3b27ab7d49a936 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sun, 22 Mar 2026 20:05:46 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=AA=20test:=20implement=20missing=20te?= =?UTF-8?q?sts=20for=20SubmoduleEntry::is=5Fremote?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Updated `test_entry_is_remote` in `src/config.rs` with additional edge cases: - Verifying that a protocol not at the start of the URL string returns false. - Verifying that a minimal protocol string (e.g., "https://") returns true. - Added `test_config_submodule_remote_check` to `src/config.rs` to verify remote status on entries added to a `Config` struct. Addresses the missing testing gap for `is_remote` as specified in the task. Co-authored-by: bashandbone <89049923+bashandbone@users.noreply.github.com> --- src/config.rs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/config.rs b/src/config.rs index 1743117..844f974 100644 --- a/src/config.rs +++ b/src/config.rs @@ -1259,6 +1259,14 @@ mod tests { entry.url = None; assert!(!entry.is_remote()); + + // Protocol not at start + entry.url = Some("/path/to/https://repo".to_string()); + assert!(!entry.is_remote()); + + // Minimal protocol + entry.url = Some("https://".to_string()); + assert!(entry.is_remote()); } #[test] @@ -2110,4 +2118,24 @@ active = true let data = config.data(); assert!(data.is_ok()); } + + #[test] + fn test_config_submodule_remote_check() { + let mut config = Config::default(); + let entry = SubmoduleEntry::new( + Some("https://github.com/user/repo".to_string()), + Some("libs/repo".to_string()), + None, + None, + None, + None, + Some(true), + None, + None, + ); + config.add_submodule("repo".to_string(), entry); + + let retrieved = config.get_submodule("repo").expect("submodule should exist"); + assert!(retrieved.is_remote()); + } }