summaryrefslogtreecommitdiff
path: root/t/input.t
diff options
context:
space:
mode:
Diffstat (limited to 't/input.t')
-rw-r--r--t/input.t33
1 files changed, 33 insertions, 0 deletions
diff --git a/t/input.t b/t/input.t
new file mode 100644
index 0000000..91e8afc
--- /dev/null
+++ b/t/input.t
@@ -0,0 +1,33 @@
+#!perl
+use strict;
+use warnings;
+use Test2::Bundle::Extended;
+use Data::QRCode::Input;
+
+my $input = Data::QRCode::Input->new();
+
+$input->version(12);
+$input->error_correction_level(Data::QRCode::Input::ECLEVEL_M);
+
+is(
+ $input->version,
+ 12,
+ 'version should round-trip',
+);
+
+is(
+ $input->error_correction_level,
+ Data::QRCode::Input::ECLEVEL_M,
+ 'ec level should round-trip',
+);
+
+is(
+ $input->append(
+ Data::QRCode::Input::MODE_8,
+ 'some data',
+ ),
+ 0,
+ 'append should work and return 0 on success',
+);
+
+done_testing;