Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apostrophes are not permitted in test attributes #3372

Closed
kevaundray opened this issue Oct 31, 2023 · 2 comments · Fixed by #3733
Closed

Apostrophes are not permitted in test attributes #3372

kevaundray opened this issue Oct 31, 2023 · 2 comments · Fixed by #3733
Labels
bug Something isn't working

Comments

@kevaundray
Copy link
Contributor

kevaundray commented Oct 31, 2023

Aim

#[test(should_fail_with = "this can't compile")]
fn test_speech_mark_gets_escaped() {
    assert_eq(0, 1, "this can't compile");
}

Expected Behavior

It to compile the test

Bug

We get "Malformed function attribute" due to the ' (apostrophe) being used.

To Reproduce

Installation Method

None

Nargo Version

No response

Additional Context

No response

Would you like to submit a PR for this Issue?

No

Support Needs

No response

@kevaundray kevaundray added bug Something isn't working P-LOW labels Oct 31, 2023
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Noir Oct 31, 2023
@ghost ghost mentioned this issue Oct 31, 2023
5 tasks
@jfecher jfecher changed the title Speech marks are not permitted in test attributes Apostrophes are not permitted in test attributes Oct 31, 2023
@sambarnes
Copy link
Contributor

sambarnes commented Dec 7, 2023

not too important but i found this is also the case with some of these characters .!?%^

happy to pr for some of the common punctuation if yall are open to it

error: Malformed function attribute
   ┌─ /home/sam/dev/noir-by-example/circuits/examples/assert/src/main.nr:18:1
   │
18 │ #[test(should_fail_with = "Must sum to three.")]
   │ ------------------------------------------------  test(should_fail_with = "Must sum to three.") is not a valid attribute
   │

Aborting due to 1 previous error

edit: im on 0.19.4 currently

@kevaundray
Copy link
Contributor Author

not too important but i found this is also the case with some of these characters .!?%^

happy to pr for some of the common punctuation if yall are open to it

error: Malformed function attribute
   ┌─ /home/sam/dev/noir-by-example/circuits/examples/assert/src/main.nr:18:1
   │
18 │ #[test(should_fail_with = "Must sum to three.")]
   │ ------------------------------------------------  test(should_fail_with = "Must sum to three.") is not a valid attribute
   │

Aborting due to 1 previous error

edit: im on 0.19.4 currently

Great catch -- Please feel free to make a PR!

github-merge-queue bot pushed a commit that referenced this issue Dec 9, 2023
# Description

was onboarding this morning to tackle [a quick issue over
here](#3372)

and noticed this link broke in the top level README

https://github.com/noir-lang/noir?tab=readme-ov-file#working-on-this-project

## Documentation\*

Check one:
- [x] No documentation needed.
- [ ] Documentation included in this PR.
- [ ] **[Exceptional Case]** Documentation to be submitted in a separate
PR.

# PR Checklist\*

- [x] I have tested the changes locally.
- [x] I have formatted the changes with [Prettier](https://prettier.io/)
and/or `cargo fmt` on default settings.

Co-authored-by: kevaundray <kevtheappdev@gmail.com>
github-merge-queue bot pushed a commit that referenced this issue Dec 9, 2023
# Description

spotted an issue with punctuation inside a `#[test(should_fail_with =
"")]` block ([comment on original
issue](#3372 (comment)))

## Problem\*

Resolves #3372 (an extension of this original issue)

## Summary\*

I built off of the original work done over here #3374 but simplified
things down to just cover all common punctuation

## Documentation\*

Check one:
- [x] No documentation needed.
- [ ] Documentation included in this PR.
- [ ] **[Exceptional Case]** Documentation to be submitted in a separate
PR.

# PR Checklist\*

- [x] I have tested the changes locally.
- [x] I have formatted the changes with [Prettier](https://prettier.io/)
and/or `cargo fmt` on default settings.

---------

Co-authored-by: kevaundray <kevtheappdev@gmail.com>
@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in Noir Dec 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants