setup

local tScript
put "local sScript" & return & \
	"global gScriptGlobal" & return & \
	"global gSharedGlobal" & return & \
	"on testMe pParam" & return & \
	"	local tLocal" & return & \
	"	global gHandlerGlobal" & return & \
	"	global gSharedGlobal" & return & \
	"	set the cVariableNames of me to the variableNames" & return & \
	"end testMe" into tScript

create button
set the script of button 1 to tScript
local tParam = "abcd"
send "testMe tParam" to button 1

test the number of lines in the cVariableNames of button 1 is 4
test line 1 of the cVariableNames of button 1 is "pParam"
test line 2 of the cVariableNames of button 1 is "tLocal"
test line 3 of the cVariableNames of button 1 is "sScript"

local tGlobals
put line 4 of the cVariableNames of button 1 into tGlobals

test "gScriptGlobal" is among the items of tGlobals
test "gHandlerGlobal" is among the items of tGlobals
test "gSharedGlobal" is among the items of tGlobals

delete item itemOffset("gSharedGlobal", tGlobals) of tGlobals
test "gSharedGlobal" is not among the items of tGlobals

teardown
