Skip to content
Permalink
Browse files

Some more unit tests for the `java` library

  • Loading branch information...
pmoura committed Jun 12, 2019
1 parent fba03d2 commit 997069fcef8dfd69b5b65158aad5e41da5b91de2
Showing with 16 additions and 2 deletions.
  1. +16 −2 library/java/tests.lgt
@@ -22,9 +22,9 @@
extends(lgtunit)).

:- info([
version is 0.1,
version is 0.2,
author is 'Paulo Moura',
date is 2019/06/11,
date is 2019/06/12,
comment is 'Unit tests for the "java" library.'
]).

@@ -118,4 +118,18 @@
java::value_reference(null, Reference),
java::is_null(Reference).

test(java_arrays_01, true(Terms == [a,42,foo])) :-
java::terms_to_array([a,42,foo], Array),
java::array_to_terms(Array, Terms).

test(java_arrays_02, true(Terms =~= [2.72,3.14,9.8])) :-
java::terms_to_array([2.72,3.14,9.8], Array),
java::array_to_terms(Array, Terms).

test(java_arrays_03, true) :-
java::terms_to_array([a,42,foo], Array),
java::array_to_terms(Array, Terms, Length),
^^assertion(terms, Terms == [a,42,foo]),
^^assertion(length, Length == 3).

:- end_object.

0 comments on commit 997069f

Please sign in to comment.
You can’t perform that action at this time.