2013-05-21 09:05:59 -07:00
|
|
|
#!/usr/bin/env perl
|
|
|
|
|
|
|
|
use strict;
|
|
|
|
use warnings;
|
|
|
|
use Test::More;
|
|
|
|
use DDG::Test::Goodie;
|
|
|
|
use utf8;
|
|
|
|
|
|
|
|
zci is_cached => 1;
|
|
|
|
zci answer_type => 'ohms';
|
|
|
|
|
|
|
|
ddg_goodie_test(
|
2015-12-30 08:25:28 -08:00
|
|
|
[qw(
|
|
|
|
DDG::Goodie::ReverseResistorColours
|
|
|
|
)],
|
2013-05-22 12:20:36 -07:00
|
|
|
|
2015-12-30 08:25:28 -08:00
|
|
|
'black green red resistor' => test_zci(
|
2015-12-30 08:16:06 -08:00
|
|
|
'A black green red resistor has a resistance of 500 Ω ± 20%.',
|
|
|
|
structured_answer => {
|
|
|
|
data => {
|
|
|
|
title => '500 Ω ± 20%',
|
2016-01-04 15:11:51 -08:00
|
|
|
subtitle => 'Resistance of black green red resistor'
|
2015-12-30 08:16:06 -08:00
|
|
|
},
|
|
|
|
meta => {
|
|
|
|
sourceName => "Wikipedia",
|
|
|
|
sourceUrl => "https://en.wikipedia.org/wiki/Electronic_color_code",
|
|
|
|
},
|
|
|
|
templates => {
|
|
|
|
group => 'text',
|
|
|
|
options => {
|
|
|
|
moreAt => 1,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
),
|
2015-12-30 08:25:28 -08:00
|
|
|
'red orange yellow gold resistor' => test_zci(
|
2015-12-30 08:16:06 -08:00
|
|
|
'A red orange yellow gold resistor has a resistance of 230 kΩ ± 5%.',
|
|
|
|
structured_answer => {
|
|
|
|
data => {
|
|
|
|
title => '230 kΩ ± 5%',
|
2016-01-04 15:11:51 -08:00
|
|
|
subtitle => 'Resistance of red orange yellow gold resistor'
|
2015-12-30 08:16:06 -08:00
|
|
|
},
|
|
|
|
meta => {
|
|
|
|
sourceName => "Wikipedia",
|
|
|
|
sourceUrl => "https://en.wikipedia.org/wiki/Electronic_color_code",
|
|
|
|
},
|
|
|
|
templates => {
|
|
|
|
group => 'text',
|
|
|
|
options => {
|
|
|
|
moreAt => 1,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
),
|
2015-12-30 08:25:28 -08:00
|
|
|
'resistor yellow blue purple'=> test_zci(
|
2015-12-30 08:16:06 -08:00
|
|
|
'A yellow blue violet resistor has a resistance of 460 MΩ ± 20%.',
|
|
|
|
structured_answer => {
|
|
|
|
data => {
|
|
|
|
title => '460 MΩ ± 20%',
|
2016-01-04 15:11:51 -08:00
|
|
|
subtitle => 'Resistance of yellow blue violet resistor'
|
2015-12-30 08:16:06 -08:00
|
|
|
},
|
|
|
|
meta => {
|
|
|
|
sourceName => "Wikipedia",
|
|
|
|
sourceUrl => "https://en.wikipedia.org/wiki/Electronic_color_code",
|
|
|
|
},
|
|
|
|
templates => {
|
|
|
|
group => 'text',
|
|
|
|
options => {
|
|
|
|
moreAt => 1,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
),
|
2013-05-22 12:20:36 -07:00
|
|
|
|
2015-12-30 08:25:28 -08:00
|
|
|
'resistor yellow green' => undef,
|
|
|
|
'resistor red orange blue red green' => undef,
|
|
|
|
'resistor red banana orangutan' => undef,
|
2014-02-10 13:24:52 -08:00
|
|
|
'red yellow white gold resistor' => test_zci(
|
|
|
|
'A red yellow white gold resistor has a resistance of 24 GΩ ± 5%.',
|
2015-12-30 08:16:06 -08:00
|
|
|
structured_answer => {
|
|
|
|
data => {
|
|
|
|
title => '24 GΩ ± 5%',
|
2016-01-04 15:11:51 -08:00
|
|
|
subtitle => 'Resistance of red yellow white gold resistor'
|
2015-12-30 08:16:06 -08:00
|
|
|
},
|
|
|
|
meta => {
|
|
|
|
sourceName => "Wikipedia",
|
|
|
|
sourceUrl => "https://en.wikipedia.org/wiki/Electronic_color_code",
|
|
|
|
},
|
|
|
|
templates => {
|
|
|
|
group => 'text',
|
|
|
|
options => {
|
|
|
|
moreAt => 1,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2014-02-10 13:24:52 -08:00
|
|
|
),
|
|
|
|
'resistor red yellow white' => test_zci(
|
|
|
|
'A red yellow white resistor has a resistance of 24 GΩ ± 20%.',
|
2015-12-30 08:16:06 -08:00
|
|
|
structured_answer => {
|
|
|
|
data => {
|
|
|
|
title => '24 GΩ ± 20%',
|
2016-01-04 15:11:51 -08:00
|
|
|
subtitle => 'Resistance of red yellow white resistor'
|
2015-12-30 08:16:06 -08:00
|
|
|
},
|
|
|
|
meta => {
|
|
|
|
sourceName => "Wikipedia",
|
|
|
|
sourceUrl => "https://en.wikipedia.org/wiki/Electronic_color_code",
|
|
|
|
},
|
|
|
|
templates => {
|
|
|
|
group => 'text',
|
|
|
|
options => {
|
|
|
|
moreAt => 1,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2014-02-10 13:24:52 -08:00
|
|
|
),
|
2013-05-21 09:05:59 -07:00
|
|
|
);
|
|
|
|
|
|
|
|
done_testing;
|