# SCENARIO Push-Pop high level tuple interface
# 	GIVEN A Deque of size 12 initialized with [11,12,13], [21,22,23]

var dq[14] = [ 6, 0, 11, 12, 13, 21, 22, 23, 0, 0, 0, 0, 0, 0 ]
var require1[9]
var require2[1]
var require3[12]
var require4[1]
var require5[3]
var require6[9]
var require7[1]
var require8[3]
var require9[6]
var require10[1]
var require11[6]
var require12[1]
var require13[3]
var require14[1]

#	WHEN Push front [31,32,33]

call deque.push_front(dq, [31,32,33])

#		THEN Deque contains three tuples
#			REQUIRE contents is 31, 32, 33, 11, 12, 13, 21, 22, 23
#			REQUIRE size == 9

call deque.get(dq, require1, 0)
call deque.size(dq, require2)

#	WHEN Push back [41,42,43]

call deque.push_back(dq, [41,42,43])

#		THEN Deque contains four tuples
#			REQUIRE contents is 31, 32, 33, 11, 12, 13, 21, 22, 23, 41, 42, 43
#			REQUIRE size == 12

call deque.get(dq, require3, 0)
call deque.size(dq, require4)

#	WHEN Pop back

call deque.pop_back(dq, require5)

#		THEN Retrieve 3-tuple [41,42,43] from back
#			REQUIRE result is [41,42,43]
#			REQUIRE contents is 31, 32, 33, 11, 12, 13, 21, 22, 23
#			REQUIRE size == 9

call deque.get(dq, require6, 0)
call deque.size(dq, require7)

#	WHEN Pop back

call deque.pop_back(dq, require8)

#		THEN Retrieve 3-tuple [21,22,23] from back
#			REQUIRE result is [21,22,23]
#			REQUIRE contents is 31, 32, 33, 11, 12, 13
#			REQUIRE size == 6

call deque.get(dq, require9, 0)
call deque.size(dq, require10)

#	WHEN Pop front double tuple

call deque.pop_front(dq, require11)

#		THEN Retrieve 6-tuple [31,32,33,11,12,13] from front
#			REQUIRE result is [31,32,33,11,12,13]
#			REQUIRE size == 0

call deque.size(dq, require12)

#	WHEN Push front [51,52,53]

call deque.push_front(dq, [51,52,53])

#		THEN Deque contains tuple [51,52,53]
#			REQUIRE contents is [51,52,53]
#			REQUIRE size == 3

call deque.get(dq, require13, 0)
call deque.size(dq, require14)

call math.fill(dq, 0)
