FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
lunit/lua/lunitx/example.lua at master · sam-github/lunit · GitHub
sam-github
lunit
Repository navigation
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
lunit
/
lua
/
lunitx
/
example.lua
Copy path
More file actions
More file actions
Latest commit
History
History
History
46 lines (34 loc) · 832 Bytes
Breadcrumbs
lunit
/
lua
/
lunitx
/
example.lua
Copy path
File metadata and controls
46 lines (34 loc) · 832 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
44
45
46
lunit
=
require
"
lunitx
"
if
_VERSION
>=
'
Lua 5.2
'
then
_ENV
=
lunit
.
module
(
'
simple
'
,
'
seeall
'
)
else
module
(
"
simple
"
,
package.seeall
,
lunit
.
testcase
)
end
function
test_success
()
assert_true
(
true
,
"
This test never fails.
"
)
end
function
test_failure
()
assert_true
(
"
Hello World!
"
,
"
This test always fails!
"
)
end
if
_VERSION
>=
'
Lua 5.2
'
then
_ENV
=
lunit
.
module
(
'
enhanced
'
,
'
seeall
'
)
else
module
(
"
enhanced
"
,
package.seeall
,
lunit
.
testcase
)
end
local
foobar
=
nil
function
setup
()
foobar
=
"
Hello World
"
end
function
teardown
()
foobar
=
nil
end
function
test1
()
assert_equal
(
"
Hello World
"
,
foobar
)
foobar
=
string.sub
(
foobar
,
1
,
5
)
assert_equal
(
"
Hello
"
,
foobar
)
end
function
test2
()
assert_equal
(
"
Hello World
"
,
foobar
)
foobar
=
string.sub
(
foobar
,
-
5
)
assert_equal
(
"
World
"
,
foobar
)
end
Back
|
FazBrowse Home
|
New Git URL