From 6cca8025c28553cd1adbb2a54b43d64685664fb7 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Thu, 29 Aug 2013 15:29:33 -0400 Subject: fix this algorithm, again (jasonshaev) --- t/cell-to-row-col.t | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 t/cell-to-row-col.t (limited to 't') diff --git a/t/cell-to-row-col.t b/t/cell-to-row-col.t new file mode 100644 index 0000000..c20432e --- /dev/null +++ b/t/cell-to-row-col.t @@ -0,0 +1,27 @@ +#!/usr/bin/env perl +use strict; +use warnings; +use Test::More; + +use Spreadsheet::Template::Helpers::Xslate; + +my %tests = ( + A1 => [0, 0], + Z3 => [2, 25], + AA5 => [4, 26], + IV256 => [255, 255], + ZZ10 => [9, 701], + AAA8 => [7, 702], + XFD22 => [21, 16383], +); + +for my $cell (sort keys %tests) { + # XXX not public API, but i'm lazy + is_deeply( + Spreadsheet::Template::Helpers::Xslate::_cell_to_row_col($cell), + $tests{$cell}, + "correct value for $cell" + ); +} + +done_testing; -- cgit v1.2.3-54-g00ecf