Explorar o código

Can actually run and pass (simple) tests in Rust!

Joeri Exelmans %!s(int64=5) %!d(string=hai) anos
pai
achega
a24e820e50
Modificáronse 1 ficheiros con 7 adicións e 2 borrados
  1. 7 2
      src/sccd/test/codegen/rust.py

+ 7 - 2
src/sccd/test/codegen/rust.py

@@ -43,7 +43,12 @@ def compile_test(variants: List[TestVariant], w: IndentingWriter):
             w.writeln("});")
             w.writeln("});")
 
 
         w.writeln("controller.run_until(Until::Eternity);")
         w.writeln("controller.run_until(Until::Eternity);")
-        pass
+        ctr = 0
+        for o in v.output:
+            for e in o:
+                w.writeln("assert!(raised[%d] == \"%s\");" % (ctr, e.name))
+                ctr += 1
+        w.writeln("println!(\"Test variant %d passed\");" % n)
 
 
     w.dedent()
     w.dedent()
-    w.writeln("}")
+    w.writeln("}")