sijms / go-ora

Pure go oracle client
MIT License
771 stars 169 forks source link

Added tests #489

Closed btnguyen2k closed 7 months ago

btnguyen2k commented 7 months ago

Start an Oracle instance locally with Docker:

$ docker run --restart unless-stopped -d --name oracle-xe -p 1521:1521 -e ORACLE_PWD=SecretPassword1 container-registry.oracle.com/database/express:21.3.0-xe

Run tests:

$ export ORACLE_DSN="oracle://system:SecretPassword1@localhost:1521/?SID=XE"
$ cd v2/module_test
$ go test -v -count 1 -p 1 ./

P/S: if a value stored in a floating point column (e.g. NUMERIC(x,y)) have zero fraction part (e.g. 123.00) then it is fetched as an integer (e.g. Go's int/uint). I consider this is a bug because the fetched value should be in Go's float32/float64. Hence some tests currently fails.

btnguyen2k commented 7 months ago

More tests (strings, unicode, date/time/timezone) are coming when I am available after New Year.

Merry Xmas & Happy New Year

sijms commented 7 months ago

Happy new year and thanks for your contributions