Warning: file_get_contents(http://localhost:8000/calc?cmd=159&userid=0&debug=1): failed to open stream: Cannot assign requested address in /var/www/tb/show-snippet.php on line 158
test for serpent.lua [159]

Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

26
LINES

< > BotCompany Repo | #159 // test for serpent.lua

Lua code - System test

serpent = go("#158")

go("#121") -- compareTables
assert(compareTables)

function assertEquals(actual, expected)
  assert(expected == actual, actual)
end

function check(tbl)
  local s = serpent.block(tbl)
  print(s)
  local env = newCleanEnv()
  assert(compareTables)
  local f, err = load("return "..s, "serpent-made code", "t", env)
  if err then print(err) end
  assert(f)
  print(f)
  assert(compareTables)
  local t = f()
  assert(compareTables)
  assert(compareTables(tbl, t))
end

check {}
return true

Author comment

Began life as a copy of #154

test run  test run with input  download  show line numbers   

Travelled to 12 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

Comments [hide]

ID Author/Program Comment Date
289 #1000604 (pitcher) 2015-08-18 00:54:27
244 #1000610 (pitcher) Edit suggestion:
!636
!629

main {
static Object androidContext;
static String programID;

public static void main(String[] args) throws Exception {
serpent = go("#158")

go("#121") -- compareTables
assert(compareTables)

function assertEquals(actual, expected)
assert(expected == actual, actual)
end

function check(tbl)
local s = serpent.block(tbl)
print(s)
local env = newCleanEnv()
assert(compareTables)
local f, err = load("return "..s, "serpent-made code", "t", env)
if err then print(err) end
assert(f)
print(f)
assert(compareTables)
local t = f()
assert(compareTables)
assert(compareTables(tbl, t))
end

check {}
return true
}}
2015-08-18 00:52:42

add comment

Image recognition results

Recognizer Recognition Result Visualize Recalc
#308 534 [visualize]

Snippet ID: #159
Snippet name: test for serpent.lua
Eternal ID of this version: #159/1
Text MD5: 1a930c5c7bada68242c5bb684b532cb9
Author: stefan
Category: table serializers
Type: Lua code - System test
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2014-01-13 04:16:35
Source code size: 534 bytes / 26 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 1028 / 204
Referenced in: [show references]