Not working on Mac OS X 10.7.5 #3

Merged
merged 2 commits into from Nov 3, 2012

Projects

None yet

2 participants

@duksis
duksis commented Oct 10, 2012

Tried to run the test suite and got the following:

$ ./tests.sh 
(standard_in) 1: illegal character: N
(standard_in) 1: illegal character: N
all 8 demo tests passed in s.
(standard_in) 1: illegal character: N
(standard_in) 1: illegal character: N
test #8 "_clean INVARIANT=;
assert_end | egrep 'all 0 tests passed in [0-9].[0-9]{3}s'" failed:
    program terminated with code 1 instead of 0
1 of 9 output tests failed in s.
(standard_in) 1: illegal character: N
(standard_in) 1: illegal character: N
all 7 regression tests passed in s.
duksihug@WL038424 ~/code/assert.sh (master)
$ echo $BASH_VERSION
3.2.48(1)-release

looks like one of the causes is that the default date command shipped with mac os does not have a %N (nanosecond) formatting option
https://github.com/lehmannro/assert.sh/blob/master/assert.sh#L66

P.S.
Great project - would love to use it.

@lehmannro
Owner

Thanks for the report! date indeed seems to be the culprit: It leaves straw %N tokens around when it cannot understand them. Subsequently, bc trips up when trying to calculate 123.%N - 120.%N.
It should be fixed in b7a4213 — can you confirm?

@duksis
duksis commented Oct 11, 2012

Not sure if this was intended that way but b7a4213 returns the github 404 page

@lehmannro
Owner

Could you try again? It works for me now.

@duksis
duksis commented Oct 13, 2012

the link works now, but the test suite don't

$ ./tests.sh 
(standard_in) 1: illegal character: N
(standard_in) 1: illegal character: N
all 9 demo tests passed in s.
(standard_in) 1: illegal character: N
(standard_in) 1: illegal character: N
test #8 "_clean INVARIANT=;
assert_end | egrep 'all 0 tests passed in [0-9].[0-9]{3}s'" failed:
    program terminated with code 1 instead of 0
1 of 13 output tests failed in s.
(standard_in) 1: illegal character: N
(standard_in) 1: illegal character: N
all 7 regression tests passed in s.
@duksis
duksis commented Oct 13, 2012

Added code that works for me:

  • non existing formatting option adds a ".N" to the string at-least for me.
  • and one of the tests expects nanoseconds but they are not there
@lehmannro lehmannro added a commit that referenced this pull request Nov 3, 2012
@lehmannro documented #3 37bab51
@lehmannro lehmannro merged commit 22f559b into lehmannro:master Nov 3, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment