src/HOL/Codegenerator_Test/Code_Test_Scala.thy
author wenzelm
Fri, 22 Dec 2017 14:35:29 +0100
changeset 67254 31dd98471e88
parent 67207 ad538f6c5d2f
child 68155 8b50f29a1992
permissions -rw-r--r--
auto update;

(*  Title:      HOL/Codegenerator_Test/Code_Test_Scala.thy
    Author:     Andreas Lochbihler, ETH Zurich

Test case for test_code on Scala
*)

theory Code_Test_Scala imports  "HOL-Library.Code_Test" begin

test_code "14 + 7 * -12 = (140 div -2 :: integer)" in Scala

value [Scala] "14 + 7 * -12 :: integer"

test_code \<comment> \<open>Tests for the serialisation of @{const gcd} on @{typ integer}\<close>
  "gcd 15 10 = (5 :: integer)"
  "gcd 15 (- 10) = (5 :: integer)"
  "gcd (- 10) 15 = (5 :: integer)"
  "gcd (- 10) (- 15) = (5 :: integer)"
  "gcd 0 (- 10) = (10 :: integer)"
  "gcd (- 10) 0 = (10 :: integer)"
  "gcd 0 0 = (0 :: integer)"
in Scala

end