FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
luaplot/plotiteratorfactory_test.lua at master · thewizardplusplus/luaplot · GitHub
thewizardplusplus
/
luaplot
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
1
Code
Issues
0
Pull requests
0
Actions
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Security and quality
Insights
Expand file tree
Breadcrumbs
luaplot
/
plotiteratorfactory_test.lua
Copy path
More file actions
More file actions
Latest commit
History
History
History
42 lines (32 loc) · 1.32 KB
Breadcrumbs
luaplot
/
plotiteratorfactory_test.lua
Copy path
File metadata and controls
42 lines (32 loc) · 1.32 KB
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
local
luaunit
=
require
(
"
luaunit
"
)
local
checks
=
require
(
"
luatypechecks.checks
"
)
local
Plot
=
require
(
"
luaplot.plot
"
)
local
PlotIterator
=
require
(
"
luaplot.plotiterator
"
)
local
PlotIteratorFactory
=
require
(
"
luaplot.plotiteratorfactory
"
)
--
luacheck: globals TestPlotIteratorFactory
TestPlotIteratorFactory
=
{}
function
TestPlotIteratorFactory
.
test_new
()
local
function
transformer
()
assert
(
false
,
"
it should not be called
"
)
end
local
factory
=
PlotIteratorFactory
:
new
(
transformer
)
luaunit
.
assert_is_table
(
factory
)
luaunit
.
assert_true
(
checks
.
is_instance
(
factory
,
PlotIteratorFactory
))
luaunit
.
assert_is_function
(
factory
.
_transformer
)
luaunit
.
assert_equals
(
factory
.
_transformer
,
transformer
)
end
function
TestPlotIteratorFactory
.
test_with
()
local
function
transformer
()
assert
(
false
,
"
it should not be called
"
)
end
local
plot
=
Plot
:
new
(
5
,
32
,
23
,
42
)
local
factory
=
PlotIteratorFactory
:
new
(
transformer
)
local
iterator
=
factory
:
with
(
plot
)
luaunit
.
assert_is_table
(
iterator
)
luaunit
.
assert_true
(
checks
.
is_instance
(
iterator
,
PlotIterator
))
luaunit
.
assert_is_table
(
iterator
.
_plot
)
luaunit
.
assert_true
(
checks
.
is_instance
(
iterator
.
_plot
,
Plot
))
luaunit
.
assert_equals
(
iterator
.
_plot
,
plot
)
luaunit
.
assert_is_function
(
iterator
.
_transformer
)
luaunit
.
assert_equals
(
iterator
.
_transformer
,
transformer
)
end
Back
|
FazBrowse Home
|
New Git URL