MCPcopy Create free account
hub / github.com/ciphermodelabs/ciphercore / test_malformed

Function test_malformed

ciphercore-base/src/ops/multiplexer.rs:182–275  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

180
181 #[test]
182 fn test_malformed() {
183 || -> Result<()> {
184 let c = create_context()?;
185 let g = c.create_graph()?;
186 let i_flag = g.input(Type::Array(vec![3, 1], BIT))?;
187 let i_choice1 = g.input(Type::Array(vec![1, 5, 1], UINT32))?;
188 let i_choice0 = g.input(Type::Array(vec![6, 1, 1], INT32))?;
189 assert!(g
190 .custom_op(
191 CustomOperation::new(Mux {}),
192 vec![i_flag, i_choice1, i_choice0]
193 )
194 .is_err());
195 Ok(())
196 }()
197 .unwrap();
198
199 || -> Result<()> {
200 let c = create_context()?;
201 let g = c.create_graph()?;
202 let i_flag = g.input(Type::Array(vec![3, 1], INT32))?;
203 let i_choice1 = g.input(Type::Array(vec![1, 5], BIT))?;
204 let i_choice0 = g.input(Type::Array(vec![6, 1, 1], BIT))?;
205 assert!(g
206 .custom_op(
207 CustomOperation::new(Mux {}),
208 vec![i_flag, i_choice1, i_choice0]
209 )
210 .is_err());
211 Ok(())
212 }()
213 .unwrap();
214
215 || -> Result<()> {
216 let c = create_context()?;
217 let g = c.create_graph()?;
218 let i_flag = g.input(Type::Array(vec![3, 7], BIT))?;
219 let i_choice1 = g.input(Type::Array(vec![1, 5], BIT))?;
220 let i_choice0 = g.input(Type::Array(vec![6, 1, 1], BIT))?;
221 assert!(g
222 .custom_op(
223 CustomOperation::new(Mux {}),
224 vec![i_flag, i_choice1, i_choice0]
225 )
226 .is_err());
227 Ok(())
228 }()
229 .unwrap();
230
231 || -> Result<()> {
232 let c = create_context()?;
233 let g = c.create_graph()?;
234 let i_flag = g.input(Type::Array(vec![3, 7], BIT))?;
235 let i_choice1 = g.input(Type::Array(vec![1, 5], BIT))?;
236 let _i_choice0 = g.input(Type::Array(vec![6, 1, 1], BIT))?;
237 assert!(g
238 .custom_op(CustomOperation::new(Mux {}), vec![i_flag, i_choice1])
239 .is_err());

Callers

nothing calls this directly

Calls 3

create_contextFunction · 0.50
create_graphMethod · 0.45
inputMethod · 0.45

Tested by

no test coverage detected