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

Cannot use in/out on parameters, cannot return values #2

Open
Lucretia opened this issue Apr 14, 2021 · 4 comments
Open

Cannot use in/out on parameters, cannot return values #2

Lucretia opened this issue Apr 14, 2021 · 4 comments

Comments

@Lucretia
Copy link

Lucretia commented Apr 14, 2021

There are some issues I don't know how to work out.

  1. gnatbdd copies the in out specification to the generated source. See below, I would put in String normally.

  2. How do you handle return values? 'a' below?

    -- @given ^a ← tuple((\d+.\d+), (\d+.\d+), (\d+.\d+), (\d+.\d+))$
    procedure Given_A_Tuple (A : out Tuple; X, Y, Z, W : String);

@Lucretia Lucretia changed the title Cannot use in/out on parameters Cannot use in/out on parameters, cannot return values Apr 14, 2021
@Lucretia
Copy link
Author

Ok, so it seems you can only use procedures and not functions and you have to create local variables in the steps packages as context. This really should be documented.

@briot
Copy link
Owner

briot commented Apr 15, 2021

I will happily look at pull requests (and very likely accept them, since I haven't done anything with this project for years)

@briot
Copy link
Owner

briot commented Apr 15, 2021

I think this is indeed one of the drawbacks of this whole approach, the use of global variables for the tests. It would be nicer to have some notion of context somewhere, which users could extend and that would be passed to all the "@given", "@then" and "@when" procedures

@Lucretia
Copy link
Author

From what I've seen on the Cucumber site, some languages do provide a context, I think Python is one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants