- Eliminated StringTable.{h,cpp}.
- Eliminated strings.<locale> files.  This is not the way to do it.
This commit is contained in:
Paul Beckingham 2011-03-27 02:06:09 -04:00
parent 3cccdf722e
commit c502f0216a
24 changed files with 99 additions and 807 deletions

1
test/.gitignore vendored
View file

@ -22,7 +22,6 @@ rectangle.t
rx.t
sensor.t
seq.t
stringtable.t
subst.t
t.benchmark.t
t.t

View file

@ -3,10 +3,11 @@ include_directories (${CMAKE_SOURCE_DIR}/src
${CMAKE_SOURCE_DIR}/test
${TASK_INCLUDE_DIRS})
set (test_SRCS date.t t.t tdb.t duration.t t.benchmark.t text.t autocomplete.t seq.t
record.t att.t stringtable.t subst.t nibbler.t filt.t cmd.t config.t
util.t color.t list.t path.t file.t grid.t directory.t rx.t taskmod.t
lisp.t rectangle.t sensor.t tree.t tree2.t uri.t json.t)
set (test_SRCS date.t t.t tdb.t duration.t t.benchmark.t text.t autocomplete.t
seq.t record.t att.t subst.t nibbler.t filt.t cmd.t config.t
util.t color.t list.t path.t file.t grid.t directory.t rx.t
taskmod.t lisp.t rectangle.t sensor.t tree.t tree2.t uri.t
json.t)
add_custom_target (test ./run_all DEPENDS ${test_SRCS}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/test)

View file

@ -80,7 +80,7 @@ $output = qx{../src/task rc:limit.rc ls limit:3};
like ($output, qr/^30 tasks, 3 shown$/ms, 'limited to 3');
$output = qx{../src/task rc:limit.rc ls limit:page};
like ($output, qr/^30 tasks, truncated to 17 lines$/ms, 'limited to page');
like ($output, qr/^30 tasks, truncated to 18 lines$/ms, 'limited to page');
# Cleanup.
unlink 'pending.data';

View file

@ -1,61 +0,0 @@
////////////////////////////////////////////////////////////////////////////////
// taskwarrior - a command line task list manager.
//
// Copyright 2006 - 2011, Paul Beckingham, Federico Hernandez.
// All rights reserved.
//
// This program is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free Software
// Foundation; either version 2 of the License, or (at your option) any later
// version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
// details.
//
// You should have received a copy of the GNU General Public License along with
// this program; if not, write to the
//
// Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor,
// Boston, MA
// 02110-1301
// USA
//
////////////////////////////////////////////////////////////////////////////////
#include <unistd.h>
#include <Context.h>
#include <StringTable.h>
#include <File.h>
#include <util.h>
#include <test.h>
Context context;
////////////////////////////////////////////////////////////////////////////////
int main (int argc, char** argv)
{
UnitTest t (4);
// Create a string file.
std::string file = "./strings.xx-XX";
File::write (file, "# comment\n1 found");
t.is (access (file.c_str (), F_OK), 0, "strings.xx-XX created.");
// Load the string file.
StringTable st;
st.load (file);
// Test the object.
t.is (st.get (1, "nope"), "found", "string 1 'found' found");
t.is (st.get (2, "nope"), "nope", "string 2 'nope' defaulted");
// Clean up.
unlink (file.c_str ());
t.is (access (file.c_str (), F_OK), -1, "strings.xx-XX removed.");
return 0;
}
////////////////////////////////////////////////////////////////////////////////