Module Name:    src
Committed By:   rillig
Date:           Sun Feb  7 17:50:16 UTC 2021

Modified Files:
        src/tests/lib/libcurses/director: testlang_parse.y

Log Message:
tests/libcurses: actually compare the stream to an absolute path

Up to now, the test command "compare /dev/null" was a no-op since the
command was only parsed but not run at all.  Now run it.

This makes the test mvwin fail.  That test will have to be fixed.

Comparing to /dev/null is certainly possible and may make sense,
comparing to /dev/zero is nonsense since the actual stream can never be
endless.  Some tests do that nevertheless, for whatever reason.

In order to have the expected test output closer to the curses commands
that cause it, it may be a good idea to add another command
'compare_str' that would work independently of an external file and at
the same time allow the expected output to be commented and explained.
This is not possible right now since the .chk files are read exactly
as-is.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/tests/lib/libcurses/director/testlang_parse.y

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/director/testlang_parse.y
diff -u src/tests/lib/libcurses/director/testlang_parse.y:1.27 src/tests/lib/libcurses/director/testlang_parse.y:1.28
--- src/tests/lib/libcurses/director/testlang_parse.y:1.27	Sun Feb  7 17:32:55 2021
+++ src/tests/lib/libcurses/director/testlang_parse.y	Sun Feb  7 17:50:16 2021
@@ -1,5 +1,5 @@
 %{
-/*	$NetBSD: testlang_parse.y,v 1.27 2021/02/07 17:32:55 rillig Exp $	*/
+/*	$NetBSD: testlang_parse.y,v 1.28 2021/02/07 17:50:16 rillig Exp $	*/
 
 /*-
  * Copyright 2009 Brett Lymn <bl...@netbsd.org>
@@ -431,15 +431,17 @@ noinput		: NOINPUT {
 	no_input = true;
 }
 
-compare		: COMPARE PATH
-			/* FIXME: missing action */
+compare		: COMPARE PATH {
+			compare_streams($2, true);
+		}
 		| COMPARE FILENAME {
 			compare_streams($2, true);
 		}
 		;
 
-comparend	: COMPAREND PATH
-			/* FIXME: missing action */
+comparend	: COMPAREND PATH {
+			compare_streams($2, false);
+		}
 		| COMPAREND FILENAME {
 			compare_streams($2, false);
 		}
@@ -544,7 +546,6 @@ expr		: numeric
 		}
 		;
 
-		/* TODO: split into 'arg' */
 args		: /* empty */
 		| arg args
 		;

Reply via email to