interplane.Get Omega
Read in your language

synapse

A component of the AienOS ecosystem.

Brought by drakestapleton

branch main Branches Tags History

synapse / crates / synapse-crumb / tests / repo_root.rs

20 lines · 830 bytes Raw Blame History
1//! The repository's own root `.crumb` is RFC-0001 JSON (D1), so the reference `crumb.c`
2//! reads it too (ADR 0004 section 1.2: `crumb.c` cannot read the D3 dialect).
3
4use std::fs;
5use std::path::PathBuf;
6use synapse_crumb::{parse_crumb, Dialect, DirectoryCrumb};
7
8#[test]
9fn repository_root_crumb_is_rfc0001() {
10 let path = PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("../../.crumb");
11 let bytes = fs::read(&path).expect("repository root .crumb exists");
12 let crumb = parse_crumb(&bytes).expect("repository root .crumb parses");
13 assert_eq!(crumb.dialect(), Dialect::Rfc0001Json);
14 let DirectoryCrumb::Rfc0001(c) = crumb else {
15 panic!("repository root .crumb is not D1");
16 };
17 assert_eq!(c.name, "synapse");
18 assert_eq!(c.layer.as_deref(), Some("root"));
19 assert!(!c.purpose.is_empty());
20}