-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #97 from hadashiA/ku/word-boxing
Enable MRB_WORD_BOXING
- Loading branch information
Showing
30 changed files
with
251 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+5.59 KB
(100%)
....Unity/Assets/VitalRouter.MRuby/Runtime/Plugins/android-arm64/VitalRouter.MRuby.Native.so
Binary file not shown.
Binary file modified
BIN
-54.9 KB
(92%)
...er.Unity/Assets/VitalRouter.MRuby/Runtime/Plugins/android-x64/VitalRouter.MRuby.Native.so
Binary file not shown.
Binary file modified
BIN
+50.3 KB
(100%)
...outer.Unity/Assets/VitalRouter.MRuby/Runtime/Plugins/ios-arm64/VitalRouter.MRuby.Native.a
Binary file not shown.
Binary file modified
BIN
+11.3 KB
(100%)
...lRouter.Unity/Assets/VitalRouter.MRuby/Runtime/Plugins/ios-x64/VitalRouter.MRuby.Native.a
Binary file not shown.
Binary file modified
BIN
+24.6 KB
(100%)
...er.Unity/Assets/VitalRouter.MRuby/Runtime/Plugins/linux-arm64/VitalRouter.MRuby.Native.so
Binary file not shown.
Binary file modified
BIN
+24.7 KB
(100%)
...uter.Unity/Assets/VitalRouter.MRuby/Runtime/Plugins/linux-x64/VitalRouter.MRuby.Native.so
Binary file not shown.
Binary file modified
BIN
+784 Bytes
(100%)
...Unity/Assets/VitalRouter.MRuby/Runtime/Plugins/macOS-arm64/VitalRouter.MRuby.Native.dylib
Binary file not shown.
Binary file modified
BIN
+784 Bytes
(100%)
...y/Assets/VitalRouter.MRuby/Runtime/Plugins/macOS-universal/VitalRouter.MRuby.Native.dylib
Binary file not shown.
Binary file modified
BIN
+800 Bytes
(100%)
...r.Unity/Assets/VitalRouter.MRuby/Runtime/Plugins/macOS-x64/VitalRouter.MRuby.Native.dylib
Binary file not shown.
Binary file modified
BIN
+48.7 KB
(100%)
....Unity/Assets/VitalRouter.MRuby/Runtime/Plugins/visionos-arm64/VitalRouter.MRuby.Native.a
Binary file not shown.
Binary file modified
BIN
+10.1 KB
(100%)
...er.Unity/Assets/VitalRouter.MRuby/Runtime/Plugins/visionos-x64/VitalRouter.MRuby.Native.a
Binary file not shown.
Binary file modified
BIN
+55.6 KB
(100%)
...italRouter.Unity/Assets/VitalRouter.MRuby/Runtime/Plugins/wasm/VitalRouter.MRuby.Native.a
Binary file not shown.
Binary file modified
BIN
-56.1 KB
(97%)
...r.Unity/Assets/VitalRouter.MRuby/Runtime/Plugins/windows-x64/VitalRouter.MRuby.Native.dll
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
95 changes: 95 additions & 0 deletions
95
src/VitalRouter.Unity/Assets/VitalRouter.Tests/MrbValueTest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
#if UNITY_2022_2_OR_NEWER | ||
using NUnit.Framework; | ||
using VitalRouter.MRuby; | ||
|
||
namespace VitalRouter.Tests | ||
{ | ||
[TestFixture] | ||
public class MrbValueTest | ||
{ | ||
[Test] | ||
public void Nil() | ||
{ | ||
using var context = MRubyContext.Create(); | ||
var value = context.EvaluateUnsafe("nil").RawValue; | ||
Assert.That(value.IsNil, Is.True); | ||
} | ||
|
||
[Test] | ||
public void False() | ||
{ | ||
using var context = MRubyContext.Create(); | ||
var value = context.EvaluateUnsafe("false").RawValue; | ||
Assert.That(value.IsFalse, Is.EqualTo(true)); | ||
Assert.That(value.TT, Is.EqualTo(MrbVtype.MRB_TT_FALSE)); | ||
} | ||
|
||
[Test] | ||
public void True() | ||
{ | ||
using var context = MRubyContext.Create(); | ||
var value = context.EvaluateUnsafe("true").RawValue; | ||
Assert.That(value.IsTrue, Is.EqualTo(true)); | ||
Assert.That(value.TT, Is.EqualTo(MrbVtype.MRB_TT_TRUE)); | ||
} | ||
|
||
[Test] | ||
public void Symbol() | ||
{ | ||
using var context = MRubyContext.Create(); | ||
var value = context.EvaluateUnsafe(":abc").RawValue; | ||
Assert.That(value.IsSymbol, Is.EqualTo(true)); | ||
Assert.That(value.TT, Is.EqualTo(MrbVtype.MRB_TT_SYMBOL)); | ||
Assert.That(value.ToString(context), Is.EqualTo("abc")); | ||
} | ||
|
||
[Test] | ||
public void String() | ||
{ | ||
using var context = MRubyContext.Create(); | ||
var value = context.EvaluateUnsafe("'aiueo'").RawValue; | ||
Assert.That(value.IsObject, Is.EqualTo(true)); | ||
Assert.That(value.TT, Is.EqualTo(MrbVtype.MRB_TT_STRING)); | ||
Assert.That(value.ToString(context), Is.EqualTo("aiueo")); | ||
} | ||
|
||
[Test] | ||
public void Int64Max() | ||
{ | ||
using var context = MRubyContext.Create(); | ||
var value = context.EvaluateUnsafe("9223372036854775807").RawValue; | ||
Assert.That(value.IntValue, Is.EqualTo(9223372036854775807)); | ||
Assert.That(value.IsFixnum, Is.False); | ||
Assert.That(value.TT, Is.EqualTo(MrbVtype.MRB_TT_INTEGER)); | ||
} | ||
|
||
[Test] | ||
public void Float() | ||
{ | ||
using var context = MRubyContext.Create(); | ||
var value = context.EvaluateUnsafe("0.1234567").RawValue; | ||
Assert.That(value.FloatValue, Is.EqualTo(0.1234567)); | ||
Assert.That(value.IsFloat, Is.True); | ||
Assert.That(value.TT, Is.EqualTo(MrbVtype.MRB_TT_FLOAT)); | ||
} | ||
|
||
[Test] | ||
public void Array() | ||
{ | ||
using var context = MRubyContext.Create(); | ||
var value = context.EvaluateUnsafe("[1]").RawValue; | ||
Assert.That(value.IsObject, Is.True); | ||
Assert.That(value.TT, Is.EqualTo(MrbVtype.MRB_TT_ARRAY)); | ||
} | ||
|
||
[Test] | ||
public void Hash() | ||
{ | ||
using var context = MRubyContext.Create(); | ||
var value = context.EvaluateUnsafe("{ a: 1 }").RawValue; | ||
Assert.That(value.IsObject, Is.True); | ||
Assert.That(value.TT, Is.EqualTo(MrbVtype.MRB_TT_HASH)); | ||
} | ||
} | ||
} | ||
#endif |
3 changes: 3 additions & 0 deletions
3
src/VitalRouter.Unity/Assets/VitalRouter.Tests/MrbValueTest.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.