Ad
  • Custom User Avatar

    nvm, I missed the literal value injections. I still hold that it's a bad test since JS doesn't care about types of numbers so saying it must be a float is confusing, but I must have messed up something else.

  • Custom User Avatar

    Not sure, but letting dangling issues hanging around is not a good idea either.

    The relevant test is this:

    describe('Mean is returned as float', function(){
    
      tracker = new TempTracker();
    
      tracker.insert(1);
      tracker.insert(2);
      tracker.insert(4);
    
      var mean = tracker.getMean();
      Test.expect(Number(mean) && mean % 1 !== 0, 'getMean() didn\'t return a float. Returned: ' + mean);
    });
    

    So unless something is really messed up it shouldn't fail. It doesn't even check the result is the same as the expected value.

  • Custom User Avatar

    Well considering that JavaScript does not actually have floats, or more specifically everything is a float, (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures), there is an issue with the construction of the tests or at least the phrasing of them. Since testing if something is a float is literally testing if it's a number, this test must be doing something else. Sadly, I have not used this site in nearly 3 years so don't know what I actually coded back then, but I assue you there was good reason for my frustration.

    As a related question - I seem to recall this site being very new at that time. Was "question" even an option then vs. issue?

  • Custom User Avatar

    Your "issue" is useless and isn't really a issue (it's a question) either ;-)

    Next time if you can't get through a specific part, mark it as a question and not an issue. I'm resolving it because it's not an issue, and I said no because the situation you're describing is not possible unless there are dumb mistakes in your code (I solved it so I can see the tests), and without your code that's the only possible response.

    Remeber: 99% of the "issues" comes from your own end unless you're experienced ;-)

  • Custom User Avatar

    Impressively useless response! So glad that you were able to mark the issue "resolved" by doing that. /facepalm

  • Custom User Avatar
  • Custom User Avatar

    Why "79999997"? Nothing should happen there, just as with "78987".

  • Custom User Avatar

    Actually, running "797" repleace exactly twice will solve the test case 797979797979797979797979.

    But I agree with you to add test case 799999997

  • Custom User Avatar

    If you try again.. are the tests changed or fixed? Also When I ran it it seems to work fine?

  • Custom User Avatar

    It errored out with "some is not a fuction". So unless there was a requirement I didn't see to implement something that had a function on it called "some" that the test could call... then the tests were broken.

    Also, this was only the "user test" setion, the on-submit tests work fine (and, I notice, don't have the crazy setup).

    (Edit to note that this is for the Javascript version. It's possible the tests were ported badly from a functional language or something.)

  • Custom User Avatar

    That's not an issue the function is used to evaluate the correct result from your one.

  • Custom User Avatar

    Something was really messed up with the provided "user tests". I couldn't make heads or tales of them, so just deleted them and used the submit ones.

  • Custom User Avatar
  • Custom User Avatar

    1 significant problem, as illustrated by the top solution - your tests only have false cases that are negative or even. You need far more tests to prove a valid function. Consider a random test generator paired with a known-to-be-accurate solution, combined with several non-even false primes.

  • Custom User Avatar

    Very unhelpful response. What is missing that you needed?

  • Loading more items...