MCPcopy Create free account
hub / github.com/agenticsorg/lean-agentic / test_inductive

Function test_inductive

leanr-syntax/src/parser.rs:764–780  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

762
763 #[test]
764 fn test_inductive() {
765 let input = r#"
766 inductive Nat where
767 | zero : Nat
768 | succ (n : Nat) : Nat
769 "#;
770 let decls = parse(input).unwrap();
771 assert_eq!(decls.len(), 1);
772
773 match &decls[0] {
774 Decl::Inductive(ind) => {
775 assert_eq!(ind.name.name, "Nat");
776 assert_eq!(ind.constructors.len(), 2);
777 }
778 _ => panic!("Expected inductive"),
779 }
780 }
781}

Callers

nothing calls this directly

Calls 1

parseFunction · 0.85

Tested by

no test coverage detected