From d2617362d9045703430ff1bd9dffc667836b68ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Le=C3=B3n=20Bohn?= Date: Wed, 4 Nov 2026 19:01:22 +0100 Subject: [PATCH] Fix the property spelling "terminal" and two texts The parser accepted "terminatl" instead of "terminal" (the writer produces "terminal"), so automata with this property failed to parse. Also fix the doc comment of start() and a typo in a test message. Reported in leonbohn/frieda#125 by olaf-hochherz-work. --- src/format.rs | 11 ++++++++++- src/lib.rs | 4 ++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/format.rs b/src/format.rs index d921614..69af549 100644 --- a/src/format.rs +++ b/src/format.rs @@ -279,7 +279,7 @@ impl TryFrom for Property { "weak" => Ok(Property::Weak), "very-weak" => Ok(Property::VeryWeak), "inherently-weak" => Ok(Property::InherentlyWeak), - "terminatl" => Ok(Property::Terminal), + "terminal" => Ok(Property::Terminal), "tight" => Ok(Property::Tight), "colored" => Ok(Property::Colored), unknown => Err(format!("{} is not a valid property", unknown)), @@ -313,6 +313,15 @@ impl AcceptanceInfo { mod tests { use crate::AcceptanceCondition; + #[test] + fn terminal_property_is_parsed() { + // the spelling "terminal" is the one that the writer produces + assert_eq!( + super::Property::try_from("terminal".to_string()), + Ok(super::Property::Terminal) + ); + } + #[test] fn parity_acceptance_creator() { let parity_condition = super::AcceptanceCondition::parity(3); diff --git a/src/lib.rs b/src/lib.rs index 2d962d4..4316a06 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -187,7 +187,7 @@ impl HoaRepresentation { }) } - /// Returns the number of edges in the automaton. + /// Returns the start state conjunction. pub fn start(&self) -> Vec<&StateConjunction> { debug_assert!( self.header() @@ -490,7 +490,7 @@ mod tests { let hoa_aut = HoaRepresentation::try_from(contents); if let Err(err) = hoa_aut { - error!("Encountered paring error\n{}", err); + error!("Encountered parsing error\n{}", err); return; }