File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed
compiler/noirc_frontend/src/lexer Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -541,6 +541,20 @@ mod tests {
541541 ) ;
542542 }
543543
544+ #[ test]
545+ fn test_attribute_with_apostrophe ( ) {
546+ let input = r#"#[test(should_fail_with = "the eagle's feathers")]"# ;
547+ let mut lexer = Lexer :: new ( input) ;
548+
549+ let token = lexer. next_token ( ) . unwrap ( ) . token ( ) . clone ( ) ;
550+ assert_eq ! (
551+ token,
552+ Token :: Attribute ( Attribute :: Function ( FunctionAttribute :: Test (
553+ TestScope :: ShouldFailWith { reason: "the eagle's feathers" . to_owned( ) . into( ) }
554+ ) ) )
555+ ) ;
556+ }
557+
544558 #[ test]
545559 fn deprecated_attribute_with_note ( ) {
546560 let input = r#"#[deprecated("hello")]"# ;
Original file line number Diff line number Diff line change @@ -462,6 +462,7 @@ impl Attribute {
462462 || ch == '='
463463 || ch == '"'
464464 || ch == ' '
465+ || ch == '\''
465466 } )
466467 . then_some ( ( ) ) ;
467468
You can’t perform that action at this time.
0 commit comments