summaryrefslogtreecommitdiff
path: root/t/input.t
diff options
context:
space:
mode:
authordakkar <dakkar@thenautilus.net>2016-11-10 13:27:18 +0000
committerdakkar <dakkar@thenautilus.net>2016-11-10 13:39:29 +0000
commit61f964216b16b25200e2a2ac961f7444c0570daf (patch)
treea39731665727a5f0a5aaa20c1c8c92a8f1a1ffcc /t/input.t
parenttry using more magic (diff)
downloadData-QRCode-61f964216b16b25200e2a2ac961f7444c0570daf.tar.gz
Data-QRCode-61f964216b16b25200e2a2ac961f7444c0570daf.tar.bz2
Data-QRCode-61f964216b16b25200e2a2ac961f7444c0570daf.zip
split into input / qrcode
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;