]> gitweb.factorcode.org Git - factor.git/commitdiff
Don't test ping on any platform higher than windows xp
authorDoug Coleman <doug.coleman@gmail.com>
Thu, 8 Sep 2011 22:27:20 +0000 (15:27 -0700)
committerDoug Coleman <doug.coleman@gmail.com>
Thu, 8 Sep 2011 22:49:39 +0000 (15:49 -0700)
extra/ping/ping-tests.factor

index e9fc20e54c7005438d00f5f634808e7e6e441c16..5c4cc6e54dd48d579f738468fba5ee2f351bd1c6 100644 (file)
@@ -1,8 +1,15 @@
-USING: continuations destructors io.sockets kernel ping
-tools.test ;
+USING: continuations destructors io.sockets kernel math.order
+ping system system-info tools.test ;
 IN: ping.tests
 
-[ ] [ "localhost" ping drop ] unit-test
-[ t ] [ "localhost" alive? ] unit-test
-[ t ] [ "127.0.0.1" alive? ] unit-test
-[ f ] [ "0.0.0.0" alive? ] unit-test
+! { 5 1 } is xp
+: test-ping? ( -- ? )
+    os windows?
+    os-version { 5 1 } after? and not ;
+
+test-ping? [
+    [ ] [ "localhost" ping drop ] unit-test
+    [ t ] [ "localhost" alive? ] unit-test
+    [ t ] [ "127.0.0.1" alive? ] unit-test
+    [ f ] [ "0.0.0.0" alive? ] unit-test
+] when
\ No newline at end of file