OPN Barrel - BSD license

Source code / Documentation

Current version: 0.0.5 / Upcoming release: 0.0.6


Original post

This barrel provides some helper functions to convert time, weight, distance and temperatures from the ISO world to the imperial world.

It also provides a couple of testing functions that I prefer over the current testing functions that Toybox provides, it is in fact because I'm waiting on:

https://forums.garmin.com/developer/connect-iq/i/bug-reports/test-methods-is-isnt-and-ok?CommentId=dee92ccb-2fd0-4e21-8f3a-2f03c4ca6b6e

and because Garmin has said in all their wisdom that printing out an got/expected is too much work for them. So I had to implement new test functions either way:

https://forums.garmin.com/developer/connect-iq/i/bug-reports/test-assertequalmessage-and-friends-to-show-incorrectness?CommentId=07f2d5ec-3daa-4c61-8166-700b61f3a055

And we also test Doubles a bit different and we can test for nulls with the is/isnt functions.

The test methods make the tests much nicer to read imo, as it is just plain english.

  t.is(1, 1, "One is one");
  t.isnt(1, 2, "One isn't two");

// versus

  t.assertEqualMessage(1, 1, "One is one");
  t.assertNotEqualMessage(1, 2, "One isn't two");

And you can actually see what went wrong:

Got: 1
Expect: 2


Error: Unhandled Exception
Exception: ASSERTION FAILED: Nope
Stack:
  - assertMessage() at e6eec51.mb:186 0x300057f6
  - assertEqualMessage() at e6eec51.mb:243 0x3000584b
  - is() at /tmp/OPN.barrel8573689546243066108/content/source/Test/More.mc:47 0x1000825e
  - testMatchLogic() at /home/ciq/src/source/t/TestMatch.mc:73 0x10001249
  - evaluate_test_entries_0_to_29() at UnitTests:78 0x100003ef
  - runTest() at UnitTests:165 0x10000839
ERROR

  • I didn’t say it wasn’t there  I said it was a better place for it.

    Very soon, no one will ever really read or find it in this subforum. That’s one reason it doesn’t matter that it’s here.

    I said to keep it here. 

  • So, there is a fairly explicit rule/guideline about it.


    My point was that, by practice and custom, no one writes about barrels here. That is, there’s an unwritten rule, at least, about it. So, waterkip would still be kind of breaking the rules. 

    It doesn’t matter if it’s here. It’s just not a useful place for it (except briefly).

    Certainly, no one is going to think to look for it here and there really won’t be any chance of anybody coming across it (except for a week or so). The problem of it being misplaced will solve itself. 

  • Its not. A barrel showcase isnt for Bug/Feature requests. It isnt a discussion nor is it a question. The only logical place is here. Have a good weekend.

    Kisses,

    Waterkip. 

  • We now also have some Menu2 extensions in the barrel and v0.0.3 got published after the development of...

    getCircleCoords({ :size => self.width, :degrees => degrees});
    
    // Basicly degrees * 6
    getCircleCoords({ :size => self.width, :minute => minute});
    
    // Basicly degrees * 30
    getCircleCoords({ :size => self.width, :hour => hour});
    
    // And support for smaller circles in a larger canvas
    getCircleCoords({ :size => self.width - 80, canvas =. self.width :hour => hour});

  • Release early and often they say, so that's what I do. Most notable changes are.. the AnimatedBanner class and.... the documenation page which can now be found at: https://waterkip.gitlab.io/opn-monkeyc

    Every push to master reloads the documentation and thus it should be always up to date (provided we actually document the code).