Skip to content

Commit

Permalink
Merge pull request #189 from denizzzka/tests_preview_in
Browse files Browse the repository at this point in the history
dflags: -preview=in added into tests
  • Loading branch information
denizzzka authored Dec 7, 2022
2 parents e6ca9f2 + c403488 commit d2bd835
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
10 changes: 7 additions & 3 deletions dub.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,12 @@
{
"name": "integration_tests",
"targetType": "executable",
"dflags-dmd": ["-preview=in"],
"dependencies":
{
"dpq2": "*",
"gfm:math": "~>7.0.0"
"dpq2": { "version": "*", "dflags-dmd": ["-preview=in"] },
"vibe-d:data": { "version": "*", "dflags-dmd": ["-preview=in"] },
"gfm:math": "~>8.0.6"
},
"configurations": [
{
Expand Down Expand Up @@ -75,9 +77,11 @@
{
"name": "example",
"targetType": "executable",
"dflags": ["-preview=in"],
"dependencies":
{
"dpq2": "*"
"dpq2": { "version": "*", "dflags": ["-preview=in"] },
"vibe-d:data": { "version": "*", "dflags": ["-preview=in"] },
},
"sourcePaths": [ "example" ]
}
Expand Down
4 changes: 2 additions & 2 deletions src/dpq2/conv/to_d_types.d
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ Value[] deserializeRecord(in Value v)
"Value length isn't enough to hold object body", __FILE__, __LINE__);
immutable(ubyte)[] resData = data[0 .. size];
data = data[size .. $];
res = Value(resData, oidType);
res = Value(resData.idup, oidType);
}

return ret;
Expand Down Expand Up @@ -369,7 +369,7 @@ if( is(T == BitArray) )
)
);

auto data = v.data;
auto data = v.data[];
size_t len = data.read!int;
size_t[] newData;
foreach (ch; data.chunks(size_t.sizeof))
Expand Down
7 changes: 4 additions & 3 deletions src/dpq2/value.d
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ struct Value
this._oidType = oidType;
}

@safe const pure nothrow @nogc
@safe const pure nothrow scope @nogc
{
/// Indicates if the value is NULL
bool isNull()
Expand Down Expand Up @@ -84,7 +84,8 @@ struct Value
_oidType = type;
}

immutable(ubyte)[] data() pure const
//TODO: replace template by return modifier
immutable(ubyte)[] data()() pure const scope
{
import std.exception;
import core.exception;
Expand Down Expand Up @@ -158,7 +159,7 @@ class ValueConvException : ConvException
}
}

package void throwTypeComplaint(OidType receivedType, string expectedType, string file = __FILE__, size_t line = __LINE__) pure
package void throwTypeComplaint(OidType receivedType, in string expectedType, string file = __FILE__, size_t line = __LINE__) pure
{
throw new ValueConvException(
ConvExceptionType.NOT_IMPLEMENTED,
Expand Down

0 comments on commit d2bd835

Please sign in to comment.