zeroclickinfo-goodies/t/Weight.t

25 lines
1.4 KiB
Perl
Raw Normal View History

2015-04-21 08:37:27 -07:00
#!/usr/bin/env perl
use strict;
use warnings;
use Test::More;
use DDG::Test::Goodie;
zci answer_type => "weight";
zci is_cached => 1;
ddg_goodie_test(
[qw( DDG::Goodie::Weight )],
# - primary_example_queries
2015-09-07 06:44:54 -07:00
'What is the weight of a 5kg mass on Earth?' => test_zci("Weight of a 5kg mass on Earth is 49.03325N.", structured_answer => { input =>[], operation => "Taking value of acceleration due to gravity on Earth as 9.80665m/s^2.", result =>"Weight of a 5kg mass on Earth is 49.03325N."}),
'weight 5.12g' => test_zci("Weight of a 5.12g mass on Earth is 0.050210048N.", structured_answer => { input =>[], operation => "Taking value of acceleration due to gravity on Earth as 9.80665m/s^2.", result =>"Weight of a 5.12g (0.00512 kg) mass on Earth is 0.050210048N."}),
2015-06-18 23:01:17 -07:00
'weight 5.12oz' => test_zci("Weight of a 5.12oz mass on Earth is 1.4209443584N.", structured_answer => { input =>[], operation => "Taking value of acceleration due to gravity on Earth as 9.80665m/s^2.", result =>"Weight of a 5.12oz (0.144896 kg) mass on Earth is 1.4209443584N."}),
2015-09-07 06:44:54 -07:00
'Weight of 5.1 kg on earth' => test_zci("Weight of a 5.1kg mass on Earth is 50.013915N.", structured_answer => { input =>[], operation => "Taking value of acceleration due to gravity on Earth as 9.80665m/s^2.", result =>"Weight of a 5.1kg mass on Earth is 50.013915N."}),
2015-04-23 02:21:59 -07:00
# Bad example queries
2015-04-21 08:37:27 -07:00
'weight' => undef,
'weight abc' => undef,
2015-09-07 06:44:54 -07:00
'weight 5' => undef,
2015-04-21 08:37:27 -07:00
);
done_testing;