aboutsummaryrefslogtreecommitdiff
path: root/Examples/test-suite/php/cpp20_spaceship_operator_runme.php
diff options
context:
space:
mode:
authorAlistair Delva <adelva@google.com>2024-04-10 14:15:29 -0700
committerAlistair Delva <adelva@google.com>2024-04-11 12:58:28 -0700
commitd0f0f90be16c2ac553b5fa08512045273135147a (patch)
tree5d9ebb7a04807ea8a609ddd18b0162bc87530e4b /Examples/test-suite/php/cpp20_spaceship_operator_runme.php
parent6ffc1dbf29ba98c4d8aa71ebc9b484e973fe1030 (diff)
downloadswig-d0f0f90be16c2ac553b5fa08512045273135147a.tar.gz
Update to v4.2.1HEADmastermain
Change-Id: I47cef2be94299220d80265d949a95b58eee2c23b
Diffstat (limited to 'Examples/test-suite/php/cpp20_spaceship_operator_runme.php')
-rw-r--r--Examples/test-suite/php/cpp20_spaceship_operator_runme.php23
1 files changed, 23 insertions, 0 deletions
diff --git a/Examples/test-suite/php/cpp20_spaceship_operator_runme.php b/Examples/test-suite/php/cpp20_spaceship_operator_runme.php
new file mode 100644
index 000000000..00484f742
--- /dev/null
+++ b/Examples/test-suite/php/cpp20_spaceship_operator_runme.php
@@ -0,0 +1,23 @@
+<?php
+
+require "tests.php";
+
+check::functions(array('f', 'spaceship'));
+check::classes(array('cpp20_spaceship_operator','A'));
+check::globals(array('v', 'SPACE'));
+
+//check::equal(ALIEN, true);
+check::equal(SPACE_get(), 1);
+check::equal(COMET, 1);
+check::equal(v_get(), 42);
+
+$x = new A(1);
+$y = new A(2);
+
+check::equal(spaceship($x, $y) < 0, true);
+check::equal(spaceship($x, $x), 0);
+check::equal(spaceship($y, $x) > 0, true);
+
+check::equal(f(), 42);
+
+check::done();