Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Change StringConcatenation for grammar tests(Using unix line endings in tests)
Change StringConcatenation for grammar tests [message #1844831] Mon, 27 September 2021 14:00 Go to next message
Horacio Hoyos is currently offline Horacio HoyosFriend
Messages: 220
Registered: October 2009
Location: Mexico
Senior Member

Hello,

My grammar is intended for unix usage, so we only support unix line endings.

When writing tests, I noticed that I am getting errors related to additional <CR> tokens.

Is there a way I can change the StringConcatenation used by the xtend Junit tests? Or is there another way to change the newline character used by template expressions?

Thanks,


Horacio Hoyos Rodriguez
Kinori Tech
Need professional support for Epsilon, EMF?
Go to: https://kinori.tech
Re: Change StringConcatenation for grammar tests [message #1844833 is a reply to message #1844831] Mon, 27 September 2021 14:50 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14101
Registered: July 2009
Senior Member
you can either use String.toUnix.... in the tests or something like

		val v = new StringConcatenation("\n")
		v.append('''
		this
		is
		a
		test
		''')


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Change StringConcatenation for grammar tests [message #1844870 is a reply to message #1844833] Tue, 28 September 2021 11:48 Go to previous message
Horacio Hoyos is currently offline Horacio HoyosFriend
Messages: 220
Registered: October 2009
Location: Mexico
Senior Member

Worked perfectly, thanks!

Horacio Hoyos Rodriguez
Kinori Tech
Need professional support for Epsilon, EMF?
Go to: https://kinori.tech
Previous Topic:Extending XtextBuilder for two DSLs
Next Topic:Namespace import no longer works since XText 2.21.0
Goto Forum:
  


Current Time: Sun Nov 28 18:04:20 GMT 2021

Powered by FUDForum. Page generated in 0.02321 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top