summaryrefslogtreecommitdiffstats
path: root/tcllib/modules/grammar_fa/tests/fa_is.test
diff options
context:
space:
mode:
Diffstat (limited to 'tcllib/modules/grammar_fa/tests/fa_is.test')
-rw-r--r--tcllib/modules/grammar_fa/tests/fa_is.test59
1 files changed, 59 insertions, 0 deletions
diff --git a/tcllib/modules/grammar_fa/tests/fa_is.test b/tcllib/modules/grammar_fa/tests/fa_is.test
new file mode 100644
index 0000000..8f8e36a
--- /dev/null
+++ b/tcllib/modules/grammar_fa/tests/fa_is.test
@@ -0,0 +1,59 @@
+# -*- tcl -*-
+# finite_automaton.test: tests for the grammar::fa container.
+#
+# Copyright (c) 2004-2007 by Andreas Kupries <andreas_kupries@users.sourceforge.net>
+#
+# RCS: @(#) $Id: fa_is.test,v 1.4 2007/04/12 03:43:14 andreas_kupries Exp $
+
+# -------------------------------------------------------------------------
+
+test fa-is-${setimpl}-1.0 {is, error} {
+ grammar::fa a
+ catch {a is} msg
+ a destroy
+ set msg
+} {wrong # args: should be "::grammar::fa::Snit_methodis type selfns win self cmd"}
+
+
+test fa-is-${setimpl}-1.1 {is, error} {
+ grammar::fa a
+ catch {a is foo} msg
+ a destroy
+ set msg
+} {Expected complete, deterministic, epsilon-free, or useful, got "foo"}
+
+
+test fa-is-${setimpl}-1.2 {is, error} {
+ grammar::fa a
+ catch {a is complete bar} msg
+ a destroy
+ set msg
+} {wrong # args: should be "::grammar::fa::Snit_methodis type selfns win self cmd"}
+
+
+test fa-is-${setimpl}-1.3 {is, error} {
+ grammar::fa a
+ catch {a is deterministic bar} msg
+ a destroy
+ set msg
+} {wrong # args: should be "::grammar::fa::Snit_methodis type selfns win self cmd"}
+
+
+test fa-is-${setimpl}-1.4 {is, error} {
+ grammar::fa a
+ catch {a is useful bar} msg
+ a destroy
+ set msg
+} {wrong # args: should be "::grammar::fa::Snit_methodis type selfns win self cmd"}
+
+
+test fa-is-${setimpl}-1.5 {is, error} {
+ grammar::fa a
+ catch {a is epsilon-free bar} msg
+ a destroy
+ set msg
+} {wrong # args: should be "::grammar::fa::Snit_methodis type selfns win self cmd"}
+
+
+# -------------------------------------------------------------------------
+::tcltest::cleanupTests