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

Make PrimitiveRenderTypes correctly output long values with tests #58

Closed
wants to merge 2 commits into from

Conversation

omrihq
Copy link
Contributor

@omrihq omrihq commented Oct 4, 2018

This addresses #45

@mateor mateor requested a review from iantabolt October 5, 2018 12:33
@@ -8,7 +8,12 @@

object ${baseName}Constants {
#for (const <- constants)
<% val value = const.valueOption.map{v => "val %s: %s = %s".format(const.name, const.renderType.text, v)} %>
<% val value = const.valueOption.map{v => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm thinking we should move this higher up, either in ScalaConst.valueOption or better PrimitiveRenderType.renderValue. Is there ever a time where we don't want the L?

@iantabolt
Copy link
Contributor

Thanks for this! Can you add a test? I think it would go in test/thrift/io/fsq/spindle/codegen/runtime/constants/test/gen/constantine.thrift and test/jvm/io/fsq/spindle/codegen/runtime/test/ScalaConstTest.scala.

@omrihq omrihq changed the title Make constant.ssp correctly output long values Make PrimitiveRenderTypes correctly output long values with tests Oct 5, 2018
@@ -9,6 +9,7 @@ class ScalaConstTest {
@Test
def testConstantGeneration(): Unit = {
A.assertEquals(List(1.2, 2.1, 1.1), ConstantineConstants.LISTCONST)
A.assertEquals(1000000000, ConstantineConstants.LONG)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This number is in range of integers so it doesn't confirm that the L worked. I think one more zero will do it (and then add the L so the test compiles)

@omrihq
Copy link
Contributor Author

omrihq commented Oct 5, 2018

Good catch, updated

@mateor
Copy link
Contributor

mateor commented Apr 16, 2019

Patch was accepted and is live in Fsq.io. Thank you!

fa5c61a

@mateor mateor closed this Apr 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants