1- using Pkg
2- Pkg. activate (" ." )
3-
4- using Revise
5-
6- using Test
7- using Random
8- using Query
9-
10- using PostgresORM. PostgresORMUtil
1+ include (" runtests-prerequisite.jl" )
112
123
134@testset " Test utils.jl - function `string2enum()`" begin
2314
2415@testset " Test utils.jl - function `dict2vectoroftuples()`" begin
2516 props = Dict (:a => 1 , :b => missing , :c => " de" , " d" => 9 )
26- dict2vectoroftuples (props)
17+ PostgresORMUtil . dict2vectoroftuples (props)
2718end
2819
2920@testset " Test utils.jl - function `vectoroftuples2dict()`" begin
3021 vectoroftuples = [(:a , 1 ),(:b , missing ),(:c , " de" ),(" d" , 9 )]
31- vectoroftuples2dict (vectoroftuples)
22+ PostgresORMUtil . vectoroftuples2dict (vectoroftuples)
3223end
3324
3425@testset " Test utils.jl - function `dictstringkeys2symbol()`" begin
6859
6960@testset " Test utils.jl - function `dataframe2vector_of_namedtuples()`" begin
7061
71- df = head (dataset (" datasets" ," iris" ))
62+ df = DataFrame (SepalLength = [5.1 ,3 ],
63+ SepalWidth = [3.5 ,4 ],
64+ Species = [" setosa" ," versicolor" ])
7265
7366 df = @from i in df begin
7467 @select {i. SepalLength,i. SepalWidth,i. Species}
9992
10093@testset " Test utils.jl - function `string2zoneddatetime`" begin
10194 PostgresORMUtil. string2zoneddatetime (" 2019-09-03T11:00:00.000Z" )
102-
10395end
10496
10597@testset " Test utils.jl - function `postgresql_string_array_2_string_vector`" begin
@@ -115,17 +107,17 @@ end
115107 res = PostgresORMUtil. postgresql_string_array_2_string_vector (str)
116108 @test res == [" aa" ," bb" ," cc" ," dd" ]
117109
110+ # This one fails
118111 str = " {\" bla bla\" ,bb,cc}"
119112 res = PostgresORMUtil. postgresql_string_array_2_string_vector (str)
120113 @test res == [" bla bla" ," bb" ," cc" ]
121114
122- occursin (" \" " ," \" rfr" )
123115end
124116
125117
126118@testset " Test utils.jl - function `getpropertiesvalues`" begin
127119
128- mutable struct MyNewStruct <: PostgresORM.Model. IEntity
120+ mutable struct MyNewStruct <: PostgresORM.IEntity
129121
130122 actor_id:: Union{Missing,Int32}
131123 first_name:: Union{Missing,String}
151143
152144@testset " Test utils.jl - function `setpropertiesvalues`" begin
153145
154- mutable struct MyNewStruct <: PostgresORM.Model. IEntity
146+ mutable struct MyNewStruct <: PostgresORM.IEntity
155147
156148 actor_id:: Union{Missing,Int32}
157149 first_name:: Union{Missing,String}
0 commit comments