Commits

Shlomi Fish committed d525ac7

Add a test for trailing space.

  • Participants
  • Parent commits 1b3dcd7

Comments (0)

Files changed (2)

 upload_beta: all
 	(cd dest && $(RSYNC) -a --inplace * perl-begin@hexten.net:htdocs/__Beta-Quop/)
 
+test:
+	prove Tests/*.t
+
+runtest:
+	runprove Tests/*.t
+
 DEST_ARC_NAME = $(TARGET)/source/arcs/$(ARC_NAME)
 
 upload_home: all

Tests/style-trailing-space.t

+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+{
+    open my $ack_fh, '-|', 'ack', '-l', q/[ \t]+$/, '.'
+        or die "Cannot open ack for input - $!";
+
+    my $count_lines = 0;
+    while (my $l = <$ack_fh>)
+    {
+        $count_lines++;
+        diag($l);
+    }
+
+    # TEST
+    is ($count_lines, 0, "Count lines is 0.");
+
+    close($ack_fh);
+}