File: test-tablex3.lua

package info (click to toggle)
lua-penlight 1.14.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,708 kB
  • sloc: makefile: 2
file content (12 lines) | stat: -rw-r--r-- 260 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
-- tablex.move when the tables are the same
-- and there are overlapping ranges
T = require 'pl.tablex'
asserteq = require 'pl.test'.asserteq

t1 = {1,2,3,4,5,6,7,8,9,10}
t2 = T.copy(t1)
t3 = T.copy(t1)

T.move(t1,t2,4,1,4)
T.move(t3,t3,4,1,4)
asserteq(t1,t3)