#!/usr/bin/env perl
use strict;
use warnings;
use Test::More;
use DDG::Test::Goodie;
use utf8;
zci answer_type => 'binary_logic';
zci is_cached => 1;
ddg_goodie_test(
[qw(
DDG::Goodie::BinaryLogic
)],
'4 xor 5' => test_zci('1',
html => "
Result: 1
",
heading => "Binary Logic"
),
'4 ⊕ 5' => test_zci('1',
html => "Result: 1
",
heading => "Binary Logic"
),
'9489 xor 394 xor 9349 xor 39 xor 29 xor 4967 xor 3985' => test_zci('7378',
html => "Result: 7378
",
heading => "Binary Logic"
),
'10 and 12' => test_zci('8',
html => "Result: 8
",
heading => "Binary Logic"
),
'10 ∧ 12' => test_zci('8',
html => "Result: 8
",
heading => "Binary Logic"
),
'52 or 100' => test_zci('116',
html => "Result: 116
",
heading => "Binary Logic"
),
'52 ∨ 100' => test_zci('116',
html => "Result: 116
",
heading => "Binary Logic"
),
'23 and (30 or 128)' => test_zci('22',
html => "Result: 22
",
heading => "Binary Logic"
),
'23 ∧ (30 ∨ 128)' => test_zci('22',
html => "Result: 22
",
heading => "Binary Logic"
),
'0x999 xor 0x589' => test_zci('3088',
html => "Result: 3088
",
heading => "Binary Logic"
),
'0x999 ⊕ 0x589' => test_zci('3088',
html => "Result: 3088
",
heading => "Binary Logic"
),
'not 1' => test_zci('18446744073709551614',
html => "Result: 18446744073709551614
",
heading => "Binary Logic"
),
'¬1' => test_zci('18446744073709551614',
html => "Result: 18446744073709551614
",
heading => "Binary Logic"
),
'3 and 2' => test_zci('2',
html => "Result: 2
",
heading => "Binary Logic"
),
'1 or 1234' => test_zci('1235',
html => "Result: 1235
",
heading => "Binary Logic"
),
'34 or 100' => test_zci('102',
html => "Result: 102
",
heading => "Binary Logic"
),
'10 and (30 or 128)' => test_zci('10',
html => "Result: 10
",
heading => "Binary Logic"
),
'0x01 or not 0X100' => test_zci('18446744073709551359',
html => "Result: 18446744073709551359
",
heading => "Binary Logic"
),
'0x01 or 0x02' => test_zci('3',
html => "Result: 3
",
heading => "Binary Logic"
),
'0b01 or 0b10' => test_zci('3',
html => "Result: 3
",
heading => "Binary Logic"
),
'0B11 xor 0B10' => test_zci('1',
html => "Result: 1
",
heading => "Binary Logic"
),
);
done_testing;