Commits

Palmer, 2E0EOL  committed f7fddd9 Draft

Add initial basic test suite

  • Participants
  • Parent commits 7670722

Comments (0)

Files changed (2)

+#!/usr/bin/perl -w
+#
+# This is a very basic test of the object, to ensure all functions declared
+# as public are available.
+#
+
+package Example;
+use base Class::Struct::Trapper;
+
+use strict;
+use warnings;
+use diagnostics;
+#----------------------------------------------------------------------------
+sub new
+{
+	my $self = shift;
+	return $self->SUPER::new();
+}
+#----------------------------------------------------------------------------
+package main;
+use Test::More tests => 1;
+
+#----------------------------------------------------------------------------
+sub t_main()
+{
+	my $o = Example->new();
+	isa_ok($o, 'Example', 'new');
+
+	return 0;
+}
+#----------------------------------------------------------------------------
+exit(t_main());
+#----------------------------------------------------------------------------
+1;
+#!/usr/bin/perl -w
+
+use Class::Struct::Trapper;
+package main;
+use Test::More tests => 1;
+
+use constant CHECK_VER => '0.0.0';
+
+is(
+	$Class::Struct::Trapper::VERSION,
+	CHECK_VER(),
+	sprintf(
+		'Class::Struct::Trapper::VERSION is \'%s\'',
+		CHECK_VER()
+	)
+);
+
+exit(0);