unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* A passing test case
@ 2008-01-26  1:19 Gregory Marton
  2008-01-26 13:19 ` Neil Jerram
  0 siblings, 1 reply; 5+ messages in thread
From: Gregory Marton @ 2008-01-26  1:19 UTC (permalink / raw)
  To: bug-guile

[-- Attachment #1: Type: TEXT/PLAIN, Size: 669 bytes --]

Hi folks,

I just wanted to send in a test case for a bug that is fixed as of guile 
1.8.2, but recently bit me, and it's just not that obvious to test for.  It 
is essentially exposed in 1.8.1 by
   (let ((x 1/2))
     (display x)
     (equal? x 1/2))  ===> #f !

Thanks for being so responsive to all these issues.  I greatly appreciate 
the help.

Best wishes,
Grem

-- 
------ __@   Gregory A. Marton                http://csail.mit.edu/~gremio/
--- _`\<,_                                                                .
-- (*)/ (*)           Angels fly for they take themselves lightly.
~~~~~~~~~~~~~~~~-~~~~~~~~_~~~_~~~~~v~~~~^^^^~~~~~--~~~~~~~~~~~~~~~++~~~~~~~

[-- Attachment #2: Type: TEXT/plain, Size: 391 bytes --]

--- test-suite/tests/fractions.test.1.8.3	2008-01-25 20:08:57.000000000 -0500
+++ test-suite/tests/fractions.test	2008-01-25 20:09:07.000000000 -0500
@@ -400,3 +400,8 @@
 (with-test-prefix "fraction generics"
   (testeq (G 1) 'integer)
   (testeq (G 2/3) 'fraction))
+
+(pass-if (let ((x (/ 1 2))) 
+	   (with-output-to-string (lambda () (display x)))
+	   (equal? x (/ 1 2))))
+

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: A passing test case
  2008-01-26  1:19 A passing test case Gregory Marton
@ 2008-01-26 13:19 ` Neil Jerram
  2008-01-26 14:28   ` Gregory Marton
  0 siblings, 1 reply; 5+ messages in thread
From: Neil Jerram @ 2008-01-26 13:19 UTC (permalink / raw)
  To: Gregory Marton; +Cc: bug-guile

Gregory Marton <gremio@csail.mit.edu> writes:

> Hi folks,
>
> I just wanted to send in a test case for a bug that is fixed as of
> guile 1.8.2, but recently bit me, and it's just not that obvious to
> test for.  It is essentially exposed in 1.8.1 by
>   (let ((x 1/2))
>     (display x)
>     (equal? x 1/2))  ===> #f !

Thanks, but why the differences between the code above and the patch
below?  Are they significant?

> --- test-suite/tests/fractions.test.1.8.3	2008-01-25 20:08:57.000000000 -0500
> +++ test-suite/tests/fractions.test	2008-01-25 20:09:07.000000000 -0500
> @@ -400,3 +400,8 @@
>  (with-test-prefix "fraction generics"
>    (testeq (G 1) 'integer)
>    (testeq (G 2/3) 'fraction))
> +
> +(pass-if (let ((x (/ 1 2))) 
> +	   (with-output-to-string (lambda () (display x)))
> +	   (equal? x (/ 1 2))))
> +

Regards,
        Neil





^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: A passing test case
  2008-01-26 13:19 ` Neil Jerram
@ 2008-01-26 14:28   ` Gregory Marton
  2008-01-26 18:58     ` Neil Jerram
  0 siblings, 1 reply; 5+ messages in thread
From: Gregory Marton @ 2008-01-26 14:28 UTC (permalink / raw)
  To: Neil Jerram; +Cc: bug-guile

The differences are not significant.  I guess I wanted to make clear in the 
test case that this isn't something to do with literal rationals, and I 
didn't want the test case to be printing things to the console.

Thanks,
Grem

> Gregory Marton <gremio@csail.mit.edu> writes:
>
>> Hi folks,
>>
>> I just wanted to send in a test case for a bug that is fixed as of
>> guile 1.8.2, but recently bit me, and it's just not that obvious to
>> test for.  It is essentially exposed in 1.8.1 by
>>   (let ((x 1/2))
>>     (display x)
>>     (equal? x 1/2))  ===> #f !
>
> Thanks, but why the differences between the code above and the patch
> below?  Are they significant?
>
>> --- test-suite/tests/fractions.test.1.8.3	2008-01-25 20:08:57.000000000 -0500
>> +++ test-suite/tests/fractions.test	2008-01-25 20:09:07.000000000 -0500
>> @@ -400,3 +400,8 @@
>>  (with-test-prefix "fraction generics"
>>    (testeq (G 1) 'integer)
>>    (testeq (G 2/3) 'fraction))
>> +
>> +(pass-if (let ((x (/ 1 2)))
>> +	   (with-output-to-string (lambda () (display x)))
>> +	   (equal? x (/ 1 2))))
>> +
>
> Regards,
>        Neil
>
>

-- 
------ __@   Gregory A. Marton                http://csail.mit.edu/~gremio/
--- _`\<,_                                                                .
-- (*)/ (*)                Let the machine do the dirty work.
~~~~~~~~~~~~~~~~-~~~~~~~~_~~~_~~~~~v~~~~^^^^~~~~~--~~~~~~~~~~~~~~~++~~~~~~~





^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: A passing test case
  2008-01-26 14:28   ` Gregory Marton
@ 2008-01-26 18:58     ` Neil Jerram
  2008-01-26 19:09       ` Gregory Marton
  0 siblings, 1 reply; 5+ messages in thread
From: Neil Jerram @ 2008-01-26 18:58 UTC (permalink / raw)
  To: Gregory Marton; +Cc: bug-guile

Gregory Marton <gremio@csail.mit.edu> writes:

> The differences are not significant.  I guess I wanted to make clear
> in the test case that this isn't something to do with literal
> rationals, and I didn't want the test case to be printing things to
> the console.

OK, thanks for explaining that.  I assume that this test relates to
the following NEWS item (for 1.8.2):

** Fractions were not `equal?' if stored in unreduced form.
(A subtle problem, since printing a value reduced it, making it work.)

But doesn't that mean that your test needs to use an unreduced
fraction, e.g. 2/4 instead of 1/2 ?

(Or does Guile have a strange idea of reduction which means that 1/2
is not already a reduced form?)

Regards,
        Neil

>>> --- test-suite/tests/fractions.test.1.8.3	2008-01-25 20:08:57.000000000 -0500
>>> +++ test-suite/tests/fractions.test	2008-01-25 20:09:07.000000000 -0500
>>> @@ -400,3 +400,8 @@
>>>  (with-test-prefix "fraction generics"
>>>    (testeq (G 1) 'integer)
>>>    (testeq (G 2/3) 'fraction))
>>> +
>>> +(pass-if (let ((x (/ 1 2)))
>>> +	   (with-output-to-string (lambda () (display x)))
>>> +	   (equal? x (/ 1 2))))
>>> +





^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: A passing test case
  2008-01-26 18:58     ` Neil Jerram
@ 2008-01-26 19:09       ` Gregory Marton
  0 siblings, 0 replies; 5+ messages in thread
From: Gregory Marton @ 2008-01-26 19:09 UTC (permalink / raw)
  To: Neil Jerram; +Cc: bug-guile

> Gregory Marton <gremio@csail.mit.edu> writes:
>
>> The differences are not significant.  I guess I wanted to make clear
>> in the test case that this isn't something to do with literal
>> rationals, and I didn't want the test case to be printing things to
>> the console.
>
> OK, thanks for explaining that.  I assume that this test relates to
> the following NEWS item (for 1.8.2):
>
> ** Fractions were not `equal?' if stored in unreduced form.
> (A subtle problem, since printing a value reduced it, making it work.)

Yes.


> But doesn't that mean that your test needs to use an unreduced
> fraction, e.g. 2/4 instead of 1/2 ?

Now that I look more carefully at fractions.test, my assumption that a test 
case was already added for that case seems to be incorrect.  I'm happy to 
try to add these tests as well.


> (Or does Guile have a strange idea of reduction which means that 1/2
> is not already a reduced form?)

This appears to me to be the case for guile 1.8.1 at least.  I assume the 
two bugs, if they were separate, were fixed together.  I observed this 
behavior in guile 1.8.1, but not 1.8.3.

Best,
Grem

-- 
------ __@   Gregory A. Marton                http://csail.mit.edu/~gremio/
--- _`\<,_                                                                .
-- (*)/ (*)              Help! My inertia is gaining momentum!
~~~~~~~~~~~~~~~~-~~~~~~~~_~~~_~~~~~v~~~~^^^^~~~~~--~~~~~~~~~~~~~~~++~~~~~~~





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-01-26 19:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-26  1:19 A passing test case Gregory Marton
2008-01-26 13:19 ` Neil Jerram
2008-01-26 14:28   ` Gregory Marton
2008-01-26 18:58     ` Neil Jerram
2008-01-26 19:09       ` Gregory Marton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).