Commit e741b1d 1 parent 579c630 commit e741b1d Copy full SHA for e741b1d
File tree 1 file changed +27
-0
lines changed
1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -1143,6 +1143,33 @@ mod variable_lexer_tests {
1143
1143
) ;
1144
1144
}
1145
1145
1146
+ #[ test]
1147
+ fn test_lex_numeric_argument_scientific ( ) {
1148
+ let variable = " foo.bar|default:5.2e3 " ;
1149
+ let lexer = VariableLexer :: new ( variable, 0 ) ;
1150
+ let tokens: Vec < _ > = lexer. collect ( ) ;
1151
+ assert_eq ! (
1152
+ tokens,
1153
+ vec![
1154
+ Ok ( VariableToken {
1155
+ token_type: VariableTokenType :: Variable ,
1156
+ content: "foo.bar" ,
1157
+ at: ( 3 , 10 ) ,
1158
+ } ) ,
1159
+ Ok ( VariableToken {
1160
+ token_type: VariableTokenType :: Filter ,
1161
+ content: "default" ,
1162
+ at: ( 11 , 18 ) ,
1163
+ } ) ,
1164
+ Ok ( VariableToken {
1165
+ token_type: VariableTokenType :: Numeric ,
1166
+ content: "5.2e3" ,
1167
+ at: ( 19 , 24 ) ,
1168
+ } ) ,
1169
+ ]
1170
+ ) ;
1171
+ }
1172
+
1146
1173
#[ test]
1147
1174
fn test_lex_variable_argument ( ) {
1148
1175
let variable = " foo.bar|default:spam " ;
You can’t perform that action at this time.
0 commit comments