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

Add float support to sleep() #498

Merged
merged 2 commits into from
Nov 19, 2017

Conversation

64kramsystem
Copy link
Member

Add float support, and also improve the error handling.

@64kramsystem 64kramsystem self-assigned this Nov 1, 2017
@ghost ghost added the in progress label Nov 1, 2017
@64kramsystem 64kramsystem requested a review from st0012 November 1, 2017 22:49
@64kramsystem
Copy link
Member Author

@st0012 I couldn't find any existing UT for this method, so I haven't added any (I'm not sure if there is a reason for it).

@codecov
Copy link

codecov bot commented Nov 1, 2017

Codecov Report

Merging #498 into master will decrease coverage by 0.1%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #498      +/-   ##
==========================================
- Coverage   83.45%   83.35%   -0.11%     
==========================================
  Files          52       52              
  Lines        9123     9134      +11     
==========================================
  Hits         7614     7614              
- Misses       1273     1284      +11     
  Partials      236      236
Impacted Files Coverage Δ
vm/class.go 84.99% <0%> (-1.56%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 08fa001...7ee8679. Read the comment docs.

@64kramsystem 64kramsystem mentioned this pull request Nov 1, 2017
@64kramsystem 64kramsystem force-pushed the sm-add_float_support_to_sleep branch from cca4526 to d077a16 Compare November 16, 2017 17:50
@64kramsystem
Copy link
Member Author

@st0012 what's your take about this? If merged, I would rebase #493 on top of it, so I can make the sleep intervals much smaller.

@st0012
Copy link
Member

st0012 commented Nov 17, 2017

@saveriomiroddi I'd merge this once the coverage issue is fixed

@64kramsystem
Copy link
Member Author

👍

@ghost ghost assigned st0012 Nov 17, 2017
Also improved the error handling, that would otherwise panic when not receiving the expected data type.
@64kramsystem 64kramsystem force-pushed the sm-add_float_support_to_sleep branch from 7ab3511 to 8ee02ad Compare November 17, 2017 17:27
@st0012
Copy link
Member

st0012 commented Nov 17, 2017

@saveriomiroddi Can you take a look at this CI failure? I think it's because I clicked on update branch but I have no right to write your fork.
So you can rebase this on master and merge it if the CI passed.

vm/class.go Outdated
float, ok := args[0].(*FloatObject)

if ok {
nanoseconds := int64(float.value * 1000000000)
Copy link
Member

Choose a reason for hiding this comment

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

Can this number be set as a constant?

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmmm, there may be a more idiomatic way to express that. Hold on, I will check if I can improve it.

@64kramsystem
Copy link
Member Author

There you go, I've found a more expressive way for that statement.

@st0012 st0012 merged commit dbe45c1 into goby-lang:master Nov 19, 2017
@ghost ghost removed the in progress label Nov 19, 2017
@64kramsystem 64kramsystem deleted the sm-add_float_support_to_sleep branch January 10, 2018 21:36
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.

2 participants