File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
PythonSourceGenerator.Tests Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ public void TokenizeWithDefaultValue()
4545 PythonSignatureTokens . PythonSignatureToken . Colon ,
4646 PythonSignatureTokens . PythonSignatureToken . Identifier ,
4747 PythonSignatureTokens . PythonSignatureToken . Equal ,
48+ PythonSignatureTokens . PythonSignatureToken . String ,
4849 PythonSignatureTokens . PythonSignatureToken . CloseParenthesis ,
4950 PythonSignatureTokens . PythonSignatureToken . Arrow ,
5051 PythonSignatureTokens . PythonSignatureToken . Identifier ,
@@ -80,6 +81,16 @@ public void ParseFunctionParameterNoType()
8081 Assert . Null ( result . Value . Type ) ;
8182 }
8283
84+ [ Fact ]
85+ public void ParseFunctionParameterDefault ( )
86+ {
87+ var tokens = PythonSignatureTokenizer . Tokenize ( "a = 1" ) ;
88+ var result = PythonSignatureParser . PythonParameterTokenizer . TryParse ( tokens ) ;
89+ Assert . True ( result . HasValue ) ;
90+ Assert . Equal ( "a" , result . Value . Name ) ;
91+ Assert . Null ( result . Value . Type ) ;
92+ }
93+
8394 [ Fact ]
8495 public void ParseFunctionParameterListEasy ( )
8596 {
Original file line number Diff line number Diff line change 1- using Microsoft . CodeAnalysis . CSharp . Syntax ;
2- using PythonSourceGenerator . Reflection ;
1+ using PythonSourceGenerator . Reflection ;
32
43namespace PythonSourceGenerator . Tests ;
54
You can’t perform that action at this time.
0 commit comments