Files
RobustToolbox/Robust.UnitTesting/Shared/Toolshed/ToolshedParserTest.Core.cs
Pieter-Jan Briers cdd3afaa4c Remove redundant custom math types (#6078)
Vector3, Vector4, Matrix4, and Quaternion are now gone. Use System.Numerics instead.

This commit is just replacing usages, cleaning up using declarations, and moving over the (couple) helpers that are actually important.
2025-07-23 01:15:27 +02:00

86 lines
3.0 KiB
C#

using System;
using System.Numerics;
using System.Threading.Tasks;
using NUnit.Framework;
using Robust.Shared.GameObjects;
using Robust.Shared.Maths;
using Robust.Shared.Toolshed.Syntax;
using Robust.Shared.Utility;
namespace Robust.UnitTesting.Shared.Toolshed;
public sealed partial class ToolshedParserTest
{
[Test]
public async Task AllCoreTypesParseable()
{
await Server.WaitAssertion(() =>
{
Assert.Multiple(() =>
{
// Integer types.
AssertParseable<byte>();
AssertParseable<sbyte>();
AssertParseable<short>();
AssertParseable<ushort>();
AssertParseable<int>();
AssertParseable<uint>();
AssertParseable<long>();
AssertParseable<ulong>();
AssertParseable<nint>();
AssertParseable<nuint>();
AssertParseable<BigInteger>();
AssertParseable<decimal>();
AssertParseable<Half>();
// Common
AssertParseable<bool>();
AssertParseable<string>();
AssertParseable<EntityUid>();
AssertParseable<ResPath>();
AssertParseable<Type>();
AssertParseable<TestEnum>();
// maff
AssertParseable<Vector2>();
AssertParseable<Vector2i>();
AssertParseable<Vector3>();
AssertParseable<Vector4>();
AssertParseable<Box2>();
AssertParseable<Box2i>();
AssertParseable<Angle>();
AssertParseable<Color>();
AssertParseable<Direction>();
AssertParseable<DirectionFlag>();
AssertParseable<UIBox2>();
AssertParseable<UIBox2i>();
// The tuples. *scream
AssertParseable<ValueTuple<int, int>>();
AssertParseable<ValueTuple<int, int, int>>();
AssertParseable<ValueTuple<int, int, int, int>>();
AssertParseable<ValueTuple<int, int, int, int, int>>();
AssertParseable<ValueTuple<int, int, int, int, int, int>>();
AssertParseable<ValueTuple<int, int, int, int, int, int, int>>();
// this line literally breaks rider, uncomment when it doesn't.
//AssertParseable<ValueTuple<int, int, int, int, int, int, int, ValueTuple>>();
// Toolshed special constructs.
AssertParseable<ValueRef<object>>();
AssertParseable<CommandRun>();
AssertParseable<CommandRun<object>>();
AssertParseable<CommandRun<object, object>>();
AssertParseable<Block>();
AssertParseable<Block<object>>();
AssertParseable<Block<object, object>>();
});
});
}
private enum TestEnum
{
A = 0,
B = 1
}
}