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

Already on GitHub? Sign in to your account

Strings containing % #58

Open
rejeep opened this Issue Apr 6, 2012 · 14 comments

Comments

Projects
None yet
3 participants
Contributor

rejeep commented Apr 6, 2012

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)
Contributor

rejeep commented Nov 25, 2012

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

@rejeep rejeep referenced this issue in ecukes/espuds Apr 4, 2013

Closed

Inserting literal % with "Given I insert" #13

Contributor

magnars commented Apr 4, 2013

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

Contributor

rejeep commented Apr 4, 2013

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

Contributor

magnars commented Apr 4, 2013

How about escaping input strings before using them in format?

Contributor

rejeep commented Apr 5, 2013

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

Contributor

magnars commented Apr 5, 2013

You are not in control of all the format calls?

Contributor

rejeep commented Apr 5, 2013

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... :)

Contributor

magnars commented Apr 5, 2013

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))

Contributor

rejeep commented Apr 6, 2013

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

Contributor

magnars commented Apr 6, 2013

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?

Contributor

rejeep commented Apr 9, 2013

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 :)

Contributor

rejeep commented Apr 22, 2013

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

Contributor

magnars commented Apr 22, 2013

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

rejeep referenced this issue Oct 28, 2013

Read table cells as strings.
This will for example allow newlines in the cells using \n.

@benedekfazekas benedekfazekas referenced this issue in clojure-emacs/clj-refactor.el Apr 9, 2016

Merged

[Fix #313] `pf` doesn't understand %& #327

Contributor

AdrieanKhisbe commented Sep 24, 2017

I think I come up with a solution:
#169

it's working on the step definition I had

(I discovered the thread after the PR I made)

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