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

Newline character inserted to input/output fields in function builder #108

Open
Daniel-Valentine opened this issue Sep 20, 2017 · 0 comments

Comments

@Daniel-Valentine
Copy link

After saving a function, the function builder appears to insert a newline character to the end of the input/output test fields. If I'm not careful enough with how I take types into consideration, this can cause the function to fail execution.

For example, here's a python script to calculate the n-th Fibonacci number, with rudimentary input controlling to ensure that the input is only 1 number in size:

import sys

# only accept 1 argument
if len(sys.argv) > 2:
    raise Error

i = int(sys.argv[1])

f0 = 0
f1 = 1
ft = 0

while i > 0:
    i -= 1
    ft = f0 + f1
    f0 = f1
    f1 = ft

print ft

It works fine in the function builder...
screenshot_20170919_200816
...but once I save it, Clotho will claim that the function failed, and opening up the function shows that a newline character was inserted (the same holds true for the output field as well)
screenshot_20170919_200853

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

No branches or pull requests

1 participant