MCPcopy Index your code
hub / github.com/ciphermodelabs/ciphercore / test_simple

Function test_simple

ciphercore-base/src/optimizer/optimize.rs:99–118  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

97
98 #[test]
99 fn test_simple() {
100 || -> Result<()> {
101 let c = simple_context(|g| {
102 let i1 = g.input(scalar_type(UINT64))?;
103 let i2 = g.input(scalar_type(UINT64))?;
104 let n = i1.add(i2)?;
105 n.add(g.constant(scalar_type(UINT64), Value::from_scalar(1, UINT64)?)?)
106 })?;
107
108 let optimized_c = optimize_context(c.clone(), SimpleEvaluator::new(None)?)?;
109 stress_test(
110 c,
111 optimized_c,
112 SimpleEvaluator::new(None).unwrap(),
113 SimpleEvaluator::new(None).unwrap(),
114 )?;
115 Ok(())
116 }()
117 .unwrap();
118 }
119}

Callers

nothing calls this directly

Calls 8

simple_contextFunction · 0.85
stress_testFunction · 0.85
cloneMethod · 0.80
optimize_contextFunction · 0.70
scalar_typeFunction · 0.50
inputMethod · 0.45
addMethod · 0.45
constantMethod · 0.45

Tested by

no test coverage detected