MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / validate

Method validate

atomic-repository/examples/materialize_bench.rs:92–119  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

90 }
91
92 fn validate(&self) -> Result<()> {
93 ensure!(
94 self.files > 0 && self.lines >= 2 && self.iterations > 0,
95 "files and iterations must be positive; lines must be at least two"
96 );
97 ensure!(
98 self.files <= 1024 && self.lines <= 100_000 && self.edits <= 10_000,
99 "fixture exceeds benchmark safety bounds"
100 );
101 ensure!(
102 self.iterations <= 1000
103 && self.warmups <= 1000
104 && self
105 .files
106 .checked_mul(self.lines)
107 .is_some_and(|n| n <= 2_000_000),
108 "sample count or total fixture lines exceed safety bounds"
109 );
110 ensure!(
111 !cfg!(debug_assertions) || self.allow_debug,
112 "use a --release build (or --allow-debug for correctness smoke tests only)"
113 );
114 ensure!(
115 !self.output.exists(),
116 "refusing to overwrite an existing output report"
117 );
118 Ok(())
119 }
120}
121
122#[derive(Clone)]

Callers 2

parseMethod · 0.45
runFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected