From 26bc21681f3c9aaa338e80d34d155e1ccf0c86af Mon Sep 17 00:00:00 2001 From: routersys Date: Sat, 27 Jun 2026 12:23:09 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=AA=E3=83=BC=E3=83=88=E3=83=AB=E3=83=BC?= =?UTF-8?q?=E3=83=86=E3=82=A3=E3=83=B3=E3=82=B0=E3=81=AE=E3=83=86=E3=82=B9?= =?UTF-8?q?=E3=83=88=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LuaScript.Tests/ScriptDirectiveTests.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/LuaScript.Tests/ScriptDirectiveTests.cs b/LuaScript.Tests/ScriptDirectiveTests.cs index a785194..735394a 100644 --- a/LuaScript.Tests/ScriptDirectiveTests.cs +++ b/LuaScript.Tests/ScriptDirectiveTests.cs @@ -29,5 +29,17 @@ namespace LuaScript.Tests { Assert.Equal("Native", ScriptDirective.Resolve("--!native\n--!gpu").ToString()); } + + [Theory] + [InlineData("obj.rz = time * 90", "MoonSharp")] + [InlineData("local r,g,b,a = obj.getpixel(0,0)", "Native")] + [InlineData("obj.setpixel(0,0,255,0,0)", "Native")] + [InlineData("local pd = obj.getpixeldata()", "Native")] + [InlineData("--!moonsharp\nobj.setpixel(0,0,1,1,1)", "MoonSharp")] + [InlineData("--!native\nobj.rz = 1", "Native")] + public void ResolveAuto_RoutesPixelScriptsToNative(string script, string expected) + { + Assert.Equal(expected, ScriptDirective.ResolveAuto(script).ToString()); + } } }