Anonymous avatar Anonymous committed 5d8f89b

Add a system test for --mode=riddle.

Comments (0)

Files changed (2)

abc-path/generator/generate-abs-path.pl

     
     my $riddle_string = $self->_get_riddle_only_as_string($riddle);
 
-    return <<"EOF";
-ABC Path Solver Layout Version 1:
-$riddle_string
-
-Solution:
-$layout_string
-EOF
+    return sprintf(
+        "ABC Path Solver Layout Version 1:\n%s\nSolution:\n%s",
+        $riddle_string, $layout_string,
+    );
 }
 
 sub _get_riddle_only_as_string

abc-path/generator/t/system-test.t

 use strict;
 use warnings;
 
-use Test::More tests => 1;
+use Test::More tests => 2;
 
 use Test::Differences;
 
 {
     # TEST
-    
+
     eq_or_diff(
         scalar(`$^X generate-abs-path.pl --seed=1`),
         <<'EOF',
         'For seed #1',
     );
 }
+
+{
+    # TEST
+    eq_or_diff(
+        scalar(`$^X generate-abs-path.pl --seed=1 --mode=riddle`),
+        <<'EOF',
+ABC Path Solver Layout Version 1:
+YGBJNUT
+S     R
+D     W
+F     V
+O A   K
+M     I
+HEXCQPL
+
+Solution:
+Y | X | R | S | T
+E | D | W | Q | U
+F | B | C | V | P
+G | A | K | L | O
+H | I | J | N | M
+EOF
+        'Riddle mode for seed #1',
+    );
+}
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.