Skip to content
Merged
17 changes: 17 additions & 0 deletions pkgs/dev/src/corpus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,23 @@ impl Corpus {
Self::parse(name, &text)
}

/// Returns a sub-corpus rooted at `key`, for files that nest their
/// sections under an outer key such as the scheme name.
///
/// # Panics
///
/// Panics if the key is absent from the current root.
pub fn scope(&self, key: &str) -> Self {
let val = self
.root
.get(key)
.unwrap_or_else(|| panic!("{}: missing key '{key}'", self.name));
Self {
name: format!("{}/{key}", self.name),
root: val.clone(),
}
}

/// Returns a named array section as typed vectors: `{ section: [T, ...] }`.
///
/// # Panics
Expand Down
284 changes: 257 additions & 27 deletions pkgs/pkc/corpus/bls_aggregate.json5

Large diffs are not rendered by default.

114 changes: 0 additions & 114 deletions pkgs/pkc/corpus/bls_chia_aggregate.json5

This file was deleted.

14 changes: 0 additions & 14 deletions pkgs/pkc/corpus/bls_chia_dh.json5

This file was deleted.

24 changes: 0 additions & 24 deletions pkgs/pkc/corpus/bls_chia_keygen.json5

This file was deleted.

Loading
Loading