tables.plt 543 Bytes
Newer Older
Thierry Martinez's avatar
FOLTL  
Thierry Martinez committed
1 2 3 4 5 6 7 8 9
:- use_module(library(plunit)).

:- begin_tests(tables).

test(
  'add_table',
  [true(Tables == [table])]
) :-
  clear_model,
Thierry Martinez's avatar
Thierry Martinez committed
10
  add_table(table, [row(1, 2)]),
Thierry Martinez's avatar
FOLTL  
Thierry Martinez committed
11 12 13 14
  all_items([kind: table], Tables).

test(
  'get_table_data',
Thierry Martinez's avatar
Thierry Martinez committed
15
  [true(Data == [row(1, 2)])]
Thierry Martinez's avatar
FOLTL  
Thierry Martinez committed
16 17
) :-
  clear_model,
Thierry Martinez's avatar
Thierry Martinez committed
18 19 20 21 22 23 24 25 26
  add_table(table, [row(1, 2)]),
  get_table_data(Data).

test(
  'delete_column',
  [true(Data == [row(1, 3), row(4, 6)])]
) :-
  clear_model,
  add_table(table, [row(1, 2, 3), row(4, 5, 6)]),
Thierry Martinez's avatar
Thierry Martinez committed
27 28 29
  command(delete_column(1)),
  get_table_data(Data).

Thierry Martinez's avatar
FOLTL  
Thierry Martinez committed
30
:- end_tests(tables).