Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
NLua
Commits
c3b15c9b
Commit
c3b15c9b
authored
Sep 13, 2019
by
Vinicius Jarina
Browse files
Added `ExpandoObject` to `CallDictionary` test
parent
a9e3fb02
Changes
1
Show whitespace changes
Inline
Side-by-side
tests/src/LuaTests.cs
View file @
c3b15c9b
...
...
@@ -16,6 +16,7 @@ using Lua = NLua.Lua;
using
LuaFunction
=
NLua
.
LuaFunction
;
using
System.Diagnostics
;
using
System.Collections.Generic
;
using
System.Collections
;
// ReSharper disable StringLiteralTypo
...
...
@@ -2569,6 +2570,33 @@ namespace NLuaTest
Assert
.
AreEqual
(
"value1"
,
lua
[
"i"
],
"#1"
);
Assert
.
AreEqual
(
"value2"
,
lua
[
"j"
],
"#2"
);
IDictionary
<
string
,
object
>
obj2
=
new
Dictionary
<
string
,
object
>()
{
{
"key1"
,
"value1"
},
{
"key2"
,
"value2"
}
};
lua
[
"obj2"
]
=
obj
;
lua
.
DoString
(
"l = obj2.key1"
);
lua
.
DoString
(
"m = obj2['key2']"
);
Assert
.
AreEqual
(
"value1"
,
lua
[
"l"
],
"#3"
);
Assert
.
AreEqual
(
"value2"
,
lua
[
"m"
],
"#4"
);
IDictionary
<
string
,
object
>
obj3
=
new
System
.
Dynamic
.
ExpandoObject
();
obj3
[
"key1"
]
=
"value1"
;
obj3
[
"key2"
]
=
"value2"
;
lua
[
"obj3"
]
=
obj
;
lua
.
DoString
(
"n = obj3.key1"
);
lua
.
DoString
(
"o = obj3['key2']"
);
Assert
.
AreEqual
(
"value1"
,
lua
[
"n"
],
"#5"
);
Assert
.
AreEqual
(
"value2"
,
lua
[
"o"
],
"#6"
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment