1 # This file is part of NIT ( http://www.nitlanguage.org ).
3 # Copyright 2014 Frédéric Vachon <fredvac@gmail.com>
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
17 # Test for the API level related annotations
18 module test_target_api
is
24 #FIXME: Double quad to access lib/foo/goo/bar.nit is evil
25 import android
::shared_preferences
::shared_preferences_api11
30 if ie
isa PointerEvent and ie
.depressed
then
38 var hash_set
= new HashSet[JavaString]
39 hash_set
.add
"foo".to_java_string
40 hash_set
.add
"bar".to_java_string
42 shared_preferences
.add_string_set
("test", hash_set
)
44 var hash_set2
= shared_preferences
.string_set
("test")
46 var tab
= ["foo", "bar"]
49 for entry
in hash_set2
do
50 assert entry
== tab
[i
].to_java_string