diff --git a/.version b/.version index 0caba26085..3e1a3c3458 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -3.17.1 \ No newline at end of file +3.17.2 \ No newline at end of file diff --git a/make/rebol3.nest b/make/rebol3.nest index ed7a7c27b6..2f13302541 100644 --- a/make/rebol3.nest +++ b/make/rebol3.nest @@ -18,7 +18,7 @@ temp: %make/tmp/ stack-size: 4194304 ;= 4MB (4 * 1024 * 1024) optimize: 2 -version: 3.17.1 +version: 3.17.2 #if Linux? [ defines: TO_LINUX ] #if macOS? [ defines: TO_MACOS ] diff --git a/src/boot/actions.reb b/src/boot/actions.reb index 0517ed8028..a1c530f6e0 100644 --- a/src/boot/actions.reb +++ b/src/boot/actions.reb @@ -452,8 +452,8 @@ open?: action [ query: action [ {Returns information about target if possible.} target [port! file! url! block! vector! date! handle!] - /mode "Get mode information" - field [word! block! none!] "NONE will return valid modes for target type" + field [word! block! none! datatype!] "NONE will return valid modes for target type" + /mode "** DEPRECATED **" ] modify: action [ diff --git a/src/boot/sysobj.reb b/src/boot/sysobj.reb index e4f64a05db..07a38a792e 100644 --- a/src/boot/sysobj.reb +++ b/src/boot/sysobj.reb @@ -461,6 +461,7 @@ standard: object [ name: size: type: + date: ;; same as `modified` (it is here just for backwards compatibility) modified: accessed: created: diff --git a/src/core/p-console.c b/src/core/p-console.c index 898d0306f4..a89ef38434 100644 --- a/src/core/p-console.c +++ b/src/core/p-console.c @@ -147,8 +147,7 @@ case A_QUERY: spec = Get_System(SYS_STANDARD, STD_CONSOLE_INFO); if (!IS_OBJECT(spec)) Trap_Arg(spec); - args = Find_Refines(ds, ALL_QUERY_REFS); - if ((args & AM_QUERY_MODE) && IS_NONE(D_ARG(ARG_QUERY_FIELD))) { + if (IS_NONE(D_ARG(ARG_QUERY_FIELD))) { Set_Block(D_RET, Get_Object_Words(spec)); return R_RET; } diff --git a/src/core/p-dir.c b/src/core/p-dir.c index 057d47ee34..770f78f8aa 100644 --- a/src/core/p-dir.c +++ b/src/core/p-dir.c @@ -283,8 +283,7 @@ case A_QUERY: //Trap_Security(flags[POL_READ], POL_READ, path); - args = Find_Refines(ds, ALL_QUERY_REFS); - if ((args & AM_QUERY_MODE) && IS_NONE(D_ARG(ARG_QUERY_FIELD))) { + if (IS_NONE(D_ARG(ARG_QUERY_FIELD))) { Ret_File_Modes(port, D_RET); return R_RET; } diff --git a/src/core/p-file.c b/src/core/p-file.c index cc5930b9c0..bd2355f4b8 100644 --- a/src/core/p-file.c +++ b/src/core/p-file.c @@ -638,8 +638,7 @@ REBINT Mode_Syms[] = { break; case A_QUERY: - args = Find_Refines(ds, ALL_QUERY_REFS); - if ((args & AM_QUERY_MODE) && IS_NONE(D_ARG(ARG_QUERY_FIELD))) { + if (IS_NONE(D_ARG(ARG_QUERY_FIELD))) { Ret_File_Modes(port, D_RET); return R_RET; } diff --git a/src/core/p-midi.c b/src/core/p-midi.c index 50fb233f23..5039c87b5f 100644 --- a/src/core/p-midi.c +++ b/src/core/p-midi.c @@ -134,7 +134,7 @@ case A_QUERY: spec = Get_System(SYS_STANDARD, STD_MIDI_INFO); if (!IS_OBJECT(spec)) Trap_Arg(spec); - if (D_REF(2) && IS_NONE(D_ARG(3))) { + if (IS_NONE(D_ARG(ARG_QUERY_FIELD))) { // query/mode midi:// none ;<-- lists possible fields to request Set_Block(D_RET, Get_Object_Words(spec)); return R_RET; @@ -146,36 +146,33 @@ req->data = (REBYTE*)obj; OS_DO_DEVICE(req, RDC_QUERY); - if (D_REF(2)) { - // query/mode used - REBVAL *field = D_ARG(3); - if (IS_WORD(field)) { - if (!Query_MIDI_Field(obj, VAL_WORD_SYM(field), D_RET)) - Trap_Reflect(VAL_TYPE(D_ARG(1)), field); // better error? - } - else if (IS_BLOCK(field)) { - REBVAL *val; - REBSER *values = Make_Block(2 * BLK_LEN(VAL_SERIES(field))); - REBVAL *word = VAL_BLK_DATA(field); - for (; NOT_END(word); word++) { - if (ANY_WORD(word)) { - if (IS_SET_WORD(word)) { - // keep the set-word in result - val = Append_Value(values); - *val = *word; - VAL_SET_LINE(val); - } + REBVAL *field = D_ARG(ARG_QUERY_FIELD); + if (IS_WORD(field)) { + if (!Query_MIDI_Field(obj, VAL_WORD_SYM(field), D_RET)) + Trap_Reflect(VAL_TYPE(D_ARG(1)), field); // better error? + } + else if (IS_BLOCK(field)) { + REBVAL *val; + REBSER *values = Make_Block(2 * BLK_LEN(VAL_SERIES(field))); + REBVAL *word = VAL_BLK_DATA(field); + for (; NOT_END(word); word++) { + if (ANY_WORD(word)) { + if (IS_SET_WORD(word)) { + // keep the set-word in result val = Append_Value(values); - if (!Query_MIDI_Field(obj, VAL_WORD_SYM(word), val)) - Trap1(RE_INVALID_ARG, word); + *val = *word; + VAL_SET_LINE(val); } - else Trap1(RE_INVALID_ARG, word); + val = Append_Value(values); + if (!Query_MIDI_Field(obj, VAL_WORD_SYM(word), val)) + Trap1(RE_INVALID_ARG, word); } - Set_Series(REB_BLOCK, D_RET, values); + else Trap1(RE_INVALID_ARG, word); } - return R_RET; - } - Set_Object(D_RET, obj); + Set_Series(REB_BLOCK, D_RET, values); + } else { + Set_Object(D_RET, obj); + } return R_RET; case A_OPENQ: diff --git a/src/core/p-net.c b/src/core/p-net.c index 4ab249e58b..e0a9102365 100644 --- a/src/core/p-net.c +++ b/src/core/p-net.c @@ -342,8 +342,7 @@ enum Transport_Types { case A_QUERY: // Get specific information - the scheme's info object. // Special notation allows just getting part of the info. - refs = Find_Refines(ds, ALL_QUERY_REFS); - if ((refs & AM_QUERY_MODE) && IS_NONE(D_ARG(ARG_QUERY_FIELD))) { + if (IS_NONE(D_ARG(ARG_QUERY_FIELD))) { Ret_Net_Modes(port, D_RET); return R_RET; } diff --git a/src/core/t-date.c b/src/core/t-date.c index b95877da0b..e63f490c04 100644 --- a/src/core/t-date.c +++ b/src/core/t-date.c @@ -1049,43 +1049,42 @@ static const REBI64 DAYS_OF_JAN_1ST_1970 = 719468; // number of days for 1st Jan case A_QUERY: spec = Get_System(SYS_STANDARD, STD_DATE_INFO); if (!IS_OBJECT(spec)) Trap_Arg(spec); - if (D_REF(2)) { // query/mode refinement - REBVAL *field = D_ARG(3); - if(IS_WORD(field)) { - switch(VAL_WORD_CANON(field)) { - case SYM_WORDS: - Set_Block(D_RET, Get_Object_Words(spec)); - return R_RET; - case SYM_SPEC: - return R_ARG1; - } - if (!Query_Date_Field(val, field, D_RET)) - Trap_Reflect(VAL_TYPE(val), field); // better error? + REBVAL *field = D_ARG(3); + if(IS_WORD(field)) { + switch(VAL_WORD_CANON(field)) { + case SYM_WORDS: + Set_Block(D_RET, Get_Object_Words(spec)); + return R_RET; + case SYM_SPEC: + return R_ARG1; } - else if (IS_BLOCK(field)) { - REBVAL *out = D_RET; - REBSER *values = Make_Block(2 * BLK_LEN(VAL_SERIES(field))); - REBVAL *word = VAL_BLK_DATA(field); - for (; NOT_END(word); word++) { - if (ANY_WORD(word)) { - if (IS_SET_WORD(word)) { - // keep the set-word in result - out = Append_Value(values); - *out = *word; - VAL_SET_LINE(out); - } + if (!Query_Date_Field(val, field, D_RET)) + Trap_Reflect(VAL_TYPE(val), field); // better error? + } + else if (IS_BLOCK(field)) { + REBVAL *out = D_RET; + REBSER *values = Make_Block(2 * BLK_LEN(VAL_SERIES(field))); + REBVAL *word = VAL_BLK_DATA(field); + for (; NOT_END(word); word++) { + if (ANY_WORD(word)) { + if (IS_SET_WORD(word)) { + // keep the set-word in result out = Append_Value(values); - if (!Query_Date_Field(val, word, out)) - Trap1(RE_INVALID_ARG, word); + *out = *word; + VAL_SET_LINE(out); } - else Trap1(RE_INVALID_ARG, word); + out = Append_Value(values); + if (!Query_Date_Field(val, word, out)) + Trap1(RE_INVALID_ARG, word); } - Set_Series(REB_BLOCK, D_RET, values); - } - else { - Set_Block(D_RET, Get_Object_Words(spec)); + else Trap1(RE_INVALID_ARG, word); } - } else { + Set_Series(REB_BLOCK, D_RET, values); + } + else if (IS_NONE(field)) { + Set_Block(D_RET, Get_Object_Words(spec)); + } + else { REBSER *obj = CLONE_OBJECT(VAL_OBJ_FRAME(spec)); REBSER *words = VAL_OBJ_WORDS(spec); REBVAL *word = BLK_HEAD(words); diff --git a/src/core/t-handle.c b/src/core/t-handle.c index 1d82dac9a9..091430b7cf 100644 --- a/src/core/t-handle.c +++ b/src/core/t-handle.c @@ -180,42 +180,40 @@ extern void RXI_To_Value(REBVAL *val, RXIARG arg, REBCNT type); // f-extension.c //TODO: this code could be made resusable with other types! spec = Get_System(SYS_STANDARD, STD_HANDLE_INFO); if (!IS_OBJECT(spec)) Trap_Arg(spec); - if (D_REF(2)) { // query/mode refinement - REBVAL *field = D_ARG(3); - if (IS_WORD(field)) { - switch (VAL_WORD_CANON(field)) { - case SYM_WORDS: - Set_Block(D_RET, Get_Object_Words(spec)); - return R_RET; - case SYM_SPEC: - return R_ARG1; - } - if (!Query_Handle_Field(val, field, D_RET)) - Trap_Reflect(VAL_TYPE(val), field); // better error? + REBVAL *field = D_ARG(3); + if (IS_WORD(field)) { + switch (VAL_WORD_CANON(field)) { + case SYM_WORDS: + Set_Block(D_RET, Get_Object_Words(spec)); + return R_RET; + case SYM_SPEC: + return R_ARG1; } - else if (IS_BLOCK(field)) { - REBVAL *out = D_RET; - REBSER *values = Make_Block(2 * BLK_LEN(VAL_SERIES(field))); - REBVAL *word = VAL_BLK_DATA(field); - for (; NOT_END(word); word++) { - if (ANY_WORD(word)) { - if (IS_SET_WORD(word)) { - // keep the set-word in result - out = Append_Value(values); - *out = *word; - VAL_SET_LINE(out); - } + if (!Query_Handle_Field(val, field, D_RET)) + Trap_Reflect(VAL_TYPE(val), field); // better error? + } + else if (IS_BLOCK(field)) { + REBVAL *out = D_RET; + REBSER *values = Make_Block(2 * BLK_LEN(VAL_SERIES(field))); + REBVAL *word = VAL_BLK_DATA(field); + for (; NOT_END(word); word++) { + if (ANY_WORD(word)) { + if (IS_SET_WORD(word)) { + // keep the set-word in result out = Append_Value(values); - if (!Query_Handle_Field(val, word, out)) - Trap1(RE_INVALID_ARG, word); + *out = *word; + VAL_SET_LINE(out); } - else Trap1(RE_INVALID_ARG, word); + out = Append_Value(values); + if (!Query_Handle_Field(val, word, out)) + Trap1(RE_INVALID_ARG, word); } - Set_Series(REB_BLOCK, D_RET, values); - } - else { - Set_Block(D_RET, Get_Object_Words(spec)); + else Trap1(RE_INVALID_ARG, word); } + Set_Series(REB_BLOCK, D_RET, values); + } + else if (IS_NONE(field)){ + Set_Block(D_RET, Get_Object_Words(spec)); } else { REBSER *obj = CLONE_OBJECT(VAL_OBJ_FRAME(spec)); diff --git a/src/core/t-vector.c b/src/core/t-vector.c index f491f94fff..6433862925 100644 --- a/src/core/t-vector.c +++ b/src/core/t-vector.c @@ -832,36 +832,35 @@ static void reverse_vector(REBVAL *value, REBCNT len) bits = VECT_TYPE(vect); REBVAL *spec = Get_System(SYS_STANDARD, STD_VECTOR_INFO); if (!IS_OBJECT(spec)) Trap_Arg(spec); - if (D_REF(2)) { // query/mode refinement - REBVAL *field = D_ARG(3); - if(IS_WORD(field)) { - if (!Query_Vector_Field(vect, VAL_WORD_SYM(field), value)) - Trap_Reflect(VAL_TYPE(value), field); // better error? - } - else if (IS_BLOCK(field)) { - REBSER *values = Make_Block(2 * BLK_LEN(VAL_SERIES(field))); - REBVAL *word = VAL_BLK_DATA(field); - for (; NOT_END(word); word++) { - if (ANY_WORD(word)) { - if (IS_SET_WORD(word)) { - // keep the set-word in result - val = Append_Value(values); - *val = *word; - VAL_SET_LINE(val); - } + REBVAL *field = D_ARG(ARG_QUERY_FIELD); + if(IS_WORD(field)) { + if (!Query_Vector_Field(vect, VAL_WORD_SYM(field), value)) + Trap_Reflect(VAL_TYPE(value), field); // better error? + } + else if (IS_BLOCK(field)) { + REBSER *values = Make_Block(2 * BLK_LEN(VAL_SERIES(field))); + REBVAL *word = VAL_BLK_DATA(field); + for (; NOT_END(word); word++) { + if (ANY_WORD(word)) { + if (IS_SET_WORD(word)) { + // keep the set-word in result val = Append_Value(values); - if (!Query_Vector_Field(vect, VAL_WORD_SYM(word), val)) - Trap1(RE_INVALID_ARG, word); + *val = *word; + VAL_SET_LINE(val); } - else Trap1(RE_INVALID_ARG, word); + val = Append_Value(values); + if (!Query_Vector_Field(vect, VAL_WORD_SYM(word), val)) + Trap1(RE_INVALID_ARG, word); } - Set_Series(REB_BLOCK, value, values); + else Trap1(RE_INVALID_ARG, word); } - else { - Set_Block(D_RET, Get_Object_Words(spec)); - return R_RET; - } - } else { + Set_Series(REB_BLOCK, value, values); + } + else if (IS_NONE(field)) { + Set_Block(D_RET, Get_Object_Words(spec)); + return R_RET; + } + else { REBSER *obj = CLONE_OBJECT(VAL_OBJ_FRAME(spec)); Query_Vector_Field(vect, SYM_SIGNED, OFV(obj, STD_VECTOR_INFO_SIGNED)); Query_Vector_Field(vect, SYM_TYPE, OFV(obj, STD_VECTOR_INFO_TYPE)); diff --git a/src/mezz/base-files.reb b/src/mezz/base-files.reb index 5ed328f940..92c98c9ef6 100644 --- a/src/mezz/base-files.reb +++ b/src/mezz/base-files.reb @@ -22,7 +22,7 @@ exists?: func [ target [file! url!] ][ all [ - word? target: try [query/mode target 'type] + word? target: try [query target 'type] target ] ] @@ -31,14 +31,14 @@ size?: func [ {Returns the size of a file or vector (bits per value).} target [file! url! port! vector!] ][ - query/mode target 'size + query target 'size ] modified?: func [ {Returns the last modified date of a file.} target [file! url!] ][ - query/mode target 'modified + query target 'modified ] suffix?: func [ diff --git a/src/mezz/codec-image-ext.reb b/src/mezz/codec-image-ext.reb index 86ab41976d..362eb64e54 100644 --- a/src/mezz/codec-image-ext.reb +++ b/src/mezz/codec-image-ext.reb @@ -70,7 +70,7 @@ if find codecs 'png [ bin: binary data out: make block! 12 ; in cloud builds the console width is not resolved! - num: try/with [-40 + query/mode console:// 'window-cols][40] + num: try/with [-40 + query console:// 'window-cols][40] while [8 < length? bin/buffer][ len: binary/read bin 'ui32be tag: copy/part bin/buffer 4 diff --git a/src/mezz/codec-zip.reb b/src/mezz/codec-zip.reb index 7cc8765f45..98403a1a22 100644 --- a/src/mezz/codec-zip.reb +++ b/src/mezz/codec-zip.reb @@ -164,7 +164,7 @@ register-codec [ add-file: func[file [file!] /local dir spec][ try/with [ - spec: query/mode file [type: date:] + spec: query file [type: date:] either spec [ file-name: any [find/tail file root file] either spec/type = 'dir [ diff --git a/src/mezz/mezz-debug.reb b/src/mezz/mezz-debug.reb index 7f5a8f54f2..d26ba42a53 100644 --- a/src/mezz/mezz-debug.reb +++ b/src/mezz/mezz-debug.reb @@ -167,7 +167,7 @@ print-table: function [ print-horizontal-line: does [ ;@@ quering window-cols width in CI under Windows now throws error: `Access error: protocol error: 6` ;@@ it should return `none` like under Posix systems! - loop -1 + any [attempt [query/mode system/ports/output 'window-cols] 76][ prin #"-" ] prin lf + loop -1 + any [attempt [query system/ports/output 'window-cols] 76][ prin #"-" ] prin lf ] ;@@ profile idea is based on code from https://gist.github.com/giesse/1232d7f71a15a3a8417ec6f091398811 diff --git a/src/mezz/mezz-files.reb b/src/mezz/mezz-files.reb index 9f26d7a342..a51d2f803f 100644 --- a/src/mezz/mezz-files.reb +++ b/src/mezz/mezz-files.reb @@ -274,7 +274,7 @@ list-dir: closure/with [ value depth /local info date time size ][ - info: query/mode value [name size date] + info: query value [name size date] unless info [ return ajoin [ "^[[1;35m *** Invalid symbolic link: ^[[0;35m" diff --git a/src/mezz/mezz-help.reb b/src/mezz/mezz-help.reb index a860e4e4a2..0631f995ee 100644 --- a/src/mezz/mezz-help.reb +++ b/src/mezz/mezz-help.reb @@ -201,7 +201,7 @@ import (module [ ][ ;@@ quering buffer width in CI under Windows now throws error: `Access error: protocol error: 6` ;@@ it should return `none` like under Posix systems! - cols: any [ attempt [ query/mode system/ports/input 'buffer-cols ] 120] + cols: any [ attempt [ query system/ports/input 'buffer-cols ] 120] max-desc-width: cols - 35 buffer: any [string clear ""] catch [ diff --git a/src/mezz/prot-tls.reb b/src/mezz/prot-tls.reb index e41b635ad2..0fe88d7288 100644 --- a/src/mezz/prot-tls.reb +++ b/src/mezz/prot-tls.reb @@ -2035,7 +2035,7 @@ TLS-server-awake: func [event /local port info serv] [ accept [ serv: event/port port: first serv - info: query port + info: query port [remote-ip: remote-port:] ;? info ;? serv port/extra: make TLS-context [ diff --git a/src/mezz/sys-ports-midi.reb b/src/mezz/sys-ports-midi.reb index 0f23ad8235..41de1358f9 100644 --- a/src/mezz/sys-ports-midi.reb +++ b/src/mezz/sys-ports-midi.reb @@ -37,11 +37,11 @@ append/only system/schemes [ ;; Lookup device IDs using full names (or wildcards) all [ any-string? inp: select spec 'device-in - spec/device-in: find inp query/mode midi:// 'devices-in + spec/device-in: find inp query midi:// 'devices-in ] all [ any-string? out: select spec 'device-out - spec/device-out: find out query/mode midi:// 'devices-out + spec/device-out: find out query midi:// 'devices-out ] ] ; make port/spec to be only with midi related keys diff --git a/src/mezz/sys-start.reb b/src/mezz/sys-start.reb index ac13181226..74c4d256d2 100644 --- a/src/mezz/sys-start.reb +++ b/src/mezz/sys-start.reb @@ -110,6 +110,8 @@ start: func [ module-paths: does [ sys/log/error 'REBOL "`system/options/module-paths` is deprecated and will be removed!" sys/log/error 'REBOL "Use `system/options/modules` as a path to the directory instead!" + sys/log/error 'REBOL "`query/mode` is deprecated; `field` is always required!" + sys/log/error 'REBOL "`date` field as a result from `query` on file ports is deprecated, use `modified`!" self/module-paths: reduce [modules] ] diff --git a/src/modules/httpd.reb b/src/modules/httpd.reb index 328a4cbacb..f6366cce1c 100644 --- a/src/modules/httpd.reb +++ b/src/modules/httpd.reb @@ -263,9 +263,9 @@ sys/make-scheme [ return Actor/On-List-Dir ctx target ] ] - info: query path + info: query path [modified: size:] ; prepare modified date of the target - modified: info/date + modified: info/modified modified/timezone: 0 ; converted to UTC modified/second: to integer! modified/second ; remove miliseconds from time @@ -273,7 +273,7 @@ sys/make-scheme [ ctx/out/status: 200 ctx/out/target: path ctx/out/header/Content-Length: info/size - ctx/out/header/Last-Modified: to-idate/gmt info/date + ctx/out/header/Last-Modified: to-idate/gmt info/modified if ctx/inp/method = "GET" [ ;? ctx/inp/header either all [ @@ -846,7 +846,7 @@ sys/make-scheme [ New-Client: func[port [port!] /local client info err][ client: first port - info: query client + info: query client [remote-ip: remote-port:] unless Actor/On-Accept info [ ; connection not allowed log-more ["Client not accepted:^[[22m" info/remote-ip] diff --git a/src/tests/test-midi.r3 b/src/tests/test-midi.r3 index f05eda3732..1587f34e29 100644 --- a/src/tests/test-midi.r3 +++ b/src/tests/test-midi.r3 @@ -4,11 +4,11 @@ Rebol [ Author: "Oldes" File: %test-midi.r3 Version: 1.0.0 - Requires: 3.11.0 + Needs: 3.11.0 ] -midi: query midi:// -unless object? midi [ print as-purple "No MIDI available!" quit] +midi: query midi:// [devices-in: devices-out:] +unless block? midi [ print as-purple "No MIDI available!" quit] print [as-yellow "Input devices: " length? midi/devices-in] foreach dev midi/devices-in [ print [tab mold dev] ] diff --git a/src/tests/test-raw-tcp-read.r3 b/src/tests/test-raw-tcp-read.r3 index a24c2cd9cb..caeecde093 100644 --- a/src/tests/test-raw-tcp-read.r3 +++ b/src/tests/test-raw-tcp-read.r3 @@ -19,7 +19,10 @@ wp/awake: func [event /local port] [ switch/default event/type [ read [print ["^/read:" length? port/data] read port] wrote [read port] - lookup [print query port open port] + lookup [ + print query port [remote-ip: remote-port:] + open port + ] connect [write port http-request] ][true] ] diff --git a/src/tests/test-udp-server.r3 b/src/tests/test-udp-server.r3 index 01b1082a48..b5ea539624 100644 --- a/src/tests/test-udp-server.r3 +++ b/src/tests/test-udp-server.r3 @@ -15,7 +15,7 @@ stdout: system/ports/output udp-server/awake: func [event /local port str] [ port: event/port - print ["[UDP Server] event:" event/type "from ip:" query/mode port 'remote-ip ] + print ["[UDP Server] event:" event/type "from ip:" query port 'remote-ip ] switch event/type [ read [ str: to string! port/data diff --git a/src/tests/units/crypt-test.r3 b/src/tests/units/crypt-test.r3 index 5f635b1b66..123038d52f 100644 --- a/src/tests/units/crypt-test.r3 +++ b/src/tests/units/crypt-test.r3 @@ -228,7 +228,7 @@ sY29ouezv4Xz2PuMch5VGPP+CDqzCM4loWgV --test-- "Init public DH params from file" --assert all [ handle? key: load %units/files/dhparam2048.key - 'dhm = query/mode key 'type + 'dhm = query key 'type release key ; release it now (don't wait on GC) ] ===end-group=== diff --git a/src/tests/units/date-test.r3 b/src/tests/units/date-test.r3 index 82a304c300..49acd2bdc6 100644 --- a/src/tests/units/date-test.r3 +++ b/src/tests/units/date-test.r3 @@ -350,21 +350,21 @@ Rebol [ ===start-group=== "QUERY date" date: 8-Apr-2020/12:04:32+2:00 - --test-- "query date" - --assert object? o: query date + --test-- "query as object" + --assert object? o: query date object! --assert o/date = 8-Apr-2020 - --test-- "query/mode datetime" + --test-- "query datetime" all-date-words: words-of system/standard/date-info - --assert all-date-words = query/mode date none - --assert date/time = query/mode date 'time - --assert [2020 4] = query/mode date [year month] - --assert [month: 4 year: 2020] = query/mode date [month: year:] - --assert equal? query/mode date all-date-words [2020 4 8 12:04:32 8-Apr-2020 2:00 12 4 32 3 99 2:00 8-Apr-2020/10:04:32 2458947.91981481] + --assert all-date-words = query date none + --assert date/time = query date 'time + --assert [2020 4] = query date [year month] + --assert [month: 4 year: 2020] = query date [month: year:] + --assert equal? query date all-date-words [2020 4 8 12:04:32 8-Apr-2020 2:00 12 4 32 3 99 2:00 8-Apr-2020/10:04:32 2458947.91981481] - --test-- "query/mode date" + --test-- "query date" date: 8-Apr-2020 ; no time! - --assert equal? query/mode date all-date-words [2020 4 8 #(none) 2020-04-08 #(none) #(none) #(none) #(none) 3 99 #(none) 2020-04-08 2458948.0] + --assert equal? query date all-date-words [2020 4 8 #(none) 2020-04-08 #(none) #(none) #(none) #(none) 3 99 #(none) 2020-04-08 2458948.0] ===end-group=== diff --git a/src/tests/units/file-test.r3 b/src/tests/units/file-test.r3 index d19c4ef5a4..b2820dd64f 100644 --- a/src/tests/units/file-test.r3 +++ b/src/tests/units/file-test.r3 @@ -86,7 +86,7 @@ if find [Linux macOS] system/platform [ call/shell/wait "touch a:0:0" --assert %a%3A0%3A0 == to-rebol-file "a:0:0" --assert %a%3A0%3A0 == f: first read %. - --assert %a%3A0%3A0 == second split-path query/mode f 'name + --assert %a%3A0%3A0 == second split-path query f 'name delete f cd .. delete %issue-2538 @@ -203,14 +203,14 @@ if find [Linux macOS] system/platform [ write %query-test "test" probe fields: [modified created accessed] --assert all [ - block? probe dates1: query/mode %query-test fields + block? probe dates1: query %query-test fields date? dates1/1 date? dates1/2 date? dates1/3 ] wait 1 --assert all [ - block? probe dates2: query/mode %query-test fields + block? probe dates2: query %query-test fields dates1/1 = dates2/1 dates1/2 = dates2/2 dates1/3 = dates2/3 @@ -218,7 +218,7 @@ if find [Linux macOS] system/platform [ wait 1 read %query-test ;; should change access time --assert all [ - block? probe dates2: query/mode %query-test fields + block? probe dates2: query %query-test fields dates1/1 = dates2/1 dates1/2 = dates2/2 dates1/3 < dates2/3 @@ -226,7 +226,7 @@ if find [Linux macOS] system/platform [ wait 1 write/append %query-test "!" ;; should change modified and access times --assert all [ - block? probe dates3: query/mode %query-test fields + block? probe dates3: query %query-test fields dates2/1 < dates3/1 dates2/2 = dates3/2 dates2/3 <= dates3/3 diff --git a/src/tests/units/handle-test.r3 b/src/tests/units/handle-test.r3 index 1c55a75e64..a740888af2 100644 --- a/src/tests/units/handle-test.r3 +++ b/src/tests/units/handle-test.r3 @@ -87,8 +87,8 @@ h4: aes/key #{00000000000000000000000000000000} none ; for consistency with other types (like date, image, etc..) ;@@ https://github.com/Oldes/Rebol-issues/issues/906 --assert [type] = words-of h1 - --assert 'rc4 = query/mode h1 'type - --assert all [object? o: query h1 o/type = 'rc4] + --assert 'rc4 = query h1 'type + --assert all [object? o: query h1 object! o/type = 'rc4] ] ;<- if not error? try [] ===end-group=== diff --git a/src/tests/units/port-http-test.r3 b/src/tests/units/port-http-test.r3 index 4925f574a7..ac56f29493 100644 --- a/src/tests/units/port-http-test.r3 +++ b/src/tests/units/port-http-test.r3 @@ -36,8 +36,8 @@ system/schemes/http/spec/timeout: 30 --assert string? try [read http://www.rebol.com] --test-- "query url" ;@@ https://github.com/Oldes/Rebol-issues/issues/467 - --assert error? try [query https://www] - --assert object? query https://www.google.com + --assert error? try [query https://www object!] + --assert object? query https://www.google.com object! --test-- "read/seek/part" ; first results without read/part diff --git a/src/tests/units/port-test.r3 b/src/tests/units/port-test.r3 index efa070617d..021e111901 100644 --- a/src/tests/units/port-test.r3 +++ b/src/tests/units/port-test.r3 @@ -22,19 +22,19 @@ Rebol [ --assert not error? [delete %port-issue-2320/] --test-- "query directory info" ;@@ https://github.com/Oldes/Rebol-issues/issues/1712 - --assert [name size date type] = query/mode %. none - --assert 'dir = query/mode %. 'type - --assert date? query/mode %. 'date - --assert what-dir = query/mode %. 'name + --assert (words-of system/standard/file-info) = query %. none + --assert 'dir = query %. 'type + --assert date? query %. 'date + --assert what-dir = query %. 'name ;@@ https://github.com/Oldes/Rebol-issues/issues/2305 - --assert none? query/mode %. 'size + --assert none? query %. 'size --test-- "query directory type" ;@@ https://github.com/Oldes/Rebol-issues/issues/606 make-dir %dir-606/ --assert all [ - object? d: query %dir-606 + object? d: query %dir-606 object! d/type = 'dir - object? d: query %dir-606/ + object? d: query %dir-606/ object! d/type = 'dir d/size = none ] @@ -201,7 +201,7 @@ if system/platform = 'Windows [ --test-- "exists? %/" ;@@ https://github.com/Oldes/Rebol-issues/issues/2317 --assert 'dir = exists? %/ ;@@ https://github.com/Oldes/Rebol-issues/issues/612 - --assert object? info: query %/ + --assert object? info: query %/ object! --assert info/name = %/ --assert info/type = 'dir --assert none? info/size @@ -231,27 +231,27 @@ if system/platform = 'Windows [ --test-- "query file info" ;@@ https://github.com/Oldes/Rebol-issues/issues/1712 file: %units/files/alice29.txt.gz - --assert [name size date type] = query/mode file none - --assert 'file = query/mode file 'type - --assert date? query/mode file 'date - --assert 51732 = query/mode file 'size - --assert [file 51732] = query/mode file [type size] - --assert [type: file size: 51732] = query/mode file [type: size:] + --assert (words-of system/standard/file-info) = query file none + --assert 'file = query file 'type + --assert date? query file 'modified + --assert 51732 = query file 'size + --assert [file 51732] = query file [type size] + --assert [type: file size: 51732] = query file [type: size:] --test-- "query file name" ;@@ https://github.com/Oldes/Rebol-issues/issues/2442 file: %units/files/čeština.txt - --assert not none? find (query/mode file 'name) file + --assert not none? find (query file 'name) file --test-- "query file info (port)" ;@@ https://github.com/Oldes/Rebol-issues/issues/2008 file: open %units/files/alice29.txt.gz - --assert [name size date type] = query/mode file none - --assert 'file = query/mode file 'type - --assert date? query/mode file 'date - --assert 51732 = query/mode file 'size - --assert [file 51732] = query/mode file [type size] - --assert [type: file size: 51732] = query/mode file [type: size:] + --assert (words-of system/standard/file-info) = query file none + --assert 'file = query file 'type + --assert date? query file 'modified + --assert 51732 = query file 'size + --assert [file 51732] = query file [type size] + --assert [type: file size: 51732] = query file [type: size:] close file --test-- "write/lines" @@ -681,20 +681,20 @@ if all [ --test-- "query input port" --assert port? system/ports/input --assert all [ - object? console-info: query system/ports/input + object? console-info: query system/ports/input object! integer? console-info/window-cols integer? console-info/window-rows integer? console-info/buffer-cols integer? console-info/buffer-rows ;?? console-info ] - --assert integer? query/mode system/ports/input 'window-cols - --assert integer? query/mode system/ports/input 'window-rows - --assert integer? query/mode system/ports/input 'buffer-cols - --assert integer? query/mode system/ports/input 'buffer-rows - --assert [buffer-cols buffer-rows window-cols window-rows] - = m: query/mode system/ports/input none - --assert block? v: query/mode system/ports/input m + --assert integer? query system/ports/input 'window-cols + --assert integer? query system/ports/input 'window-rows + --assert integer? query system/ports/input 'buffer-cols + --assert integer? query system/ports/input 'buffer-rows + --assert (words-of system/standard/console-info) + = m: query system/ports/input none + --assert block? v: query system/ports/input m --assert 4 = length? v ===end-group=== ] @@ -725,16 +725,16 @@ if all [ --test-- "query net info" ;@@ https://github.com/Oldes/Rebol-issues/issues/1712 port: open tcp://8.8.8.8:80 - --assert [local-ip local-port remote-ip remote-port] = query/mode port none - --assert 0.0.0.0 = query/mode port 'local-ip - --assert 0 = query/mode port 'local-port - --assert not none? find [0.0.0.0 8.8.8.8] query/mode port 'remote-ip ;; on posix there is sync lookup and so it reports 8.8.8.8 even without wait - --assert 80 = query/mode port 'remote-port + --assert (words-of system/standard/net-info) = query port none + --assert 0.0.0.0 = query port 'local-ip + --assert 0 = query port 'local-port + --assert not none? find [0.0.0.0 8.8.8.8] query port 'remote-ip ;; on posix there is sync lookup and so it reports 8.8.8.8 even without wait + --assert 80 = query port 'remote-port --assert all [ port? wait [port 1] ;= wait for lookup, so remote-ip is resolved - 8.8.8.8 = query/mode port 'remote-ip - [80 8.8.8.8] = query/mode port [remote-port remote-ip] - [local-ip: 0.0.0.0 local-port: 0] = query/mode port [local-ip: local-port:] + 8.8.8.8 = query port 'remote-ip + [80 8.8.8.8] = query port [remote-port remote-ip] + [local-ip: 0.0.0.0 local-port: 0] = query port [local-ip: local-port:] ] try [close port] ===end-group=== @@ -743,7 +743,8 @@ if all [ ===start-group=== "SYSTEM" --test-- "query system://" ;@@ https://github.com/Oldes/Rebol-issues/issues/1373 - --assert all [error? e: try [query system://] e/id = 'no-port-action] + ;; not implemented yet! + --assert all [error? e: try [query system:// object!] e/id = 'no-port-action] ===end-group=== ~~~end-file~~~ \ No newline at end of file diff --git a/src/tests/units/rsa-test.r3 b/src/tests/units/rsa-test.r3 index ba98bba00c..782d33be47 100644 --- a/src/tests/units/rsa-test.r3 +++ b/src/tests/units/rsa-test.r3 @@ -71,7 +71,7 @@ Rebol [ --assert "#(handle! rsa)" = mold key-pri ;@@ https://github.com/Oldes/Rebol-issues/issues/906 --assert [type] = words-of key-pri - --assert 'rsa = query/mode key-pri 'type + --assert 'rsa = query key-pri 'type ;-- note: you could use key-pri only as it contains the public properties too ;-- the key-pub is there just to simulate situation, where user have only the public parts diff --git a/src/tests/units/vector-test.r3 b/src/tests/units/vector-test.r3 index 7b6521024a..9713337be7 100644 --- a/src/tests/units/vector-test.r3 +++ b/src/tests/units/vector-test.r3 @@ -161,18 +161,18 @@ Rebol [ --test-- "QUERY on vector" ;@@ https://github.com/Oldes/Rebol-issues/issues/2352 v: make vector! [unsigned integer! 16 2] - o: query v + o: query v object! --assert object? o --assert not o/signed --assert o/type = 'integer! --assert o/size = 16 --assert o/length = 2 --test-- "QUERY/MODE on vector" - --assert [signed type size length] = query/mode v none - --assert [16 integer!] = query/mode v [size type] - --assert block? b: query/mode v [signed: length:] + --assert [signed type size length] = query v none + --assert [16 integer!] = query v [size type] + --assert block? b: query v [signed: length:] --assert all [not b/signed b/length = 2] - --assert 16 = query/mode v 'size + --assert 16 = query v 'size --assert 16 = size? v --test-- "REFLECT on vector" --assert 16 = reflect v 'size