Repository: dotnet/roslyn
File: src/Compilers/CSharp/Test/Syntax/Syntax/SyntaxFactoryTests.cs (C#)

Code before:
            var bracketedArgList = SyntaxFactory.ParseBracketedArgumentList("", options: parseOptions);
            Assert.Same(parseOptions, bracketedArgList.SyntaxTree.Options);

            var bracketedParamList = SyntaxFactory.ParseBracketedParameterList("", options: parseOptions);
            Assert.Same(parseOptions, bracketedParamList.SyntaxTree.Options);

            var compUnit = SyntaxFactory.ParseCompilationUnit("", options: parseOptions);
            Assert.Same(parseOptions, compUnit.SyntaxTree.Options);

            var expr = SyntaxFactory.ParseExpression("", options: parseOptions);
            Assert.Same(parseOptions, expr.SyntaxTree.Options);

            var memberDecl = SyntaxFactory.ParseMemberDeclaration("public", options: parseOptions);
            Assert.Same(parseOptions, memberDecl.SyntaxTree.Options);

            var paramList = SyntaxFactory.ParseParameterList("", options: parseOptions);
            Assert.Same(parseOptions, paramList.SyntaxTree.Options);

            var statement = SyntaxFactory.ParseStatement("", options: parseOptions);
            Assert.Same(parseOptions, statement.SyntaxTree.Options);

            var typeName = SyntaxFactory.ParseTypeName("", options: parseOptions);
            Assert.Same(parseOptions, typeName.SyntaxTree.Options);
        }

        [Fact, WorkItem("https://github.com/dotnet/roslyn/issues/8699")]
        public void TestParseAttributeArgumentListWithInvalidString()
        {
            // Regression test for issue where ParseAttributeArgumentList would throw NullReferenceException
            // when given an invalid string without parentheses
            var result = SyntaxFactory.ParseAttributeArgumentList("somethingWithoutBrackets");
            
            Assert.NotNull(result);
            Assert.True(result.GetDiagnostics().Any(), "Expected diagnostics for invalid input");
            
            // Verify the structure is as expected - should have missing open/close parens and errors
            Assert.True(result.OpenParenToken.IsMissing);
            Assert.True(result.CloseParenToken.IsMissing);
        }
    }
}


Review comment (suggestion):
```suggestion
        [Fact, WorkItem("https://github.com/dotnet/roslyn/issues/23877")]
```

Code after:
            var bracketedArgList = SyntaxFactory.ParseBracketedArgumentList("", options: parseOptions);
            Assert.Same(parseOptions, bracketedArgList.SyntaxTree.Options);

            var bracketedParamList = SyntaxFactory.ParseBracketedParameterList("", options: parseOptions);
            Assert.Same(parseOptions, bracketedParamList.SyntaxTree.Options);

            var compUnit = SyntaxFactory.ParseCompilationUnit("", options: parseOptions);
            Assert.Same(parseOptions, compUnit.SyntaxTree.Options);

            var expr = SyntaxFactory.ParseExpression("", options: parseOptions);
            Assert.Same(parseOptions, expr.SyntaxTree.Options);

            var memberDecl = SyntaxFactory.ParseMemberDeclaration("public", options: parseOptions);
            Assert.Same(parseOptions, memberDecl.SyntaxTree.Options);

            var paramList = SyntaxFactory.ParseParameterList("", options: parseOptions);
            Assert.Same(parseOptions, paramList.SyntaxTree.Options);

            var statement = SyntaxFactory.ParseStatement("", options: parseOptions);
            Assert.Same(parseOptions, statement.SyntaxTree.Options);

            var typeName = SyntaxFactory.ParseTypeName("", options: parseOptions);
            Assert.Same(parseOptions, typeName.SyntaxTree.Options);
        }
    }
}