From 3014213aa7bf5692114913fc4fe69c7b3fdacbc1 Mon Sep 17 00:00:00 2001 From: Michael Sippel Date: Mon, 2 Oct 2023 18:57:49 +0200 Subject: [PATCH] add more complex normalization test & fix normalization of application arguments --- src/lnf.rs | 2 +- src/test/lnf.rs | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/lnf.rs b/src/lnf.rs index 8acd421..f8b3ad9 100644 --- a/src/lnf.rs +++ b/src/lnf.rs @@ -41,7 +41,7 @@ impl TypeTerm { new_ladder.push( TypeTerm::App(vec![]) ); for arg in args_iter { - match arg.clone() { + match arg.normalize() { TypeTerm::Ladder(rungs) => { // duplicate last element for each rung let l = new_ladder.len(); diff --git a/src/test/lnf.rs b/src/test/lnf.rs index 486c0d6..1c81a55 100644 --- a/src/test/lnf.rs +++ b/src/test/lnf.rs @@ -43,5 +43,15 @@ fn test_normalize() { dict.parse("~Char>").expect("parse error").normalize(), dict.parse(">~").expect("parse errror"), ); + + + assert_eq!( + dict.parse(" F~G H H>").expect("parse error").normalize(), + dict.parse(" F H H> + ~ F H H> + ~ F H H> + ~ G H H>").expect("parse errror"), + ); + }