From 2bbd601a8a42be68a8a67de66866c7a02ad7a64f Mon Sep 17 00:00:00 2001 From: winscripter <142818255+winscripter@users.noreply.github.com> Date: Wed, 24 Jul 2024 20:09:08 +0400 Subject: [PATCH] Fix syntax error in PermissionSetTests.cs --- ILSourceParser.Tests/PermissionSetTests.cs | 100 ++++++++++----------- 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/ILSourceParser.Tests/PermissionSetTests.cs b/ILSourceParser.Tests/PermissionSetTests.cs index 6cb8224..8277320 100644 --- a/ILSourceParser.Tests/PermissionSetTests.cs +++ b/ILSourceParser.Tests/PermissionSetTests.cs @@ -1,50 +1,50 @@ -using ILSourceParser.Common; -using ILSourceParser.Syntax; -using ILSourceParser.Utilities; -using Sprache; - -namespace ILSourceParser.Tests; - -public class PermissionSetTests -{ - private static readonly byte[] s_complexCustomAttributePermissionSetDescendantByteData = - [ - 0x2e, 0x01, 0x80, 0x8a, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x53, 0x65, 0x63, - 0x75, 0x72, 0x69, 0x74, 0x79, 0x2e, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x73, 0x2e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x50, 0x65, - 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, - 0x75, 0x74, 0x65, 0x2c, 0x20, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x52, 0x75, - 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2c, 0x20, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, - 0x3d, 0x38, 0x2e, 0x30, 0x2e, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x43, 0x75, 0x6c, 0x74, - 0x75, 0x72, 0x65, 0x3d, 0x6e, 0x65, 0x75, 0x74, 0x72, 0x61, 0x6c, 0x2c, 0x20, 0x50, - 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x3d, - 0x62, 0x30, 0x33, 0x66, 0x35, 0x66, 0x37, 0x66, 0x31, 0x31, 0x64, 0x35, 0x30, 0x61, - 0x33, 0x61, 0x15, 0x01, 0x54, 0x02, 0x10, 0x53, 0x6b, 0x69, 0x70, 0x56, 0x65, 0x72, - 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x01 - ]; - - [Fact] - public void Test() - { - var permissionSetParser = new Parser().ParsePermissionSet(); - const string input = @" - .permissionset reqmin = ( - 2e 01 80 8a 53 79 73 74 65 6d 2e 53 65 63 75 72 - 69 74 79 2e 50 65 72 6d 69 73 73 69 6f 6e 73 2e - 53 65 63 75 72 69 74 79 50 65 72 6d 69 73 73 69 - 6f 6e 41 74 74 72 69 62 75 74 65 2c 20 53 79 73 - 74 65 6d 2e 52 75 6e 74 69 6d 65 2c 20 56 65 72 - 73 69 6f 6e 3d 38 2e 30 2e 30 2e 30 2c 20 43 75 - 6c 74 75 72 65 3d 6e 65 75 74 72 61 6c 2c 20 50 - 75 62 6c 69 63 4b 65 79 54 6f 6b 65 6e 3d 62 30 - 33 66 35 66 37 66 31 31 64 35 30 61 33 61 15 01 - 54 02 10 53 6b 69 70 56 65 72 69 66 69 63 61 74 - 69 6f 6e 01 - )"; - var element = permissionSetParser.Parse(input); - - Assert.Equal(SecurityAction.ReqMin, element.SecurityAction); - Assert.True(element.GetRawBytes().SequenceEqual( - s_complexCustomAttributePermissionSetDescendantByteData)); - } -} +using ILSourceParser.Common; +using ILSourceParser.Syntax; +using ILSourceParser.Utilities; +using Sprache; + +namespace ILSourceParser.Tests; + +public class PermissionSetTests +{ + private static readonly byte[] s_complexCustomAttributePermissionSetDescendantByteData = + [ + 0x2e, 0x01, 0x80, 0x8a, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x53, 0x65, 0x63, + 0x75, 0x72, 0x69, 0x74, 0x79, 0x2e, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x73, 0x2e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x50, 0x65, + 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, + 0x75, 0x74, 0x65, 0x2c, 0x20, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x52, 0x75, + 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2c, 0x20, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x3d, 0x38, 0x2e, 0x30, 0x2e, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x43, 0x75, 0x6c, 0x74, + 0x75, 0x72, 0x65, 0x3d, 0x6e, 0x65, 0x75, 0x74, 0x72, 0x61, 0x6c, 0x2c, 0x20, 0x50, + 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x3d, + 0x62, 0x30, 0x33, 0x66, 0x35, 0x66, 0x37, 0x66, 0x31, 0x31, 0x64, 0x35, 0x30, 0x61, + 0x33, 0x61, 0x15, 0x01, 0x54, 0x02, 0x10, 0x53, 0x6b, 0x69, 0x70, 0x56, 0x65, 0x72, + 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x01 + ]; + + [Fact] + public void Test() + { + var permissionSetParser = Parser.ParsePermissionSet(); + const string input = @" + .permissionset reqmin = ( + 2e 01 80 8a 53 79 73 74 65 6d 2e 53 65 63 75 72 + 69 74 79 2e 50 65 72 6d 69 73 73 69 6f 6e 73 2e + 53 65 63 75 72 69 74 79 50 65 72 6d 69 73 73 69 + 6f 6e 41 74 74 72 69 62 75 74 65 2c 20 53 79 73 + 74 65 6d 2e 52 75 6e 74 69 6d 65 2c 20 56 65 72 + 73 69 6f 6e 3d 38 2e 30 2e 30 2e 30 2c 20 43 75 + 6c 74 75 72 65 3d 6e 65 75 74 72 61 6c 2c 20 50 + 75 62 6c 69 63 4b 65 79 54 6f 6b 65 6e 3d 62 30 + 33 66 35 66 37 66 31 31 64 35 30 61 33 61 15 01 + 54 02 10 53 6b 69 70 56 65 72 69 66 69 63 61 74 + 69 6f 6e 01 + )"; + var element = permissionSetParser.Parse(input); + + Assert.Equal(SecurityAction.ReqMin, element.SecurityAction); + Assert.True(element.GetRawBytes().SequenceEqual( + s_complexCustomAttributePermissionSetDescendantByteData)); + } +}