MCPcopy Create free account
hub / github.com/JamieMason/syncpack / copy_expected_specifier_unnamed_version_string

Function copy_expected_specifier_unnamed_version_string

src/disk_test.rs:951–965  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

949
950 #[test]
951 fn copy_expected_specifier_unnamed_version_string() {
952 let mut file = file_from_raw("{\"name\": \"pkg\", \"engines\": {\"node\": \">=16\"}}");
953 let dep_type = DependencyType {
954 name_path: None,
955 name: "node".to_string(),
956 path: "/engines/node".to_string(),
957 strategy: Strategy::UnnamedVersionString,
958 source: SourceKind::PackageJson,
959 is_catalog_definition: false,
960 };
961 let instance = make_instance("node", dep_type, ">=18");
962 copy_expected_specifier_json(&mut file, &instance);
963 assert!(file.dirty);
964 assert_eq!(file.contents.pointer("/engines/node"), Some(&json!(">=18")));
965 }
966
967 #[test]
968 fn parse_json_file_returns_none_for_invalid_json() {

Callers

nothing calls this directly

Calls 3

file_from_rawFunction · 0.85
make_instanceFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…