mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-02 23:48:35 +02:00
Unit Tests - decommission t.t.cpp
- Eliminated obsolete t.t.cpp.
This commit is contained in:
parent
a04bfc468b
commit
841958d889
3 changed files with 6 additions and 100 deletions
|
@ -1,4 +1,4 @@
|
|||
PROJECT = t.t t2.t tdb.t date.t duration.t t.benchmark.t text.t autocomplete.t \
|
||||
PROJECT = t2.t tdb.t date.t duration.t t.benchmark.t text.t autocomplete.t \
|
||||
config.t seq.t att.t stringtable.t record.t nibbler.t subst.t filt.t \
|
||||
cmd.t
|
||||
CFLAGS = -I. -I.. -Wall -pedantic -ggdb3 -fno-rtti
|
||||
|
@ -23,9 +23,6 @@ clean:
|
|||
.cpp.o:
|
||||
g++ -c $(CFLAGS) $<
|
||||
|
||||
t.t: t.t.o $(OBJECTS) test.o
|
||||
g++ t.t.o $(OBJECTS) test.o $(LFLAGS) -o t.t
|
||||
|
||||
t2.t: t2.t.o $(OBJECTS) test.o
|
||||
g++ t2.t.o $(OBJECTS) test.o $(LFLAGS) -o t2.t
|
||||
|
||||
|
|
|
@ -1,91 +0,0 @@
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
// task - a command line task list manager.
|
||||
//
|
||||
// Copyright 2006 - 2009, Paul Beckingham.
|
||||
// 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 "T.h"
|
||||
#include "main.h"
|
||||
#include "test.h"
|
||||
|
||||
Context context;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int main (int argc, char** argv)
|
||||
{
|
||||
UnitTest test (8);
|
||||
|
||||
T t;
|
||||
std::string s = t.compose ();
|
||||
test.is ((int)s.length (), 49, "T::T (); T::compose ()");
|
||||
test.diag (s);
|
||||
|
||||
t.setStatus (T::completed);
|
||||
s = t.compose ();
|
||||
test.is (s[37], '+', "T::setStatus (completed)");
|
||||
test.diag (s);
|
||||
|
||||
t.setStatus (T::deleted);
|
||||
s = t.compose ();
|
||||
test.is (s[37], 'X', "T::setStatus (deleted)");
|
||||
test.diag (s);
|
||||
|
||||
t.setStatus (T::recurring);
|
||||
s = t.compose ();
|
||||
test.is (s[37], 'r', "T::setStatus (recurring)");
|
||||
test.diag (s);
|
||||
|
||||
std::string format3 = "00000000-0000-0000-0000-000000000000 - [] [] [] Sample\n";
|
||||
|
||||
// Format 1 Not supported as of 1.8.0.
|
||||
|
||||
// Format 2 Round trip test.
|
||||
std::string sample = "00000000-0000-0000-0000-000000000000 - [] [] Sample";
|
||||
T tf2;
|
||||
tf2.parse (sample);
|
||||
test.is (tf2.compose (), format3, "T::parse format 2 -> T::compose round trip");
|
||||
|
||||
// Format 3 Round trip test.
|
||||
sample = "00000000-0000-0000-0000-000000000000 - [] [] [] Sample";
|
||||
T tf3;
|
||||
tf3.parse (sample);
|
||||
test.is (tf3.compose (), format3, "T::parse format 3 -> T::compose round trip");
|
||||
|
||||
// b10b3236-70d8-47bb-840a-b4c430758fb6 - [foo] [bar:baz] [1237865996:'woof'] sample\n
|
||||
// ....:....|....:....|....:....|....:....|....:....|....:....|....:....|....:....|....:....|
|
||||
// ^ ^ ^
|
||||
// 0 36 66
|
||||
t.setStatus (T::pending);
|
||||
t.addTag ("foo");
|
||||
t.setAttribute ("bar", "baz");
|
||||
t.addAnnotation ("woof");
|
||||
t.setDescription ("sample");
|
||||
std::string format = t.compose ();
|
||||
test.is (format.substr (36, 20), " - [foo] [bar:baz] [", "compose tag, attribute");
|
||||
test.is (format.substr (66, 16), ":\"woof\"] sample\n", "compose annotation");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -138,11 +138,11 @@ int main (int argc, char** argv)
|
|||
|
||||
/*
|
||||
|
||||
Task::composeCSV
|
||||
Task::id
|
||||
Task::*Status
|
||||
Task::*Tag*
|
||||
Task::*Annotation*
|
||||
TODO Task::composeCSV
|
||||
TODO Task::id
|
||||
TODO Task::*Status
|
||||
TODO Task::*Tag*
|
||||
TODO Task::*Annotation*
|
||||
|
||||
*/
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue