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

Function test_node_graph_helpers

ciphercore-base/src/graphs.rs:5693–5712  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5691
5692 #[test]
5693 fn test_node_graph_helpers() {
5694 let pairs_of_contexts = generate_pair_of_equal_contexts();
5695 for (context1, context2) in pairs_of_contexts {
5696 assert!(contexts_deep_equal(context1, context2));
5697 }
5698 || -> Result<()> {
5699 let context = create_context()?;
5700 let g = context.create_graph()?.set_name("graph name")?;
5701 let i = g.input(scalar_type(BIT))?.set_name("node name")?;
5702 assert_eq!(g.get_name()?, "graph name");
5703 assert!(g.retrieve_node("node name")? == i);
5704 assert_eq!(i.get_name()?, Some("node name".to_owned()));
5705 assert_eq!(
5706 g.prepare_input_values(hashmap!("node name" => Value::from_scalar(1, BIT)?))?,
5707 vec![Value::from_scalar(1, BIT)?]
5708 );
5709 Ok(())
5710 }()
5711 .unwrap();
5712 }
5713
5714 #[test]
5715 fn test_operation_fmt_display() {

Callers

nothing calls this directly

Calls 6

create_contextFunction · 0.70
scalar_typeFunction · 0.70
set_nameMethod · 0.45
create_graphMethod · 0.45
inputMethod · 0.45

Tested by

no test coverage detected