@@ -99,6 +99,75 @@ public async Task ProfileExpressionEvaluatorLogPathLocationReferenceExpressionsA
9999 }
100100 }
101101
102+ [ Test ]
103+ public async Task ProfileExpressionEvaluatorSupportsWellKnownExpressionStatePathReferencesOnUnixSystems ( )
104+ {
105+ this . SetupDefaults ( PlatformID . Unix ) ;
106+ string stateDirectory = this . mockFixture . GetStatePath ( ) ;
107+ string stateFilePath = this . mockFixture . GetStatePath ( "anylogs" , "file1.log" ) ;
108+
109+ Dictionary < string , string > expressions = new Dictionary < string , string >
110+ {
111+ { "{StatePath}" , stateDirectory } ,
112+ { "{StateDir}" , stateDirectory } ,
113+ { "--any-path={StatePath}/anylogs/file1.log" , $ "--any-path={ stateFilePath } " } ,
114+ { "--any-path={StateDir}/anylogs/file1.log" , $ "--any-path={ stateFilePath } " }
115+ } ;
116+
117+ foreach ( var entry in expressions )
118+ {
119+ string expectedExpression = entry . Value ;
120+ string actualExpression = await ProfileExpressionEvaluator . Instance . EvaluateAsync ( this . mockFixture . Dependencies , entry . Key ) ;
121+ Assert . AreEqual ( expectedExpression , actualExpression ) ;
122+ }
123+ }
124+
125+ [ Test ]
126+ public async Task ProfileExpressionEvaluatorSupportsWellKnownExpressionStatePathReferencesOnWindowsSystems ( )
127+ {
128+ this . SetupDefaults ( PlatformID . Win32NT ) ;
129+ string stateDirectory = this . mockFixture . GetStatePath ( ) ;
130+ string stateFilePath = this . mockFixture . GetStatePath ( "anylogs" , "file1.log" ) ;
131+
132+ Dictionary < string , string > expressions = new Dictionary < string , string >
133+ {
134+ { "{StatePath}" , stateDirectory } ,
135+ { "{StateDir}" , stateDirectory } ,
136+ { "--any-path={StatePath}/anylogs/file1.log" , $ "--any-path={ stateFilePath } " } ,
137+ { "--any-path={StateDir}/anylogs/file1.log" , $ "--any-path={ stateFilePath } " }
138+ } ;
139+
140+ foreach ( var entry in expressions )
141+ {
142+ string expectedExpression = entry . Value ;
143+ string actualExpression = await ProfileExpressionEvaluator . Instance . EvaluateAsync ( this . mockFixture . Dependencies , entry . Key ) ;
144+ Assert . AreEqual ( expectedExpression , actualExpression ) ;
145+ }
146+ }
147+
148+ [ Test ]
149+ public async Task ProfileExpressionEvaluatorStatePathLocationReferenceExpressionsAreNotCaseSensitive ( )
150+ {
151+ this . SetupDefaults ( PlatformID . Unix ) ;
152+ string stateDirectory = this . mockFixture . GetStatePath ( ) ;
153+
154+ Dictionary < string , string > expressions = new Dictionary < string , string >
155+ {
156+ { "{StatePath}" , stateDirectory } ,
157+ { "{statepath}" , stateDirectory } ,
158+ { "{statedir}" , stateDirectory } ,
159+ { "{STATEPATH}" , stateDirectory } ,
160+ { "{STATEDIR}" , stateDirectory }
161+ } ;
162+
163+ foreach ( var entry in expressions )
164+ {
165+ string expectedExpression = entry . Value ;
166+ string actualExpression = await ProfileExpressionEvaluator . Instance . EvaluateAsync ( this . mockFixture . Dependencies , entry . Key ) ;
167+ Assert . AreEqual ( expectedExpression , actualExpression ) ;
168+ }
169+ }
170+
102171 [ Test ]
103172 public async Task ProfileExpressionEvaluatorSupportsWellKnownExpressionTempPathReferencesOnUnixSystems ( )
104173 {
0 commit comments