From c6b35f8f2e83621b4e53ab999e5b5bf146a73aa0 Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Wed, 26 Jun 2024 15:46:09 +0200 Subject: Add minimal example using cargo ... including a test (for which we add python3 as test dependency). --- test/rust/cargo/circle/verify.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 test/rust/cargo/circle/verify.py (limited to 'test/rust/cargo/circle/verify.py') diff --git a/test/rust/cargo/circle/verify.py b/test/rust/cargo/circle/verify.py new file mode 100644 index 0000000..09dccee --- /dev/null +++ b/test/rust/cargo/circle/verify.py @@ -0,0 +1,16 @@ +#!/usr/bin/env python3 + +import math +import sys + +with open(sys.argv[1]) as f: + samples = f.read() + +for line in samples.splitlines(): + xs, ys = line.split() + x = int(xs) + y = int(ys) + radius = math.sqrt(x*x + y*y) + print ("(%+3d,%+3d) -> %4.1f" % (x,y,radius)) + if radius > 100.0: + sys.exit(1) -- cgit v1.2.3