@@ -3,51 +3,57 @@ using SharedPreferences
3
3
using Aqua
4
4
using Test
5
5
6
- function test_all ()
7
- @testset " Aqua.jl" begin
8
- @testset " Ambiguities" begin
9
- Aqua. test_ambiguities (SharedPreferences, recursive = false )
10
- end
11
- Aqua. test_all (SharedPreferences, ambiguities = false )
6
+ function test_aqua ()
7
+ @testset " Ambiguities" begin
8
+ Aqua. test_ambiguities (SharedPreferences, recursive = false )
12
9
end
10
+ Aqua. test_all (SharedPreferences, ambiguities = false )
13
11
14
- key = " iZS1EDuzE5dEf3NmN8m3SbwOJEpu4b0i"
12
+ return nothing
13
+ end
15
14
16
- instance = SharedPreferences. Instance (key )
15
+ function test_shared_preferences ( instance:: SharedPreferences.AbstractInstance )
17
16
clean! (instance)
18
17
19
- instance = SharedPreferences. Instance (key)
20
18
set! (instance, " string" , " value" )
21
19
set! (instance, " integer" , 42 )
22
20
set! (instance, " float" , 3.14 )
23
21
set! (instance, " boolean" , true )
24
22
set! (instance, " array" , [1 , 2 , 3 ])
25
23
26
- instance = SharedPreferences. Instance (key)
27
24
@test get (instance, " string" ) == " value"
28
25
@test get (instance, " integer" ) == 42
29
26
@test get (instance, " float" ) == 3.14
30
27
@test get (instance, " boolean" ) == true
31
28
@test get (instance, " array" ) == [1 , 2 , 3 ]
32
29
33
- instance = SharedPreferences. Instance (key)
34
30
remove! (instance, " string" )
35
31
remove! (instance, " integer" )
36
32
remove! (instance, " float" )
37
33
remove! (instance, " boolean" )
38
34
remove! (instance, " array" )
39
35
40
- instance = SharedPreferences. Instance (key)
41
36
@test_throws KeyError get (instance, " string" )
42
37
@test_throws KeyError get (instance, " integer" )
43
38
@test_throws KeyError get (instance, " float" )
44
39
@test_throws KeyError get (instance, " boolean" )
45
40
@test_throws KeyError get (instance, " array" )
46
41
47
- instance = SharedPreferences. Instance (key)
48
42
clean! (instance)
49
43
50
44
return nothing
51
45
end
52
46
47
+ function test_all ()
48
+ @testset " Aqua.jl" begin test_aqua () end
49
+
50
+ instance = SharedPreferences. Instance (" vG1Z4i52FR" )
51
+ @testset " instance" begin test_shared_preferences (instance) end
52
+
53
+ instance = SharedPreferences. InstanceEncrypted (" gIU2iw4p10KnP2HsU5TBJ5Uuj5Khj2R0" )
54
+ @testset " instance encrypted" begin test_shared_preferences (instance) end
55
+
56
+ return nothing
57
+ end
58
+
53
59
test_all ()
0 commit comments