File: table_replace_cell.tts

package info (click to toggle)
librnd 4.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 12,812 kB
  • sloc: ansic: 126,990; sh: 2,602; makefile: 2,145; awk: 7
file content (43 lines) | stat: -rw-r--r-- 730 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# test with a lihata doc in which the root is a li
load_doc D1 table_corners.lht

# N1 is a non-empty, N2 is an empty table
root N1 D1
path N1 /1
root N2 D1
path N2 /0

echo Untouched, original tree:
print_tree N1
echo ---

new_text N3 for_replacing

echo Replacing a valid cell (cell 0, 0)
table_replace_cell N1 0 0 N3 N8
echo res:
print_tree N1
echo old:
print_tree N8
echo ---

new_text N4 cannot_replace

echo Trying to replace out of boundaries (cell 2, 2)
table_replace_cell N1 2 2 N4 N8
echo res:
print_tree N1
echo old:
print_tree N8
echo ---

new_text N5 can_replace

echo Trying to replace an already replaced cell (cell 0, 0)
table_replace_cell N1 0 0 N5 N8
echo res:
print_tree N1
echo old:
print_tree N8

free_doc D1