Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Strings containing % #58

Open
rejeep opened this Issue · 13 comments

2 participants

@rejeep
Owner

Cannot write steps like this:

When I insert "%(foo)"

This is because % is used when calling step definitions with arguments.

(Given "I am in buffer \"%s\"" buffer)
@rejeep
Owner

The issue is the printing, since format is used (a few times) when printing steps.

@rejeep rejeep referenced this issue in ecukes/espuds
Closed

Inserting literal % with "Given I insert" #13

@magnars

So the trick is knowing how many times format is used, so you can double up on % the correct number of times. Hehe. ;-)

@rejeep
Owner

Yes, that's why this issue has never been fixed. There's no decent solution.

@magnars

How about escaping input strings before using them in format?

@rejeep
Owner

I would still have to know how many times format is used.

@magnars

You are not in control of all the format calls?

@rejeep
Owner

Yes I am. So I could solve it. It's just that it's such an ugly solution that I've never been able to type it... :)

@magnars

Haha, I didn't mean it that way. Instead of doing %%%%%%%%, could you not escape the strings at each format point? (format "my %s something" (format-escape s))

@rejeep
Owner

What about stuff I need to format? Not sure I follow...

@magnars

Then you need to know at the point of format what you need to format, and what you don't. If you don't know that, it means you're sending strings through the system that may have unexpanded formatting options?

@rejeep
Owner

I don't remember exactly where this was a problem, I'll try to find out again. Easier to solve when we know the cause :)

@rejeep
Owner

Sorry that I'm not working on this, currently swamped... but I haven't forgotten about it.

@magnars

I know that feeling all to well. No worries, mate!

@rejeep rejeep referenced this issue from a commit
@rejeep rejeep Read table cells as strings.
This will for example allow newlines in the cells using \n.
e276f36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.