From 4ac25584b9e1406e8f5cbfb89521559af33b32cc Mon Sep 17 00:00:00 2001 From: routersys Date: Thu, 2 Jul 2026 08:01:52 +0900 Subject: [PATCH] =?UTF-8?q?=E6=97=A2=E5=AE=9A=E3=82=A8=E3=83=B3=E3=82=B8?= =?UTF-8?q?=E3=83=B3=E3=81=AEnative=E5=8C=96=E3=81=AB=E5=90=88=E3=82=8F?= =?UTF-8?q?=E3=81=9B=E3=81=A6=E3=83=AB=E3=83=BC=E3=83=86=E3=82=A3=E3=83=B3?= =?UTF-8?q?=E3=82=B0=E6=9C=9F=E5=BE=85=E5=80=A4=E3=82=92=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LuaScript.Tests/ScriptDirectiveTests.cs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/LuaScript.Tests/ScriptDirectiveTests.cs b/LuaScript.Tests/ScriptDirectiveTests.cs index d812e01..3a5d65f 100644 --- a/LuaScript.Tests/ScriptDirectiveTests.cs +++ b/LuaScript.Tests/ScriptDirectiveTests.cs @@ -31,18 +31,21 @@ namespace LuaScript.Tests } [Theory] - [InlineData("obj.rz = time * 90", "MoonSharp")] + [InlineData(null, "MoonSharp")] + [InlineData("", "MoonSharp")] + [InlineData("obj.rz = time * 90", "Native")] [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")] - [InlineData("obj.load(\"figure\", \"円\", 0xff0000, 100)", "MoonSharp")] - [InlineData("obj.load(\"figure\", \"円\", 0xff0000, 100)\nlocal r = obj.getpixel(0,0)", "Native")] - [InlineData("obj.draw()", "MoonSharp")] - [InlineData("obj.draw()\nlocal r = obj.getpixel(0,0)", "Native")] - [InlineData("--!native\nobj.load(\"figure\", \"円\", 0xff0000, 100)", "Native")] - public void ResolveAuto_RoutesPixelScriptsToNative(string script, string expected) + [InlineData("--!gpu\nfunction pixel() end", "Gpu")] + [InlineData("--!cpu\nfunction pixel() end", "Cpu")] + [InlineData("obj.load(\"figure\", \"円\", 0xff0000, 100)", "Native")] + [InlineData("obj.draw()", "Native")] + [InlineData("obj.setoption('blend', 1)", "Native")] + [InlineData("obj.setanchor('pos', 2)", "Native")] + public void ResolveAuto_DefaultsToNative(string? script, string expected) { Assert.Equal(expected, ScriptDirective.ResolveAuto(script).ToString()); }