0s autopkgtest [20:31:14]: starting date and time: 2024-03-16 20:31:14+0000 0s autopkgtest [20:31:14]: git checkout: b506e79c ssh-setup/nova: fix ARCH having two lines of data 0s autopkgtest [20:31:14]: host juju-7f2275-prod-proposed-migration-environment-3; command line: /home/ubuntu/autopkgtest/runner/autopkgtest --output-dir /tmp/autopkgtest-work.x5zrdy4l/out --timeout-copy=6000 --setup-commands /home/ubuntu/autopkgtest-cloud/worker-config-production/setup-canonical.sh --setup-commands /home/ubuntu/autopkgtest/setup-commands/setup-testbed --apt-pocket=proposed=src:r-base,src:curl,src:glib2.0,src:libpng1.6,src:libpsl,src:libtirpc,src:libxt,src:openssl,src:orthanc-python,src:readline,src:wp2latex --apt-upgrade r-cran-unitizer --timeout-short=300 --timeout-copy=20000 --timeout-build=20000 '--env=ADT_TEST_TRIGGERS=r-base/4.3.3-2build1 curl/8.5.0-2ubuntu7 glib2.0/2.79.3-3ubuntu5 libpng1.6/1.6.43-3 libpsl/0.21.2-1.1 libtirpc/1.3.4+ds-1.1 libxt/1:1.2.1-1.2 openssl/3.0.13-0ubuntu1 orthanc-python/4.1+ds-2build3 readline/8.2-3.1 wp2latex/4.4~ds-1build1' -- ssh -s /home/ubuntu/autopkgtest/ssh-setup/nova -- --flavor autopkgtest --security-groups autopkgtest-juju-7f2275-prod-proposed-migration-environment-3@bos03-arm64-11.secgroup --name adt-noble-arm64-r-cran-unitizer-20240316-203114-juju-7f2275-prod-proposed-migration-environment-3 --image adt/ubuntu-noble-arm64-server --keyname testbed-juju-7f2275-prod-proposed-migration-environment-3 --net-id=net_prod-proposed-migration -e TERM=linux -e ''"'"'http_proxy=http://squid.internal:3128'"'"'' -e ''"'"'https_proxy=http://squid.internal:3128'"'"'' -e ''"'"'no_proxy=127.0.0.1,127.0.1.1,login.ubuntu.com,localhost,localdomain,novalocal,internal,archive.ubuntu.com,ports.ubuntu.com,security.ubuntu.com,ddebs.ubuntu.com,changelogs.ubuntu.com,launchpadlibrarian.net,launchpadcontent.net,launchpad.net,10.24.0.0/24,keystone.ps5.canonical.com,objectstorage.prodstack5.canonical.com'"'"'' --mirror=http://ftpmaster.internal/ubuntu/ 99s autopkgtest [20:32:53]: testbed dpkg architecture: arm64 99s autopkgtest [20:32:53]: testbed apt version: 2.7.12 99s autopkgtest [20:32:53]: @@@@@@@@@@@@@@@@@@@@ test bed setup 100s Get:1 http://ftpmaster.internal/ubuntu noble-proposed InRelease [117 kB] 100s Get:2 http://ftpmaster.internal/ubuntu noble-proposed/universe Sources [3704 kB] 101s Get:3 http://ftpmaster.internal/ubuntu noble-proposed/restricted Sources [6540 B] 101s Get:4 http://ftpmaster.internal/ubuntu noble-proposed/main Sources [474 kB] 101s Get:5 http://ftpmaster.internal/ubuntu noble-proposed/multiverse Sources [51.4 kB] 101s Get:6 http://ftpmaster.internal/ubuntu noble-proposed/main arm64 Packages [646 kB] 101s Get:7 http://ftpmaster.internal/ubuntu noble-proposed/main arm64 c-n-f Metadata [3144 B] 101s Get:8 http://ftpmaster.internal/ubuntu noble-proposed/restricted arm64 Packages [33.6 kB] 101s Get:9 http://ftpmaster.internal/ubuntu noble-proposed/restricted arm64 c-n-f Metadata [116 B] 101s Get:10 http://ftpmaster.internal/ubuntu noble-proposed/universe arm64 Packages [4012 kB] 101s Get:11 http://ftpmaster.internal/ubuntu noble-proposed/universe arm64 c-n-f Metadata [8528 B] 101s Get:12 http://ftpmaster.internal/ubuntu noble-proposed/multiverse arm64 Packages [55.5 kB] 101s Get:13 http://ftpmaster.internal/ubuntu noble-proposed/multiverse arm64 c-n-f Metadata [116 B] 103s Fetched 9112 kB in 2s (4613 kB/s) 103s Reading package lists... 106s Reading package lists... 106s Building dependency tree... 106s Reading state information... 106s Calculating upgrade... 107s The following packages will be REMOVED: 107s libglib2.0-0 libssl3 107s The following NEW packages will be installed: 107s libglib2.0-0t64 libssl3t64 xdg-user-dirs 107s The following packages have been kept back: 107s curl 107s The following packages will be upgraded: 107s gir1.2-glib-2.0 libglib2.0-data libtirpc-common openssl readline-common 107s ubuntu-minimal ubuntu-standard 107s 7 upgraded, 3 newly installed, 2 to remove and 1 not upgraded. 107s Need to get 4613 kB of archives. 107s After this operation, 211 kB of additional disk space will be used. 107s Get:1 http://ftpmaster.internal/ubuntu noble-proposed/main arm64 gir1.2-glib-2.0 arm64 2.79.3-3ubuntu5 [182 kB] 107s Get:2 http://ftpmaster.internal/ubuntu noble-proposed/main arm64 libglib2.0-0t64 arm64 2.79.3-3ubuntu5 [1527 kB] 107s Get:3 http://ftpmaster.internal/ubuntu noble-proposed/main arm64 openssl arm64 3.0.13-0ubuntu1 [983 kB] 107s Get:4 http://ftpmaster.internal/ubuntu noble-proposed/main arm64 libssl3t64 arm64 3.0.13-0ubuntu1 [1770 kB] 107s Get:5 http://ftpmaster.internal/ubuntu noble-proposed/main arm64 libglib2.0-data all 2.79.3-3ubuntu5 [46.6 kB] 107s Get:6 http://ftpmaster.internal/ubuntu noble-proposed/main arm64 libtirpc-common all 1.3.4+ds-1.1 [8018 B] 107s Get:7 http://ftpmaster.internal/ubuntu noble-proposed/main arm64 readline-common all 8.2-3.1 [56.4 kB] 107s Get:8 http://ftpmaster.internal/ubuntu noble/main arm64 ubuntu-minimal arm64 1.536 [10.7 kB] 107s Get:9 http://ftpmaster.internal/ubuntu noble/main arm64 xdg-user-dirs arm64 0.18-1 [18.1 kB] 107s Get:10 http://ftpmaster.internal/ubuntu noble/main arm64 ubuntu-standard arm64 1.536 [10.7 kB] 108s Fetched 4613 kB in 1s (6234 kB/s) 109s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 74758 files and directories currently installed.) 109s Preparing to unpack .../gir1.2-glib-2.0_2.79.3-3ubuntu5_arm64.deb ... 109s Unpacking gir1.2-glib-2.0:arm64 (2.79.3-3ubuntu5) over (2.79.2-1~ubuntu1) ... 109s dpkg: libglib2.0-0:arm64: dependency problems, but removing anyway as you requested: 109s udisks2 depends on libglib2.0-0 (>= 2.77.0). 109s shared-mime-info depends on libglib2.0-0 (>= 2.75.3). 109s python3-gi depends on libglib2.0-0 (>= 2.77.0). 109s python3-dbus depends on libglib2.0-0 (>= 2.16.0). 109s netplan.io depends on libglib2.0-0 (>= 2.70.0). 109s netplan-generator depends on libglib2.0-0 (>= 2.70.0). 109s libxmlb2:arm64 depends on libglib2.0-0 (>= 2.54.0). 109s libvolume-key1:arm64 depends on libglib2.0-0 (>= 2.18.0). 109s libudisks2-0:arm64 depends on libglib2.0-0 (>= 2.75.3). 109s libqrtr-glib0:arm64 depends on libglib2.0-0 (>= 2.56). 109s libqmi-proxy depends on libglib2.0-0 (>= 2.30.0). 109s libqmi-glib5:arm64 depends on libglib2.0-0 (>= 2.54.0). 109s libpolkit-gobject-1-0:arm64 depends on libglib2.0-0 (>= 2.38.0). 109s libpolkit-agent-1-0:arm64 depends on libglib2.0-0 (>= 2.38.0). 109s libnetplan0:arm64 depends on libglib2.0-0 (>= 2.75.3). 109s libmm-glib0:arm64 depends on libglib2.0-0 (>= 2.62.0). 109s libmbim-proxy depends on libglib2.0-0 (>= 2.56). 109s libmbim-glib4:arm64 depends on libglib2.0-0 (>= 2.56). 109s libjson-glib-1.0-0:arm64 depends on libglib2.0-0 (>= 2.75.3). 109s libjcat1:arm64 depends on libglib2.0-0 (>= 2.75.3). 109s libgusb2:arm64 depends on libglib2.0-0 (>= 2.75.3). 109s libgudev-1.0-0:arm64 depends on libglib2.0-0 (>= 2.38.0). 109s libgirepository-1.0-1:arm64 depends on libglib2.0-0 (>= 2.79.0). 109s libfwupd2:arm64 depends on libglib2.0-0 (>= 2.79.0). 109s libblockdev3:arm64 depends on libglib2.0-0 (>= 2.42.2). 109s libblockdev-utils3:arm64 depends on libglib2.0-0 (>= 2.75.3). 109s libblockdev-swap3:arm64 depends on libglib2.0-0 (>= 2.42.2). 109s libblockdev-part3:arm64 depends on libglib2.0-0 (>= 2.42.2). 109s libblockdev-nvme3:arm64 depends on libglib2.0-0 (>= 2.42.2). 109s libblockdev-mdraid3:arm64 depends on libglib2.0-0 (>= 2.42.2). 109s libblockdev-loop3:arm64 depends on libglib2.0-0 (>= 2.42.2). 109s libblockdev-fs3:arm64 depends on libglib2.0-0 (>= 2.42.2). 109s libblockdev-crypto3:arm64 depends on libglib2.0-0 (>= 2.42.2). 109s fwupd depends on libglib2.0-0 (>= 2.79.0). 109s bolt depends on libglib2.0-0 (>= 2.56.0). 109s 109s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 74758 files and directories currently installed.) 109s Removing libglib2.0-0:arm64 (2.79.2-1~ubuntu1) ... 109s Selecting previously unselected package libglib2.0-0t64:arm64. 109s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 74733 files and directories currently installed.) 109s Preparing to unpack .../libglib2.0-0t64_2.79.3-3ubuntu5_arm64.deb ... 109s libglib2.0-0t64.preinst: Removing /var/lib/dpkg/info/libglib2.0-0:arm64.postrm to avoid loss of /usr/share/glib-2.0/schemas/gschemas.compiled... 109s removed '/var/lib/dpkg/info/libglib2.0-0:arm64.postrm' 109s Unpacking libglib2.0-0t64:arm64 (2.79.3-3ubuntu5) ... 109s Preparing to unpack .../openssl_3.0.13-0ubuntu1_arm64.deb ... 109s Unpacking openssl (3.0.13-0ubuntu1) over (3.0.10-1ubuntu4) ... 109s dpkg: libssl3:arm64: dependency problems, but removing anyway as you requested: 109s wget depends on libssl3 (>= 3.0.0). 109s u-boot-tools depends on libssl3 (>= 3.0.0). 109s tnftp depends on libssl3 (>= 3.0.0). 109s tcpdump depends on libssl3 (>= 3.0.0). 109s systemd-resolved depends on libssl3 (>= 3.0.0). 109s systemd depends on libssl3 (>= 3.0.0). 109s sudo depends on libssl3 (>= 3.0.0). 109s sbsigntool depends on libssl3 (>= 3.0.0). 109s rsync depends on libssl3 (>= 3.0.0). 109s python3-cryptography depends on libssl3 (>= 3.0.0). 109s openssh-server depends on libssl3 (>= 3.0.10). 109s openssh-client depends on libssl3 (>= 3.0.10). 109s mtd-utils depends on libssl3 (>= 3.0.0). 109s mokutil depends on libssl3 (>= 3.0.0). 109s linux-headers-6.8.0-11-generic depends on libssl3 (>= 3.0.0). 109s libsystemd-shared:arm64 depends on libssl3 (>= 3.0.0). 109s libssh-4:arm64 depends on libssl3 (>= 3.0.0). 109s libsasl2-modules:arm64 depends on libssl3 (>= 3.0.0). 109s libsasl2-2:arm64 depends on libssl3 (>= 3.0.0). 109s libpython3.12-minimal:arm64 depends on libssl3 (>= 3.0.0). 109s libnvme1 depends on libssl3 (>= 3.0.0). 109s libkrb5-3:arm64 depends on libssl3 (>= 3.0.0). 109s libkmod2:arm64 depends on libssl3 (>= 3.0.0). 109s libfido2-1:arm64 depends on libssl3 (>= 3.0.0). 109s libcurl4:arm64 depends on libssl3 (>= 3.0.0). 109s libcryptsetup12:arm64 depends on libssl3 (>= 3.0.0). 109s kmod depends on libssl3 (>= 3.0.0). 109s dhcpcd-base depends on libssl3 (>= 3.0.0). 109s bind9-libs:arm64 depends on libssl3 (>= 3.0.0). 109s 109s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 74758 files and directories currently installed.) 109s Removing libssl3:arm64 (3.0.10-1ubuntu4) ... 109s Selecting previously unselected package libssl3t64:arm64. 109s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 74747 files and directories currently installed.) 109s Preparing to unpack .../0-libssl3t64_3.0.13-0ubuntu1_arm64.deb ... 109s Unpacking libssl3t64:arm64 (3.0.13-0ubuntu1) ... 109s Preparing to unpack .../1-libglib2.0-data_2.79.3-3ubuntu5_all.deb ... 109s Unpacking libglib2.0-data (2.79.3-3ubuntu5) over (2.79.2-1~ubuntu1) ... 109s Preparing to unpack .../2-libtirpc-common_1.3.4+ds-1.1_all.deb ... 109s Unpacking libtirpc-common (1.3.4+ds-1.1) over (1.3.4+ds-1build1) ... 110s Preparing to unpack .../3-readline-common_8.2-3.1_all.deb ... 110s Unpacking readline-common (8.2-3.1) over (8.2-3) ... 110s Preparing to unpack .../4-ubuntu-minimal_1.536_arm64.deb ... 110s Unpacking ubuntu-minimal (1.536) over (1.535) ... 110s Selecting previously unselected package xdg-user-dirs. 110s Preparing to unpack .../5-xdg-user-dirs_0.18-1_arm64.deb ... 110s Unpacking xdg-user-dirs (0.18-1) ... 110s Preparing to unpack .../6-ubuntu-standard_1.536_arm64.deb ... 110s Unpacking ubuntu-standard (1.536) over (1.535) ... 110s Setting up ubuntu-minimal (1.536) ... 110s Setting up xdg-user-dirs (0.18-1) ... 110s Setting up libssl3t64:arm64 (3.0.13-0ubuntu1) ... 110s Setting up libtirpc-common (1.3.4+ds-1.1) ... 110s Setting up ubuntu-standard (1.536) ... 110s Setting up libglib2.0-0t64:arm64 (2.79.3-3ubuntu5) ... 110s No schema files found: doing nothing. 110s Setting up libglib2.0-data (2.79.3-3ubuntu5) ... 110s Setting up gir1.2-glib-2.0:arm64 (2.79.3-3ubuntu5) ... 110s Setting up openssl (3.0.13-0ubuntu1) ... 110s Setting up readline-common (8.2-3.1) ... 110s Processing triggers for man-db (2.12.0-3) ... 111s Processing triggers for install-info (7.1-3) ... 111s Processing triggers for libc-bin (2.39-0ubuntu2) ... 111s Reading package lists... 111s Building dependency tree... 111s Reading state information... 112s 0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded. 113s sh: Attempting to set up Debian/Ubuntu apt sources automatically 113s sh: Distribution appears to be Ubuntu 114s Reading package lists... 114s Building dependency tree... 114s Reading state information... 115s eatmydata is already the newest version (131-1). 115s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 115s Reading package lists... 115s Building dependency tree... 115s Reading state information... 115s dbus is already the newest version (1.14.10-4ubuntu1). 115s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 116s Reading package lists... 116s Building dependency tree... 116s Reading state information... 116s rng-tools-debian is already the newest version (2.4). 116s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 116s Reading package lists... 117s Building dependency tree... 117s Reading state information... 117s The following packages will be REMOVED: 117s cloud-init* python3-configobj* python3-debconf* 118s 0 upgraded, 0 newly installed, 3 to remove and 0 not upgraded. 118s After this operation, 3252 kB disk space will be freed. 118s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 74774 files and directories currently installed.) 118s Removing cloud-init (24.1.1-0ubuntu1) ... 123s Removing python3-configobj (5.0.8-3) ... 126s Removing python3-debconf (1.5.86) ... 128s Processing triggers for man-db (2.12.0-3) ... 129s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 74385 files and directories currently installed.) 129s Purging configuration files for cloud-init (24.1.1-0ubuntu1) ... 131s dpkg: warning: while removing cloud-init, directory '/etc/cloud/cloud.cfg.d' not empty so not removed 131s Processing triggers for rsyslog (8.2312.0-3ubuntu3) ... 131s invoke-rc.d: policy-rc.d denied execution of try-restart. 132s Reading package lists... 132s Building dependency tree... 132s Reading state information... 132s linux-generic is already the newest version (6.8.0-11.11+1). 132s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 133s Hit:1 http://ftpmaster.internal/ubuntu noble InRelease 133s Hit:2 http://ftpmaster.internal/ubuntu noble-updates InRelease 133s Hit:3 http://ftpmaster.internal/ubuntu noble-security InRelease 135s Reading package lists... 135s Reading package lists... 135s Building dependency tree... 135s Reading state information... 136s Calculating upgrade... 136s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 136s Reading package lists... 136s Building dependency tree... 136s Reading state information... 137s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 137s autopkgtest [20:33:31]: rebooting testbed after setup commands that affected boot 180s autopkgtest-virt-ssh: WARNING: ssh connection failed. Retrying in 3 seconds... 198s autopkgtest [20:34:32]: testbed running kernel: Linux 6.8.0-11-generic #11-Ubuntu SMP PREEMPT_DYNAMIC Wed Feb 14 02:53:31 UTC 2024 201s autopkgtest [20:34:35]: @@@@@@@@@@@@@@@@@@@@ apt-source r-cran-unitizer 205s Get:1 http://ftpmaster.internal/ubuntu noble/universe r-cran-unitizer 1.4.20-1 (dsc) [2167 B] 205s Get:2 http://ftpmaster.internal/ubuntu noble/universe r-cran-unitizer 1.4.20-1 (tar) [609 kB] 205s Get:3 http://ftpmaster.internal/ubuntu noble/universe r-cran-unitizer 1.4.20-1 (diff) [3464 B] 205s gpgv: Signature made Fri Oct 27 13:07:12 2023 UTC 205s gpgv: using RSA key F1F007320A035541F0A663CA578A0494D1C646D1 205s gpgv: issuer "tille@debian.org" 205s gpgv: Can't check signature: No public key 205s dpkg-source: warning: cannot verify inline signature for ./r-cran-unitizer_1.4.20-1.dsc: no acceptable signature found 205s autopkgtest [20:34:39]: testing package r-cran-unitizer version 1.4.20-1 206s autopkgtest [20:34:40]: build not needed 207s autopkgtest [20:34:41]: test run-unit-test: preparing testbed 208s Reading package lists... 209s Building dependency tree... 209s Reading state information... 209s Starting pkgProblemResolver with broken count: 0 209s Starting 2 pkgProblemResolver with broken count: 0 209s Done 210s The following additional packages will be installed: 210s fontconfig fontconfig-config fonts-dejavu-core fonts-dejavu-mono 210s fonts-font-awesome fonts-glyphicons-halflings fonts-mathjax 210s javascript-common libblas3 libcairo2 libdatrie1 libdeflate0 libfontconfig1 210s libgfortran5 libgomp1 libgraphite2-3 libharfbuzz0b libice6 libjbig0 210s libjpeg-turbo8 libjpeg8 libjs-bootstrap libjs-bootstrap4 libjs-d3 210s libjs-es5-shim libjs-highlight.js libjs-jquery libjs-jquery-datatables 210s libjs-jquery-selectize.js libjs-jquery-ui libjs-json libjs-mathjax 210s libjs-microplugin.js libjs-modernizr libjs-popper.js libjs-prettify 210s libjs-sifter.js libjs-twitter-bootstrap-datepicker liblapack3 liblerc4 210s liblua5.4-0 libpango-1.0-0 libpangocairo-1.0-0 libpangoft2-1.0-0 210s libpaper-utils libpaper1 libpixman-1-0 libsharpyuv0 libsm6 libtcl8.6 210s libthai-data libthai0 libtiff6 libtk8.6 libwebp7 libxcb-render0 libxcb-shm0 210s libxft2 libxrender1 libxss1 libxt6 littler node-bootstrap-sass 210s node-html5shiv node-normalize.css pandoc pandoc-data r-base-core 210s r-cran-base64enc r-cran-bslib r-cran-cachem r-cran-cli r-cran-commonmark 210s r-cran-crayon r-cran-diffobj r-cran-digest r-cran-ellipsis r-cran-evaluate 210s r-cran-fastmap r-cran-fontawesome r-cran-fs r-cran-glue r-cran-highr 210s r-cran-htmltools r-cran-httpuv r-cran-jquerylib r-cran-jsonlite r-cran-knitr 210s r-cran-later r-cran-lifecycle r-cran-littler r-cran-magrittr r-cran-memoise 210s r-cran-mime r-cran-pkgkitten r-cran-promises r-cran-r6 r-cran-rappdirs 210s r-cran-rcpp r-cran-rlang r-cran-rmarkdown r-cran-sass r-cran-shiny 210s r-cran-sourcetools r-cran-stringi r-cran-stringr r-cran-tinytex 210s r-cran-unitizer r-cran-vctrs r-cran-withr r-cran-xfun r-cran-xtable 210s r-cran-yaml unzip x11-common xdg-utils zip 210s Suggested packages: 210s apache2 | lighttpd | httpd libjs-jquery-ui-docs fonts-mathjax-extras 210s fonts-stix libjs-mathjax-doc tcl8.6 tk8.6 nodejs texlive-latex-recommended 210s texlive-xetex texlive-luatex pandoc-citeproc texlive-latex-extra context 210s wkhtmltopdf librsvg2-bin groff ghc php python ruby libjs-katex 210s citation-style-language-styles elpa-ess r-doc-info | r-doc-pdf r-mathlib 210s r-base-html r-cran-rstudioapi r-cran-markdown r-cran-testthat r-cran-getopt 210s r-cran-covr r-cran-httr r-cran-roxygen2 r-cran-inline r-cran-callr 210s r-cran-plm r-cran-zoo r-cran-survival 210s Recommended packages: 210s node-jquery r-recommended r-base-dev r-doc-html r-cran-curl r-cran-ggplot2 210s r-cran-testthat r-cran-thematic r-cran-callr r-cran-covr r-cran-htmlwidgets 210s r-cran-mockery r-cran-processx r-cran-ps r-cran-rprojroot r-cran-rstudioapi 210s r-cran-tibble r-cran-whoami r-cran-xml2 r-cran-lattice r-cran-dplyr 210s r-cran-rsvg r-cran-pillar r-cran-spelling r-cran-dbi r-cran-rsqlite 210s r-cran-waldo r-cran-testit r-cran-cairo r-cran-markdown r-cran-ragg 210s r-cran-httr r-cran-r.rsp r-cran-sf r-cran-codetools r-cran-formatr 210s r-cran-gridsvg r-cran-jpeg r-cran-magick r-cran-png r-cran-reticulate 210s r-cran-rgl r-cran-tikzdevice r-cran-webshot r-cran-svglite node-highlight.js 210s r-cran-lintr r-cran-tidyverse r-cran-future r-cran-purrr r-cran-usethis 210s r-cran-dygraphs r-cran-rsconnect r-cran-downlit r-cran-bit64 r-cran-generics 210s r-cran-pkgdown r-cran-zeallot r-cran-remotes r-cran-renv r-cran-runit 210s libfile-mimeinfo-perl libnet-dbus-perl libx11-protocol-perl x11-utils 210s x11-xserver-utils 210s The following NEW packages will be installed: 210s autopkgtest-satdep fontconfig fontconfig-config fonts-dejavu-core 210s fonts-dejavu-mono fonts-font-awesome fonts-glyphicons-halflings 210s fonts-mathjax javascript-common libblas3 libcairo2 libdatrie1 libdeflate0 210s libfontconfig1 libgfortran5 libgomp1 libgraphite2-3 libharfbuzz0b libice6 210s libjbig0 libjpeg-turbo8 libjpeg8 libjs-bootstrap libjs-bootstrap4 libjs-d3 210s libjs-es5-shim libjs-highlight.js libjs-jquery libjs-jquery-datatables 210s libjs-jquery-selectize.js libjs-jquery-ui libjs-json libjs-mathjax 210s libjs-microplugin.js libjs-modernizr libjs-popper.js libjs-prettify 210s libjs-sifter.js libjs-twitter-bootstrap-datepicker liblapack3 liblerc4 210s liblua5.4-0 libpango-1.0-0 libpangocairo-1.0-0 libpangoft2-1.0-0 210s libpaper-utils libpaper1 libpixman-1-0 libsharpyuv0 libsm6 libtcl8.6 210s libthai-data libthai0 libtiff6 libtk8.6 libwebp7 libxcb-render0 libxcb-shm0 210s libxft2 libxrender1 libxss1 libxt6 littler node-bootstrap-sass 210s node-html5shiv node-normalize.css pandoc pandoc-data r-base-core 210s r-cran-base64enc r-cran-bslib r-cran-cachem r-cran-cli r-cran-commonmark 210s r-cran-crayon r-cran-diffobj r-cran-digest r-cran-ellipsis r-cran-evaluate 210s r-cran-fastmap r-cran-fontawesome r-cran-fs r-cran-glue r-cran-highr 210s r-cran-htmltools r-cran-httpuv r-cran-jquerylib r-cran-jsonlite r-cran-knitr 210s r-cran-later r-cran-lifecycle r-cran-littler r-cran-magrittr r-cran-memoise 210s r-cran-mime r-cran-pkgkitten r-cran-promises r-cran-r6 r-cran-rappdirs 210s r-cran-rcpp r-cran-rlang r-cran-rmarkdown r-cran-sass r-cran-shiny 210s r-cran-sourcetools r-cran-stringi r-cran-stringr r-cran-tinytex 210s r-cran-unitizer r-cran-vctrs r-cran-withr r-cran-xfun r-cran-xtable 210s r-cran-yaml unzip x11-common xdg-utils zip 210s 0 upgraded, 118 newly installed, 0 to remove and 0 not upgraded. 210s Need to get 103 MB/103 MB of archives. 210s After this operation, 419 MB of additional disk space will be used. 210s Get:1 /tmp/autopkgtest.dIKf7I/1-autopkgtest-satdep.deb autopkgtest-satdep arm64 0 [724 B] 210s Get:2 http://ftpmaster.internal/ubuntu noble/main arm64 fonts-dejavu-mono all 2.37-8 [502 kB] 210s Get:3 http://ftpmaster.internal/ubuntu noble/main arm64 fonts-dejavu-core all 2.37-8 [835 kB] 210s Get:4 http://ftpmaster.internal/ubuntu noble/main arm64 fontconfig-config arm64 2.15.0-1ubuntu1 [37.0 kB] 210s Get:5 http://ftpmaster.internal/ubuntu noble/main arm64 libfontconfig1 arm64 2.15.0-1ubuntu1 [142 kB] 210s Get:6 http://ftpmaster.internal/ubuntu noble/main arm64 fontconfig arm64 2.15.0-1ubuntu1 [190 kB] 210s Get:7 http://ftpmaster.internal/ubuntu noble/main arm64 fonts-font-awesome all 5.0.10+really4.7.0~dfsg-4.1 [516 kB] 210s Get:8 http://ftpmaster.internal/ubuntu noble/universe arm64 fonts-glyphicons-halflings all 1.009~3.4.1+dfsg-3 [118 kB] 210s Get:9 http://ftpmaster.internal/ubuntu noble/main arm64 fonts-mathjax all 2.7.9+dfsg-1 [2208 kB] 211s Get:10 http://ftpmaster.internal/ubuntu noble/main arm64 javascript-common all 11+nmu1 [5936 B] 211s Get:11 http://ftpmaster.internal/ubuntu noble/main arm64 libblas3 arm64 3.12.0-3 [143 kB] 211s Get:12 http://ftpmaster.internal/ubuntu noble/main arm64 libpixman-1-0 arm64 0.42.2-1 [193 kB] 211s Get:13 http://ftpmaster.internal/ubuntu noble/main arm64 libxcb-render0 arm64 1.15-1 [16.1 kB] 211s Get:14 http://ftpmaster.internal/ubuntu noble/main arm64 libxcb-shm0 arm64 1.15-1 [5780 B] 211s Get:15 http://ftpmaster.internal/ubuntu noble/main arm64 libxrender1 arm64 1:0.9.10-1.1 [19.1 kB] 211s Get:16 http://ftpmaster.internal/ubuntu noble/main arm64 libcairo2 arm64 1.18.0-1 [550 kB] 211s Get:17 http://ftpmaster.internal/ubuntu noble/main arm64 libdatrie1 arm64 0.2.13-3 [21.7 kB] 211s Get:18 http://ftpmaster.internal/ubuntu noble/main arm64 libdeflate0 arm64 1.19-1 [43.4 kB] 211s Get:19 http://ftpmaster.internal/ubuntu noble/main arm64 libgfortran5 arm64 14-20240303-1ubuntu1 [444 kB] 211s Get:20 http://ftpmaster.internal/ubuntu noble/main arm64 libgomp1 arm64 14-20240303-1ubuntu1 [144 kB] 211s Get:21 http://ftpmaster.internal/ubuntu noble/main arm64 libgraphite2-3 arm64 1.3.14-2 [81.5 kB] 211s Get:22 http://ftpmaster.internal/ubuntu noble/main arm64 libharfbuzz0b arm64 8.3.0-2 [463 kB] 211s Get:23 http://ftpmaster.internal/ubuntu noble/main arm64 x11-common all 1:7.7+23ubuntu2 [23.4 kB] 211s Get:24 http://ftpmaster.internal/ubuntu noble/main arm64 libice6 arm64 2:1.0.10-1build2 [41.7 kB] 211s Get:25 http://ftpmaster.internal/ubuntu noble/main arm64 libjpeg-turbo8 arm64 2.1.5-2ubuntu1 [160 kB] 211s Get:26 http://ftpmaster.internal/ubuntu noble/main arm64 libjpeg8 arm64 8c-2ubuntu11 [2148 B] 211s Get:27 http://ftpmaster.internal/ubuntu noble/universe arm64 libjs-bootstrap all 3.4.1+dfsg-3 [129 kB] 211s Get:28 http://ftpmaster.internal/ubuntu noble/universe arm64 libjs-popper.js all 1.16.1+ds-6 [54.1 kB] 211s Get:29 http://ftpmaster.internal/ubuntu noble/universe arm64 libjs-bootstrap4 all 4.6.1+dfsg1-4 [537 kB] 211s Get:30 http://ftpmaster.internal/ubuntu noble/universe arm64 libjs-d3 all 3.5.17-4 [132 kB] 211s Get:31 http://ftpmaster.internal/ubuntu noble/universe arm64 libjs-es5-shim all 4.6.7-2 [39.8 kB] 211s Get:32 http://ftpmaster.internal/ubuntu noble/universe arm64 libjs-highlight.js all 9.18.5+dfsg1-2 [385 kB] 211s Get:33 http://ftpmaster.internal/ubuntu noble/main arm64 libjs-jquery all 3.6.1+dfsg+~3.5.14-1 [328 kB] 211s Get:34 http://ftpmaster.internal/ubuntu noble/universe arm64 libjs-jquery-datatables all 1.11.5+dfsg-2 [146 kB] 211s Get:35 http://ftpmaster.internal/ubuntu noble/universe arm64 libjs-sifter.js all 0.6.0+dfsg-3 [12.6 kB] 211s Get:36 http://ftpmaster.internal/ubuntu noble/universe arm64 libjs-microplugin.js all 0.0.3+dfsg-1.1 [3712 B] 211s Get:37 http://ftpmaster.internal/ubuntu noble/universe arm64 libjs-jquery-selectize.js all 0.12.6+dfsg-1.1 [51.0 kB] 211s Get:38 http://ftpmaster.internal/ubuntu noble/universe arm64 libjs-jquery-ui all 1.13.2+dfsg-1 [252 kB] 211s Get:39 http://ftpmaster.internal/ubuntu noble/universe arm64 libjs-json all 0~20221030+~1.0.8-1 [20.6 kB] 211s Get:40 http://ftpmaster.internal/ubuntu noble/universe arm64 libjs-prettify all 2015.12.04+dfsg-1.1 [39.3 kB] 211s Get:41 http://ftpmaster.internal/ubuntu noble/main arm64 liblapack3 arm64 3.12.0-3 [2241 kB] 211s Get:42 http://ftpmaster.internal/ubuntu noble/main arm64 liblerc4 arm64 4.0.0+ds-4ubuntu1 [153 kB] 211s Get:43 http://ftpmaster.internal/ubuntu noble/main arm64 liblua5.4-0 arm64 5.4.6-3 [158 kB] 211s Get:44 http://ftpmaster.internal/ubuntu noble/main arm64 libthai-data all 0.1.29-2 [158 kB] 211s Get:45 http://ftpmaster.internal/ubuntu noble/main arm64 libthai0 arm64 0.1.29-2 [18.1 kB] 211s Get:46 http://ftpmaster.internal/ubuntu noble/main arm64 libpango-1.0-0 arm64 1.51.0+ds-4 [226 kB] 211s Get:47 http://ftpmaster.internal/ubuntu noble/main arm64 libpangoft2-1.0-0 arm64 1.51.0+ds-4 [41.2 kB] 211s Get:48 http://ftpmaster.internal/ubuntu noble/main arm64 libpangocairo-1.0-0 arm64 1.51.0+ds-4 [27.6 kB] 211s Get:49 http://ftpmaster.internal/ubuntu noble/main arm64 libpaper1 arm64 1.1.29 [13.1 kB] 211s Get:50 http://ftpmaster.internal/ubuntu noble/main arm64 libpaper-utils arm64 1.1.29 [8480 B] 211s Get:51 http://ftpmaster.internal/ubuntu noble/main arm64 libsharpyuv0 arm64 1.3.2-0.4 [14.4 kB] 211s Get:52 http://ftpmaster.internal/ubuntu noble/main arm64 libsm6 arm64 2:1.2.3-1build2 [16.1 kB] 211s Get:53 http://ftpmaster.internal/ubuntu noble/main arm64 libtcl8.6 arm64 8.6.13+dfsg-2 [980 kB] 211s Get:54 http://ftpmaster.internal/ubuntu noble/main arm64 libjbig0 arm64 2.1-6.1ubuntu1 [28.9 kB] 211s Get:55 http://ftpmaster.internal/ubuntu noble/main arm64 libwebp7 arm64 1.3.2-0.4 [191 kB] 211s Get:56 http://ftpmaster.internal/ubuntu noble/main arm64 libtiff6 arm64 4.5.1+git230720-3ubuntu1 [226 kB] 211s Get:57 http://ftpmaster.internal/ubuntu noble/main arm64 libxft2 arm64 2.3.6-1 [43.3 kB] 211s Get:58 http://ftpmaster.internal/ubuntu noble/main arm64 libxss1 arm64 1:1.2.3-1build2 [8252 B] 211s Get:59 http://ftpmaster.internal/ubuntu noble/main arm64 libtk8.6 arm64 8.6.13-2 [760 kB] 211s Get:60 http://ftpmaster.internal/ubuntu noble/main arm64 libxt6 arm64 1:1.2.1-1.1 [167 kB] 211s Get:61 http://ftpmaster.internal/ubuntu noble/main arm64 zip arm64 3.0-13 [172 kB] 211s Get:62 http://ftpmaster.internal/ubuntu noble/main arm64 unzip arm64 6.0-28ubuntu3 [171 kB] 211s Get:63 http://ftpmaster.internal/ubuntu noble/main arm64 xdg-utils all 1.1.3-4.1ubuntu3 [62.0 kB] 211s Get:64 http://ftpmaster.internal/ubuntu noble/universe arm64 r-base-core arm64 4.3.2-1build1 [26.8 MB] 212s Get:65 http://ftpmaster.internal/ubuntu noble/universe arm64 r-cran-littler arm64 0.3.19-1 [93.4 kB] 212s Get:66 http://ftpmaster.internal/ubuntu noble/universe arm64 littler all 0.3.19-1 [2472 B] 212s Get:67 http://ftpmaster.internal/ubuntu noble/universe arm64 node-bootstrap-sass all 3.4.3-2 [187 kB] 212s Get:68 http://ftpmaster.internal/ubuntu noble/universe arm64 node-html5shiv all 3.7.3+dfsg-5 [13.5 kB] 212s Get:69 http://ftpmaster.internal/ubuntu noble/universe arm64 node-normalize.css all 8.0.1-5 [10.8 kB] 212s Get:70 http://ftpmaster.internal/ubuntu noble/universe arm64 pandoc-data all 3.1.3-1 [92.4 kB] 212s Get:71 http://ftpmaster.internal/ubuntu noble/universe arm64 pandoc arm64 3.1.3+ds-2 [27.7 MB] 212s Get:72 http://ftpmaster.internal/ubuntu noble/universe arm64 r-cran-base64enc arm64 0.1-3-3 [27.4 kB] 212s Get:73 http://ftpmaster.internal/ubuntu noble/universe arm64 r-cran-rlang arm64 1.1.3-1 [1663 kB] 212s Get:74 http://ftpmaster.internal/ubuntu noble/universe arm64 r-cran-fastmap arm64 1.1.1-1 [69.6 kB] 212s Get:75 http://ftpmaster.internal/ubuntu noble/universe arm64 r-cran-cachem arm64 1.0.8-1 [72.3 kB] 212s Get:76 http://ftpmaster.internal/ubuntu noble/universe arm64 r-cran-digest arm64 0.6.34-1 [182 kB] 213s Get:77 http://ftpmaster.internal/ubuntu noble/universe arm64 r-cran-ellipsis arm64 0.3.2-2 [35.5 kB] 213s Get:78 http://ftpmaster.internal/ubuntu noble/universe arm64 r-cran-htmltools arm64 0.5.7-1 [369 kB] 213s Get:79 http://ftpmaster.internal/ubuntu noble/universe arm64 r-cran-jquerylib all 0.1.4+dfsg-4 [13.5 kB] 213s Get:80 http://ftpmaster.internal/ubuntu noble/universe arm64 r-cran-jsonlite arm64 1.8.8+dfsg-1 [441 kB] 213s Get:81 http://ftpmaster.internal/ubuntu noble/universe arm64 r-cran-cli arm64 3.6.2-1 [1377 kB] 213s Get:82 http://ftpmaster.internal/ubuntu noble/universe arm64 r-cran-glue arm64 1.7.0-1 [154 kB] 213s Get:83 http://ftpmaster.internal/ubuntu noble/universe arm64 r-cran-lifecycle all 1.0.4+dfsg-1 [110 kB] 213s Get:84 http://ftpmaster.internal/ubuntu noble/universe arm64 r-cran-memoise all 2.0.1-1 [53.9 kB] 213s Get:85 http://ftpmaster.internal/ubuntu noble/universe arm64 r-cran-mime arm64 0.12-1 [35.8 kB] 213s Get:86 http://ftpmaster.internal/ubuntu noble/universe arm64 r-cran-fs arm64 1.6.3+dfsg-1 [227 kB] 213s Get:87 http://ftpmaster.internal/ubuntu noble/universe arm64 r-cran-r6 all 2.5.1-1 [99.0 kB] 213s Get:88 http://ftpmaster.internal/ubuntu noble/universe arm64 r-cran-rappdirs arm64 0.3.3-1 [47.5 kB] 213s Get:89 http://ftpmaster.internal/ubuntu noble/universe arm64 r-cran-sass arm64 0.4.8+dfsg-1 [952 kB] 213s Get:90 http://ftpmaster.internal/ubuntu noble/universe arm64 r-cran-bslib all 0.6.1+dfsg-1 [5138 kB] 213s Get:91 http://ftpmaster.internal/ubuntu noble/universe arm64 r-cran-commonmark arm64 1.9.1-1 [127 kB] 213s Get:92 http://ftpmaster.internal/ubuntu noble/universe arm64 r-cran-crayon all 1.5.2-1 [164 kB] 213s Get:93 http://ftpmaster.internal/ubuntu noble/universe arm64 r-cran-diffobj arm64 0.3.5-1 [1116 kB] 213s Get:94 http://ftpmaster.internal/ubuntu noble/universe arm64 r-cran-evaluate all 0.23-1 [90.2 kB] 213s Get:95 http://ftpmaster.internal/ubuntu noble/universe arm64 r-cran-fontawesome all 0.5.2-1 [1300 kB] 213s Get:96 http://ftpmaster.internal/ubuntu noble/universe arm64 r-cran-xfun arm64 0.41+dfsg-1 [415 kB] 213s Get:97 http://ftpmaster.internal/ubuntu noble/universe arm64 r-cran-highr all 0.10+dfsg-1 [38.3 kB] 213s Get:98 http://ftpmaster.internal/ubuntu noble/universe arm64 r-cran-pkgkitten all 0.2.3-1 [25.1 kB] 213s Get:99 http://ftpmaster.internal/ubuntu noble/universe arm64 r-cran-rcpp arm64 1.0.12-1 [1971 kB] 213s Get:100 http://ftpmaster.internal/ubuntu noble/universe arm64 r-cran-later arm64 1.3.2+dfsg-1 [120 kB] 213s Get:101 http://ftpmaster.internal/ubuntu noble/universe arm64 r-cran-magrittr arm64 2.0.3-1 [154 kB] 213s Get:102 http://ftpmaster.internal/ubuntu noble/universe arm64 r-cran-promises arm64 1.2.1+dfsg-1 [282 kB] 213s Get:103 http://ftpmaster.internal/ubuntu noble/universe arm64 r-cran-httpuv arm64 1.6.14+dfsg-1 [496 kB] 213s Get:104 http://ftpmaster.internal/ubuntu noble/universe arm64 r-cran-yaml arm64 2.3.8-1 [107 kB] 213s Get:105 http://ftpmaster.internal/ubuntu noble/main arm64 libjs-mathjax all 2.7.9+dfsg-1 [5665 kB] 214s Get:106 http://ftpmaster.internal/ubuntu noble/universe arm64 r-cran-knitr all 1.45+dfsg-1 [917 kB] 214s Get:107 http://ftpmaster.internal/ubuntu noble/universe arm64 r-cran-stringi arm64 1.8.3-1 [869 kB] 214s Get:108 http://ftpmaster.internal/ubuntu noble/universe arm64 r-cran-vctrs arm64 0.6.5-1 [1327 kB] 214s Get:109 http://ftpmaster.internal/ubuntu noble/universe arm64 r-cran-stringr all 1.5.1-1 [290 kB] 214s Get:110 http://ftpmaster.internal/ubuntu noble/universe arm64 r-cran-tinytex all 0.49-1 [141 kB] 214s Get:111 http://ftpmaster.internal/ubuntu noble/universe arm64 libjs-modernizr all 2.6.2+ds1-5 [48.3 kB] 214s Get:112 http://ftpmaster.internal/ubuntu noble/universe arm64 r-cran-xtable all 1:1.8-4-2 [689 kB] 214s Get:113 http://ftpmaster.internal/ubuntu noble/universe arm64 r-cran-sourcetools arm64 0.1.7-1-1 [47.2 kB] 214s Get:114 http://ftpmaster.internal/ubuntu noble/universe arm64 r-cran-withr all 2.5.0-1 [225 kB] 214s Get:115 http://ftpmaster.internal/ubuntu noble/universe arm64 libjs-twitter-bootstrap-datepicker all 1.3.1+dfsg1-4.1 [28.5 kB] 214s Get:116 http://ftpmaster.internal/ubuntu noble/universe arm64 r-cran-shiny all 1.8.0+dfsg-1 [2762 kB] 214s Get:117 http://ftpmaster.internal/ubuntu noble/universe arm64 r-cran-rmarkdown all 2.25+dfsg-3 [1481 kB] 214s Get:118 http://ftpmaster.internal/ubuntu noble/universe arm64 r-cran-unitizer all 1.4.20-1 [1419 kB] 216s Preconfiguring packages ... 216s Fetched 103 MB in 4s (24.2 MB/s) 216s Selecting previously unselected package fonts-dejavu-mono. 216s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 74330 files and directories currently installed.) 216s Preparing to unpack .../000-fonts-dejavu-mono_2.37-8_all.deb ... 216s Unpacking fonts-dejavu-mono (2.37-8) ... 216s Selecting previously unselected package fonts-dejavu-core. 216s Preparing to unpack .../001-fonts-dejavu-core_2.37-8_all.deb ... 216s Unpacking fonts-dejavu-core (2.37-8) ... 216s Selecting previously unselected package fontconfig-config. 217s Preparing to unpack .../002-fontconfig-config_2.15.0-1ubuntu1_arm64.deb ... 217s Unpacking fontconfig-config (2.15.0-1ubuntu1) ... 217s Selecting previously unselected package libfontconfig1:arm64. 217s Preparing to unpack .../003-libfontconfig1_2.15.0-1ubuntu1_arm64.deb ... 217s Unpacking libfontconfig1:arm64 (2.15.0-1ubuntu1) ... 217s Selecting previously unselected package fontconfig. 217s Preparing to unpack .../004-fontconfig_2.15.0-1ubuntu1_arm64.deb ... 217s Unpacking fontconfig (2.15.0-1ubuntu1) ... 217s Selecting previously unselected package fonts-font-awesome. 217s Preparing to unpack .../005-fonts-font-awesome_5.0.10+really4.7.0~dfsg-4.1_all.deb ... 217s Unpacking fonts-font-awesome (5.0.10+really4.7.0~dfsg-4.1) ... 217s Selecting previously unselected package fonts-glyphicons-halflings. 217s Preparing to unpack .../006-fonts-glyphicons-halflings_1.009~3.4.1+dfsg-3_all.deb ... 217s Unpacking fonts-glyphicons-halflings (1.009~3.4.1+dfsg-3) ... 217s Selecting previously unselected package fonts-mathjax. 217s Preparing to unpack .../007-fonts-mathjax_2.7.9+dfsg-1_all.deb ... 217s Unpacking fonts-mathjax (2.7.9+dfsg-1) ... 218s Selecting previously unselected package javascript-common. 218s Preparing to unpack .../008-javascript-common_11+nmu1_all.deb ... 218s Unpacking javascript-common (11+nmu1) ... 218s Selecting previously unselected package libblas3:arm64. 218s Preparing to unpack .../009-libblas3_3.12.0-3_arm64.deb ... 218s Unpacking libblas3:arm64 (3.12.0-3) ... 218s Selecting previously unselected package libpixman-1-0:arm64. 218s Preparing to unpack .../010-libpixman-1-0_0.42.2-1_arm64.deb ... 218s Unpacking libpixman-1-0:arm64 (0.42.2-1) ... 218s Selecting previously unselected package libxcb-render0:arm64. 218s Preparing to unpack .../011-libxcb-render0_1.15-1_arm64.deb ... 218s Unpacking libxcb-render0:arm64 (1.15-1) ... 218s Selecting previously unselected package libxcb-shm0:arm64. 218s Preparing to unpack .../012-libxcb-shm0_1.15-1_arm64.deb ... 218s Unpacking libxcb-shm0:arm64 (1.15-1) ... 218s Selecting previously unselected package libxrender1:arm64. 218s Preparing to unpack .../013-libxrender1_1%3a0.9.10-1.1_arm64.deb ... 218s Unpacking libxrender1:arm64 (1:0.9.10-1.1) ... 218s Selecting previously unselected package libcairo2:arm64. 218s Preparing to unpack .../014-libcairo2_1.18.0-1_arm64.deb ... 218s Unpacking libcairo2:arm64 (1.18.0-1) ... 218s Selecting previously unselected package libdatrie1:arm64. 218s Preparing to unpack .../015-libdatrie1_0.2.13-3_arm64.deb ... 218s Unpacking libdatrie1:arm64 (0.2.13-3) ... 218s Selecting previously unselected package libdeflate0:arm64. 218s Preparing to unpack .../016-libdeflate0_1.19-1_arm64.deb ... 218s Unpacking libdeflate0:arm64 (1.19-1) ... 218s Selecting previously unselected package libgfortran5:arm64. 218s Preparing to unpack .../017-libgfortran5_14-20240303-1ubuntu1_arm64.deb ... 218s Unpacking libgfortran5:arm64 (14-20240303-1ubuntu1) ... 218s Selecting previously unselected package libgomp1:arm64. 218s Preparing to unpack .../018-libgomp1_14-20240303-1ubuntu1_arm64.deb ... 218s Unpacking libgomp1:arm64 (14-20240303-1ubuntu1) ... 218s Selecting previously unselected package libgraphite2-3:arm64. 218s Preparing to unpack .../019-libgraphite2-3_1.3.14-2_arm64.deb ... 218s Unpacking libgraphite2-3:arm64 (1.3.14-2) ... 218s Selecting previously unselected package libharfbuzz0b:arm64. 218s Preparing to unpack .../020-libharfbuzz0b_8.3.0-2_arm64.deb ... 218s Unpacking libharfbuzz0b:arm64 (8.3.0-2) ... 218s Selecting previously unselected package x11-common. 218s Preparing to unpack .../021-x11-common_1%3a7.7+23ubuntu2_all.deb ... 218s Unpacking x11-common (1:7.7+23ubuntu2) ... 218s Selecting previously unselected package libice6:arm64. 218s Preparing to unpack .../022-libice6_2%3a1.0.10-1build2_arm64.deb ... 218s Unpacking libice6:arm64 (2:1.0.10-1build2) ... 218s Selecting previously unselected package libjpeg-turbo8:arm64. 218s Preparing to unpack .../023-libjpeg-turbo8_2.1.5-2ubuntu1_arm64.deb ... 218s Unpacking libjpeg-turbo8:arm64 (2.1.5-2ubuntu1) ... 218s Selecting previously unselected package libjpeg8:arm64. 218s Preparing to unpack .../024-libjpeg8_8c-2ubuntu11_arm64.deb ... 218s Unpacking libjpeg8:arm64 (8c-2ubuntu11) ... 218s Selecting previously unselected package libjs-bootstrap. 219s Preparing to unpack .../025-libjs-bootstrap_3.4.1+dfsg-3_all.deb ... 219s Unpacking libjs-bootstrap (3.4.1+dfsg-3) ... 219s Selecting previously unselected package libjs-popper.js. 219s Preparing to unpack .../026-libjs-popper.js_1.16.1+ds-6_all.deb ... 219s Unpacking libjs-popper.js (1.16.1+ds-6) ... 219s Selecting previously unselected package libjs-bootstrap4. 219s Preparing to unpack .../027-libjs-bootstrap4_4.6.1+dfsg1-4_all.deb ... 219s Unpacking libjs-bootstrap4 (4.6.1+dfsg1-4) ... 219s Selecting previously unselected package libjs-d3. 219s Preparing to unpack .../028-libjs-d3_3.5.17-4_all.deb ... 219s Unpacking libjs-d3 (3.5.17-4) ... 219s Selecting previously unselected package libjs-es5-shim. 219s Preparing to unpack .../029-libjs-es5-shim_4.6.7-2_all.deb ... 219s Unpacking libjs-es5-shim (4.6.7-2) ... 220s Selecting previously unselected package libjs-highlight.js. 220s Preparing to unpack .../030-libjs-highlight.js_9.18.5+dfsg1-2_all.deb ... 220s Unpacking libjs-highlight.js (9.18.5+dfsg1-2) ... 220s Selecting previously unselected package libjs-jquery. 220s Preparing to unpack .../031-libjs-jquery_3.6.1+dfsg+~3.5.14-1_all.deb ... 220s Unpacking libjs-jquery (3.6.1+dfsg+~3.5.14-1) ... 220s Selecting previously unselected package libjs-jquery-datatables. 220s Preparing to unpack .../032-libjs-jquery-datatables_1.11.5+dfsg-2_all.deb ... 220s Unpacking libjs-jquery-datatables (1.11.5+dfsg-2) ... 220s Selecting previously unselected package libjs-sifter.js. 220s Preparing to unpack .../033-libjs-sifter.js_0.6.0+dfsg-3_all.deb ... 220s Unpacking libjs-sifter.js (0.6.0+dfsg-3) ... 220s Selecting previously unselected package libjs-microplugin.js. 220s Preparing to unpack .../034-libjs-microplugin.js_0.0.3+dfsg-1.1_all.deb ... 220s Unpacking libjs-microplugin.js (0.0.3+dfsg-1.1) ... 220s Selecting previously unselected package libjs-jquery-selectize.js. 220s Preparing to unpack .../035-libjs-jquery-selectize.js_0.12.6+dfsg-1.1_all.deb ... 220s Unpacking libjs-jquery-selectize.js (0.12.6+dfsg-1.1) ... 220s Selecting previously unselected package libjs-jquery-ui. 220s Preparing to unpack .../036-libjs-jquery-ui_1.13.2+dfsg-1_all.deb ... 220s Unpacking libjs-jquery-ui (1.13.2+dfsg-1) ... 220s Selecting previously unselected package libjs-json. 220s Preparing to unpack .../037-libjs-json_0~20221030+~1.0.8-1_all.deb ... 220s Unpacking libjs-json (0~20221030+~1.0.8-1) ... 220s Selecting previously unselected package libjs-prettify. 220s Preparing to unpack .../038-libjs-prettify_2015.12.04+dfsg-1.1_all.deb ... 220s Unpacking libjs-prettify (2015.12.04+dfsg-1.1) ... 220s Selecting previously unselected package liblapack3:arm64. 220s Preparing to unpack .../039-liblapack3_3.12.0-3_arm64.deb ... 220s Unpacking liblapack3:arm64 (3.12.0-3) ... 220s Selecting previously unselected package liblerc4:arm64. 220s Preparing to unpack .../040-liblerc4_4.0.0+ds-4ubuntu1_arm64.deb ... 220s Unpacking liblerc4:arm64 (4.0.0+ds-4ubuntu1) ... 220s Selecting previously unselected package liblua5.4-0:arm64. 220s Preparing to unpack .../041-liblua5.4-0_5.4.6-3_arm64.deb ... 220s Unpacking liblua5.4-0:arm64 (5.4.6-3) ... 220s Selecting previously unselected package libthai-data. 220s Preparing to unpack .../042-libthai-data_0.1.29-2_all.deb ... 220s Unpacking libthai-data (0.1.29-2) ... 220s Selecting previously unselected package libthai0:arm64. 220s Preparing to unpack .../043-libthai0_0.1.29-2_arm64.deb ... 220s Unpacking libthai0:arm64 (0.1.29-2) ... 220s Selecting previously unselected package libpango-1.0-0:arm64. 220s Preparing to unpack .../044-libpango-1.0-0_1.51.0+ds-4_arm64.deb ... 220s Unpacking libpango-1.0-0:arm64 (1.51.0+ds-4) ... 220s Selecting previously unselected package libpangoft2-1.0-0:arm64. 220s Preparing to unpack .../045-libpangoft2-1.0-0_1.51.0+ds-4_arm64.deb ... 220s Unpacking libpangoft2-1.0-0:arm64 (1.51.0+ds-4) ... 220s Selecting previously unselected package libpangocairo-1.0-0:arm64. 220s Preparing to unpack .../046-libpangocairo-1.0-0_1.51.0+ds-4_arm64.deb ... 220s Unpacking libpangocairo-1.0-0:arm64 (1.51.0+ds-4) ... 220s Selecting previously unselected package libpaper1:arm64. 221s Preparing to unpack .../047-libpaper1_1.1.29_arm64.deb ... 221s Unpacking libpaper1:arm64 (1.1.29) ... 221s Selecting previously unselected package libpaper-utils. 221s Preparing to unpack .../048-libpaper-utils_1.1.29_arm64.deb ... 221s Unpacking libpaper-utils (1.1.29) ... 221s Selecting previously unselected package libsharpyuv0:arm64. 221s Preparing to unpack .../049-libsharpyuv0_1.3.2-0.4_arm64.deb ... 221s Unpacking libsharpyuv0:arm64 (1.3.2-0.4) ... 221s Selecting previously unselected package libsm6:arm64. 221s Preparing to unpack .../050-libsm6_2%3a1.2.3-1build2_arm64.deb ... 221s Unpacking libsm6:arm64 (2:1.2.3-1build2) ... 221s Selecting previously unselected package libtcl8.6:arm64. 221s Preparing to unpack .../051-libtcl8.6_8.6.13+dfsg-2_arm64.deb ... 221s Unpacking libtcl8.6:arm64 (8.6.13+dfsg-2) ... 221s Selecting previously unselected package libjbig0:arm64. 221s Preparing to unpack .../052-libjbig0_2.1-6.1ubuntu1_arm64.deb ... 221s Unpacking libjbig0:arm64 (2.1-6.1ubuntu1) ... 221s Selecting previously unselected package libwebp7:arm64. 221s Preparing to unpack .../053-libwebp7_1.3.2-0.4_arm64.deb ... 221s Unpacking libwebp7:arm64 (1.3.2-0.4) ... 221s Selecting previously unselected package libtiff6:arm64. 221s Preparing to unpack .../054-libtiff6_4.5.1+git230720-3ubuntu1_arm64.deb ... 221s Unpacking libtiff6:arm64 (4.5.1+git230720-3ubuntu1) ... 221s Selecting previously unselected package libxft2:arm64. 221s Preparing to unpack .../055-libxft2_2.3.6-1_arm64.deb ... 221s Unpacking libxft2:arm64 (2.3.6-1) ... 221s Selecting previously unselected package libxss1:arm64. 221s Preparing to unpack .../056-libxss1_1%3a1.2.3-1build2_arm64.deb ... 221s Unpacking libxss1:arm64 (1:1.2.3-1build2) ... 221s Selecting previously unselected package libtk8.6:arm64. 221s Preparing to unpack .../057-libtk8.6_8.6.13-2_arm64.deb ... 221s Unpacking libtk8.6:arm64 (8.6.13-2) ... 221s Selecting previously unselected package libxt6:arm64. 221s Preparing to unpack .../058-libxt6_1%3a1.2.1-1.1_arm64.deb ... 221s Unpacking libxt6:arm64 (1:1.2.1-1.1) ... 221s Selecting previously unselected package zip. 221s Preparing to unpack .../059-zip_3.0-13_arm64.deb ... 221s Unpacking zip (3.0-13) ... 221s Selecting previously unselected package unzip. 221s Preparing to unpack .../060-unzip_6.0-28ubuntu3_arm64.deb ... 221s Unpacking unzip (6.0-28ubuntu3) ... 221s Selecting previously unselected package xdg-utils. 221s Preparing to unpack .../061-xdg-utils_1.1.3-4.1ubuntu3_all.deb ... 221s Unpacking xdg-utils (1.1.3-4.1ubuntu3) ... 221s Selecting previously unselected package r-base-core. 221s Preparing to unpack .../062-r-base-core_4.3.2-1build1_arm64.deb ... 221s Unpacking r-base-core (4.3.2-1build1) ... 221s Selecting previously unselected package r-cran-littler. 221s Preparing to unpack .../063-r-cran-littler_0.3.19-1_arm64.deb ... 221s Unpacking r-cran-littler (0.3.19-1) ... 221s Selecting previously unselected package littler. 221s Preparing to unpack .../064-littler_0.3.19-1_all.deb ... 222s Unpacking littler (0.3.19-1) ... 222s Selecting previously unselected package node-bootstrap-sass. 222s Preparing to unpack .../065-node-bootstrap-sass_3.4.3-2_all.deb ... 222s Unpacking node-bootstrap-sass (3.4.3-2) ... 222s Selecting previously unselected package node-html5shiv. 222s Preparing to unpack .../066-node-html5shiv_3.7.3+dfsg-5_all.deb ... 222s Unpacking node-html5shiv (3.7.3+dfsg-5) ... 222s Selecting previously unselected package node-normalize.css. 222s Preparing to unpack .../067-node-normalize.css_8.0.1-5_all.deb ... 222s Unpacking node-normalize.css (8.0.1-5) ... 222s Selecting previously unselected package pandoc-data. 222s Preparing to unpack .../068-pandoc-data_3.1.3-1_all.deb ... 222s Unpacking pandoc-data (3.1.3-1) ... 222s Selecting previously unselected package pandoc. 222s Preparing to unpack .../069-pandoc_3.1.3+ds-2_arm64.deb ... 222s Unpacking pandoc (3.1.3+ds-2) ... 223s Selecting previously unselected package r-cran-base64enc. 223s Preparing to unpack .../070-r-cran-base64enc_0.1-3-3_arm64.deb ... 223s Unpacking r-cran-base64enc (0.1-3-3) ... 223s Selecting previously unselected package r-cran-rlang. 223s Preparing to unpack .../071-r-cran-rlang_1.1.3-1_arm64.deb ... 223s Unpacking r-cran-rlang (1.1.3-1) ... 223s Selecting previously unselected package r-cran-fastmap. 223s Preparing to unpack .../072-r-cran-fastmap_1.1.1-1_arm64.deb ... 223s Unpacking r-cran-fastmap (1.1.1-1) ... 223s Selecting previously unselected package r-cran-cachem. 223s Preparing to unpack .../073-r-cran-cachem_1.0.8-1_arm64.deb ... 223s Unpacking r-cran-cachem (1.0.8-1) ... 223s Selecting previously unselected package r-cran-digest. 223s Preparing to unpack .../074-r-cran-digest_0.6.34-1_arm64.deb ... 223s Unpacking r-cran-digest (0.6.34-1) ... 223s Selecting previously unselected package r-cran-ellipsis. 223s Preparing to unpack .../075-r-cran-ellipsis_0.3.2-2_arm64.deb ... 223s Unpacking r-cran-ellipsis (0.3.2-2) ... 223s Selecting previously unselected package r-cran-htmltools. 223s Preparing to unpack .../076-r-cran-htmltools_0.5.7-1_arm64.deb ... 223s Unpacking r-cran-htmltools (0.5.7-1) ... 223s Selecting previously unselected package r-cran-jquerylib. 223s Preparing to unpack .../077-r-cran-jquerylib_0.1.4+dfsg-4_all.deb ... 223s Unpacking r-cran-jquerylib (0.1.4+dfsg-4) ... 223s Selecting previously unselected package r-cran-jsonlite. 223s Preparing to unpack .../078-r-cran-jsonlite_1.8.8+dfsg-1_arm64.deb ... 223s Unpacking r-cran-jsonlite (1.8.8+dfsg-1) ... 223s Selecting previously unselected package r-cran-cli. 223s Preparing to unpack .../079-r-cran-cli_3.6.2-1_arm64.deb ... 223s Unpacking r-cran-cli (3.6.2-1) ... 223s Selecting previously unselected package r-cran-glue. 223s Preparing to unpack .../080-r-cran-glue_1.7.0-1_arm64.deb ... 223s Unpacking r-cran-glue (1.7.0-1) ... 223s Selecting previously unselected package r-cran-lifecycle. 223s Preparing to unpack .../081-r-cran-lifecycle_1.0.4+dfsg-1_all.deb ... 223s Unpacking r-cran-lifecycle (1.0.4+dfsg-1) ... 223s Selecting previously unselected package r-cran-memoise. 223s Preparing to unpack .../082-r-cran-memoise_2.0.1-1_all.deb ... 223s Unpacking r-cran-memoise (2.0.1-1) ... 223s Selecting previously unselected package r-cran-mime. 223s Preparing to unpack .../083-r-cran-mime_0.12-1_arm64.deb ... 223s Unpacking r-cran-mime (0.12-1) ... 223s Selecting previously unselected package r-cran-fs. 223s Preparing to unpack .../084-r-cran-fs_1.6.3+dfsg-1_arm64.deb ... 223s Unpacking r-cran-fs (1.6.3+dfsg-1) ... 223s Selecting previously unselected package r-cran-r6. 224s Preparing to unpack .../085-r-cran-r6_2.5.1-1_all.deb ... 224s Unpacking r-cran-r6 (2.5.1-1) ... 224s Selecting previously unselected package r-cran-rappdirs. 224s Preparing to unpack .../086-r-cran-rappdirs_0.3.3-1_arm64.deb ... 224s Unpacking r-cran-rappdirs (0.3.3-1) ... 224s Selecting previously unselected package r-cran-sass. 224s Preparing to unpack .../087-r-cran-sass_0.4.8+dfsg-1_arm64.deb ... 224s Unpacking r-cran-sass (0.4.8+dfsg-1) ... 224s Selecting previously unselected package r-cran-bslib. 224s Preparing to unpack .../088-r-cran-bslib_0.6.1+dfsg-1_all.deb ... 224s Unpacking r-cran-bslib (0.6.1+dfsg-1) ... 224s Selecting previously unselected package r-cran-commonmark. 224s Preparing to unpack .../089-r-cran-commonmark_1.9.1-1_arm64.deb ... 224s Unpacking r-cran-commonmark (1.9.1-1) ... 224s Selecting previously unselected package r-cran-crayon. 225s Preparing to unpack .../090-r-cran-crayon_1.5.2-1_all.deb ... 225s Unpacking r-cran-crayon (1.5.2-1) ... 225s Selecting previously unselected package r-cran-diffobj. 225s Preparing to unpack .../091-r-cran-diffobj_0.3.5-1_arm64.deb ... 225s Unpacking r-cran-diffobj (0.3.5-1) ... 225s Selecting previously unselected package r-cran-evaluate. 225s Preparing to unpack .../092-r-cran-evaluate_0.23-1_all.deb ... 225s Unpacking r-cran-evaluate (0.23-1) ... 225s Selecting previously unselected package r-cran-fontawesome. 225s Preparing to unpack .../093-r-cran-fontawesome_0.5.2-1_all.deb ... 225s Unpacking r-cran-fontawesome (0.5.2-1) ... 225s Selecting previously unselected package r-cran-xfun. 225s Preparing to unpack .../094-r-cran-xfun_0.41+dfsg-1_arm64.deb ... 225s Unpacking r-cran-xfun (0.41+dfsg-1) ... 225s Selecting previously unselected package r-cran-highr. 225s Preparing to unpack .../095-r-cran-highr_0.10+dfsg-1_all.deb ... 225s Unpacking r-cran-highr (0.10+dfsg-1) ... 225s Selecting previously unselected package r-cran-pkgkitten. 225s Preparing to unpack .../096-r-cran-pkgkitten_0.2.3-1_all.deb ... 225s Unpacking r-cran-pkgkitten (0.2.3-1) ... 225s Selecting previously unselected package r-cran-rcpp. 225s Preparing to unpack .../097-r-cran-rcpp_1.0.12-1_arm64.deb ... 225s Unpacking r-cran-rcpp (1.0.12-1) ... 225s Selecting previously unselected package r-cran-later. 225s Preparing to unpack .../098-r-cran-later_1.3.2+dfsg-1_arm64.deb ... 225s Unpacking r-cran-later (1.3.2+dfsg-1) ... 225s Selecting previously unselected package r-cran-magrittr. 226s Preparing to unpack .../099-r-cran-magrittr_2.0.3-1_arm64.deb ... 226s Unpacking r-cran-magrittr (2.0.3-1) ... 226s Selecting previously unselected package r-cran-promises. 226s Preparing to unpack .../100-r-cran-promises_1.2.1+dfsg-1_arm64.deb ... 226s Unpacking r-cran-promises (1.2.1+dfsg-1) ... 226s Selecting previously unselected package r-cran-httpuv. 226s Preparing to unpack .../101-r-cran-httpuv_1.6.14+dfsg-1_arm64.deb ... 226s Unpacking r-cran-httpuv (1.6.14+dfsg-1) ... 226s Selecting previously unselected package r-cran-yaml. 226s Preparing to unpack .../102-r-cran-yaml_2.3.8-1_arm64.deb ... 226s Unpacking r-cran-yaml (2.3.8-1) ... 226s Selecting previously unselected package libjs-mathjax. 226s Preparing to unpack .../103-libjs-mathjax_2.7.9+dfsg-1_all.deb ... 226s Unpacking libjs-mathjax (2.7.9+dfsg-1) ... 227s Selecting previously unselected package r-cran-knitr. 227s Preparing to unpack .../104-r-cran-knitr_1.45+dfsg-1_all.deb ... 227s Unpacking r-cran-knitr (1.45+dfsg-1) ... 227s Selecting previously unselected package r-cran-stringi. 227s Preparing to unpack .../105-r-cran-stringi_1.8.3-1_arm64.deb ... 227s Unpacking r-cran-stringi (1.8.3-1) ... 227s Selecting previously unselected package r-cran-vctrs. 227s Preparing to unpack .../106-r-cran-vctrs_0.6.5-1_arm64.deb ... 227s Unpacking r-cran-vctrs (0.6.5-1) ... 227s Selecting previously unselected package r-cran-stringr. 227s Preparing to unpack .../107-r-cran-stringr_1.5.1-1_all.deb ... 227s Unpacking r-cran-stringr (1.5.1-1) ... 227s Selecting previously unselected package r-cran-tinytex. 227s Preparing to unpack .../108-r-cran-tinytex_0.49-1_all.deb ... 227s Unpacking r-cran-tinytex (0.49-1) ... 227s Selecting previously unselected package libjs-modernizr. 227s Preparing to unpack .../109-libjs-modernizr_2.6.2+ds1-5_all.deb ... 227s Unpacking libjs-modernizr (2.6.2+ds1-5) ... 227s Selecting previously unselected package r-cran-xtable. 227s Preparing to unpack .../110-r-cran-xtable_1%3a1.8-4-2_all.deb ... 227s Unpacking r-cran-xtable (1:1.8-4-2) ... 227s Selecting previously unselected package r-cran-sourcetools. 228s Preparing to unpack .../111-r-cran-sourcetools_0.1.7-1-1_arm64.deb ... 228s Unpacking r-cran-sourcetools (0.1.7-1-1) ... 228s Selecting previously unselected package r-cran-withr. 228s Preparing to unpack .../112-r-cran-withr_2.5.0-1_all.deb ... 228s Unpacking r-cran-withr (2.5.0-1) ... 228s Selecting previously unselected package libjs-twitter-bootstrap-datepicker. 228s Preparing to unpack .../113-libjs-twitter-bootstrap-datepicker_1.3.1+dfsg1-4.1_all.deb ... 228s Unpacking libjs-twitter-bootstrap-datepicker (1.3.1+dfsg1-4.1) ... 228s Selecting previously unselected package r-cran-shiny. 228s Preparing to unpack .../114-r-cran-shiny_1.8.0+dfsg-1_all.deb ... 228s Unpacking r-cran-shiny (1.8.0+dfsg-1) ... 228s Selecting previously unselected package r-cran-rmarkdown. 228s Preparing to unpack .../115-r-cran-rmarkdown_2.25+dfsg-3_all.deb ... 228s Unpacking r-cran-rmarkdown (2.25+dfsg-3) ... 228s Selecting previously unselected package r-cran-unitizer. 228s Preparing to unpack .../116-r-cran-unitizer_1.4.20-1_all.deb ... 228s Unpacking r-cran-unitizer (1.4.20-1) ... 228s Selecting previously unselected package autopkgtest-satdep. 228s Preparing to unpack .../117-1-autopkgtest-satdep.deb ... 228s Unpacking autopkgtest-satdep (0) ... 228s Setting up libjs-json (0~20221030+~1.0.8-1) ... 228s Setting up javascript-common (11+nmu1) ... 228s Setting up libgraphite2-3:arm64 (1.3.14-2) ... 228s Setting up libpixman-1-0:arm64 (0.42.2-1) ... 228s Setting up libsharpyuv0:arm64 (1.3.2-0.4) ... 228s Setting up libpaper1:arm64 (1.1.29) ... 229s 229s Creating config file /etc/papersize with new version 229s Setting up fonts-mathjax (2.7.9+dfsg-1) ... 229s Setting up liblerc4:arm64 (4.0.0+ds-4ubuntu1) ... 229s Setting up libjs-mathjax (2.7.9+dfsg-1) ... 229s Setting up libxrender1:arm64 (1:0.9.10-1.1) ... 229s Setting up libdatrie1:arm64 (0.2.13-3) ... 229s Setting up libjs-popper.js (1.16.1+ds-6) ... 229s Setting up libxcb-render0:arm64 (1.15-1) ... 229s Setting up libjs-sifter.js (0.6.0+dfsg-3) ... 229s Setting up fonts-glyphicons-halflings (1.009~3.4.1+dfsg-3) ... 229s Setting up unzip (6.0-28ubuntu3) ... 229s Setting up x11-common (1:7.7+23ubuntu2) ... 230s Setting up node-html5shiv (3.7.3+dfsg-5) ... 230s Setting up libdeflate0:arm64 (1.19-1) ... 230s Setting up libjs-microplugin.js (0.0.3+dfsg-1.1) ... 230s Setting up libxcb-shm0:arm64 (1.15-1) ... 230s Setting up libpaper-utils (1.1.29) ... 230s Setting up libgomp1:arm64 (14-20240303-1ubuntu1) ... 230s Setting up libjs-modernizr (2.6.2+ds1-5) ... 230s Setting up libjbig0:arm64 (2.1-6.1ubuntu1) ... 230s Setting up libjs-es5-shim (4.6.7-2) ... 230s Setting up zip (3.0-13) ... 230s Setting up libblas3:arm64 (3.12.0-3) ... 230s update-alternatives: using /usr/lib/aarch64-linux-gnu/blas/libblas.so.3 to provide /usr/lib/aarch64-linux-gnu/libblas.so.3 (libblas.so.3-aarch64-linux-gnu) in auto mode 230s Setting up libjs-d3 (3.5.17-4) ... 230s Setting up fonts-dejavu-mono (2.37-8) ... 230s Setting up libtcl8.6:arm64 (8.6.13+dfsg-2) ... 230s Setting up fonts-dejavu-core (2.37-8) ... 230s Setting up libjpeg-turbo8:arm64 (2.1.5-2ubuntu1) ... 230s Setting up libgfortran5:arm64 (14-20240303-1ubuntu1) ... 230s Setting up libwebp7:arm64 (1.3.2-0.4) ... 230s Setting up libjs-highlight.js (9.18.5+dfsg1-2) ... 230s Setting up liblua5.4-0:arm64 (5.4.6-3) ... 230s Setting up libharfbuzz0b:arm64 (8.3.0-2) ... 230s Setting up libthai-data (0.1.29-2) ... 230s Setting up node-bootstrap-sass (3.4.3-2) ... 230s Setting up libjs-prettify (2015.12.04+dfsg-1.1) ... 230s Setting up libxss1:arm64 (1:1.2.3-1build2) ... 230s Setting up libjs-bootstrap4 (4.6.1+dfsg1-4) ... 230s Setting up pandoc-data (3.1.3-1) ... 230s Setting up libjs-jquery (3.6.1+dfsg+~3.5.14-1) ... 230s Setting up node-normalize.css (8.0.1-5) ... 230s Setting up fonts-font-awesome (5.0.10+really4.7.0~dfsg-4.1) ... 230s Setting up xdg-utils (1.1.3-4.1ubuntu3) ... 230s update-alternatives: using /usr/bin/xdg-open to provide /usr/bin/open (open) in auto mode 230s Setting up libjs-bootstrap (3.4.1+dfsg-3) ... 230s Setting up libjs-jquery-selectize.js (0.12.6+dfsg-1.1) ... 230s Setting up libjpeg8:arm64 (8c-2ubuntu11) ... 230s Setting up libice6:arm64 (2:1.0.10-1build2) ... 230s Setting up liblapack3:arm64 (3.12.0-3) ... 230s update-alternatives: using /usr/lib/aarch64-linux-gnu/lapack/liblapack.so.3 to provide /usr/lib/aarch64-linux-gnu/liblapack.so.3 (liblapack.so.3-aarch64-linux-gnu) in auto mode 230s Setting up fontconfig-config (2.15.0-1ubuntu1) ... 230s Setting up libjs-twitter-bootstrap-datepicker (1.3.1+dfsg1-4.1) ... 230s Setting up libjs-jquery-datatables (1.11.5+dfsg-2) ... 230s Setting up libthai0:arm64 (0.1.29-2) ... 230s Setting up libjs-jquery-ui (1.13.2+dfsg-1) ... 230s Setting up pandoc (3.1.3+ds-2) ... 230s Setting up libtiff6:arm64 (4.5.1+git230720-3ubuntu1) ... 230s Setting up libfontconfig1:arm64 (2.15.0-1ubuntu1) ... 230s Setting up libsm6:arm64 (2:1.2.3-1build2) ... 230s Setting up fontconfig (2.15.0-1ubuntu1) ... 232s Regenerating fonts cache... done. 232s Setting up libxft2:arm64 (2.3.6-1) ... 232s Setting up libtk8.6:arm64 (8.6.13-2) ... 232s Setting up libpango-1.0-0:arm64 (1.51.0+ds-4) ... 232s Setting up libcairo2:arm64 (1.18.0-1) ... 232s Setting up libxt6:arm64 (1:1.2.1-1.1) ... 232s Setting up libpangoft2-1.0-0:arm64 (1.51.0+ds-4) ... 232s Setting up libpangocairo-1.0-0:arm64 (1.51.0+ds-4) ... 232s Setting up r-base-core (4.3.2-1build1) ... 232s 232s Creating config file /etc/R/Renviron with new version 233s Setting up r-cran-crayon (1.5.2-1) ... 233s Setting up r-cran-sourcetools (0.1.7-1-1) ... 233s Setting up r-cran-commonmark (1.9.1-1) ... 233s Setting up r-cran-r6 (2.5.1-1) ... 233s Setting up r-cran-pkgkitten (0.2.3-1) ... 233s Setting up r-cran-magrittr (2.0.3-1) ... 233s Setting up r-cran-rappdirs (0.3.3-1) ... 233s Setting up r-cran-littler (0.3.19-1) ... 233s Setting up r-cran-fs (1.6.3+dfsg-1) ... 233s Setting up r-cran-rcpp (1.0.12-1) ... 233s Setting up r-cran-diffobj (0.3.5-1) ... 233s Setting up r-cran-rlang (1.1.3-1) ... 233s Setting up littler (0.3.19-1) ... 233s Setting up r-cran-xfun (0.41+dfsg-1) ... 233s Setting up r-cran-withr (2.5.0-1) ... 233s Setting up r-cran-mime (0.12-1) ... 233s Setting up r-cran-base64enc (0.1-3-3) ... 233s Setting up r-cran-digest (0.6.34-1) ... 233s Setting up r-cran-yaml (2.3.8-1) ... 233s Setting up r-cran-evaluate (0.23-1) ... 233s Setting up r-cran-highr (0.10+dfsg-1) ... 233s Setting up r-cran-glue (1.7.0-1) ... 233s Setting up r-cran-xtable (1:1.8-4-2) ... 233s Setting up r-cran-cli (3.6.2-1) ... 233s Setting up r-cran-lifecycle (1.0.4+dfsg-1) ... 233s Setting up r-cran-fastmap (1.1.1-1) ... 233s Setting up r-cran-jsonlite (1.8.8+dfsg-1) ... 233s Setting up r-cran-stringi (1.8.3-1) ... 233s Setting up r-cran-later (1.3.2+dfsg-1) ... 233s Setting up r-cran-tinytex (0.49-1) ... 233s Setting up r-cran-knitr (1.45+dfsg-1) ... 233s Setting up r-cran-cachem (1.0.8-1) ... 233s Setting up r-cran-unitizer (1.4.20-1) ... 233s Setting up r-cran-vctrs (0.6.5-1) ... 233s Setting up r-cran-ellipsis (0.3.2-2) ... 233s Setting up r-cran-stringr (1.5.1-1) ... 233s Setting up r-cran-memoise (2.0.1-1) ... 233s Setting up r-cran-promises (1.2.1+dfsg-1) ... 233s Setting up r-cran-htmltools (0.5.7-1) ... 233s Setting up r-cran-sass (0.4.8+dfsg-1) ... 233s Setting up r-cran-httpuv (1.6.14+dfsg-1) ... 233s Setting up r-cran-fontawesome (0.5.2-1) ... 233s Setting up r-cran-jquerylib (0.1.4+dfsg-4) ... 233s Setting up r-cran-bslib (0.6.1+dfsg-1) ... 233s Setting up r-cran-shiny (1.8.0+dfsg-1) ... 233s Setting up r-cran-rmarkdown (2.25+dfsg-3) ... 233s Setting up autopkgtest-satdep (0) ... 233s Processing triggers for man-db (2.12.0-3) ... 234s Processing triggers for install-info (7.1-3) ... 234s Processing triggers for libc-bin (2.39-0ubuntu2) ... 241s (Reading database ... 88173 files and directories currently installed.) 241s Removing autopkgtest-satdep (0) ... 242s autopkgtest [20:35:16]: test run-unit-test: [----------------------- 242s Begin testing t-browser.R 242s 242s R version 4.3.2 (2023-10-31) -- "Eye Holes" 242s Copyright (C) 2023 The R Foundation for Statistical Computing 242s Platform: aarch64-unknown-linux-gnu (64-bit) 242s 242s R is free software and comes with ABSOLUTELY NO WARRANTY. 242s You are welcome to redistribute it under certain conditions. 242s Type 'license()' or 'licence()' for distribution details. 242s 242s R is a collaborative project with many contributors. 242s Type 'contributors()' for more information and 242s 'citation()' on how to cite R or R packages in publications. 242s 242s Type 'demo()' for some demos, 'help()' for on-line help, or 242s 'help.start()' for an HTML browser interface to help. 242s Type 'q()' to quit R. 242s 243s > source(file.path("_helper", "init.R")) 243s > source(file.path("aammrtf", "ref.R")); make_ref_obj_funs("refobjs") 243s > 243s > options(unitizer.color = FALSE) 243s > zero.env <- parent.env(.GlobalEnv) 243s > obj.item <- new("unitizerItem", call = quote(1 + 1), env = new.env()) 243s > obj.item@data@value <- list(2) 243s > obj.item@data@output <- c("two", "dos", "due") 243s > obj.item@data@conditions <- new("conditionList", .items = list(simpleError("hello"), 243s + simpleWarning("What a warning"))) 243s > obj.item@data@message <- vapply(unitizer:::as.list(obj.item@data@conditions), 243s + conditionMessage, character(1L)) 243s > obj.item@data@aborted <- TRUE 243s > 243s > # - "unitizerItem accessor functions work" ------------------------------------- 243s > 243s > obj.item$value 243s [1] 2 243s > obj.item$output 243s [1] "two" "dos" "due" 243s > obj.item$conditions 243s Condition list with 2 conditions: 243s 1. Error: hello 243s 2. Warning: What a warning 243s > 243s > # Create a bunch of expressions for testing 243s > 243s > exps1 <- expression( 243s + library(stats), 243s + unitizer_sect("Section 1", { 243s + 1 + 1 243s + runif(20) 243s + stop("woohoo") 243s + "I'll be removed" 243s + "I too will be removed" 243s + }), 243s + unitizer_sect("Section 2", { 243s + "I three will be removed" 243s + sample(20) 243s + })) 243s > exps2 <- expression( 243s + library(stats), 243s + unitizer_sect("Section 1", { 243s + 1 + 1 243s + runif(20) 243s + stop("woohoo") 243s + var <- 200 243s + matrix(1:9, 3) 243s + }), 243s + unitizer_sect("Section 2", { 243s + 1 + 20 243s + var1 <- list(1, 2, 3) 243s + sample(20) 243s + matrix(1:9, ncol = 3) 243s + lm(x ~ y, data.frame(x = 1:10, y = c(5, 3, 3, 2, 1, 8, 2, 243s + 1, 4, 1.5))) 243s + })) 243s > my.unitizer <- new("unitizer", id = 1, zero.env = zero.env) 243s > coi(my.unitizer <- my.unitizer + exps1) 243s > my.unitizer2 <- new("unitizer", id = 2, zero.env = zero.env) 243s > # make previous items into reference items 243s > my.unitizer2 <- my.unitizer2 + my.unitizer@items.new 243s > # now add back items to compare 243s > coi(my.unitizer2 <- my.unitizer2 + exps2) 243s > unitizer.prepped <- unitizer:::browsePrep(my.unitizer2, mode = "unitize") 243s > 243s > # NOTE: for some reason, changes in between revisions d9619db and a46e941 243s > # should have caused the tests to fail, but didn't. We did not notice 243s > # failures until we ran tests quite a bit later at ca9f540364. Not sure why 243s > # this happened. The failures were due to the order of tests changing because 243s > # we moved ignored tests to be in the same sub-section as the subsequent non- 243s > # ignored tests 243s > 243s > # - "Can convert to data.frame" ------------------------------------------------ 243s > 243s > all.equal(unitizer:::as.data.frame(unitizer.prepped), rds("browse_df1")) 243s [1] TRUE 243s > 243s > # - "unitizerBrowse correctly processes unitizer for display" ------------------ 243s > 243s > # force all tests to be reviewed so they will be shown 243s > unitizer.prepped@mapping@reviewed <- 243s + rep(TRUE, length(unitizer.prepped@mapping@reviewed)) 243s > unitizer.prepped@mapping@review.val <- 243s + rep("Y", length(unitizer.prepped@mapping@reviewed)) 243s > all.equal(as.character(unitizer.prepped, 60), rds("browse_aschar1")) 243s [1] TRUE 243s > 243s > # Alternating tests 243s > unitizer.prepped@mapping@reviewed <- 243s + as.logical(seq(length(unitizer.prepped@mapping@reviewed))%%2) 243s > all.equal(as.character(unitizer.prepped, 60), rds("browse_aschar2")) 243s [1] TRUE 243s > 243s > # Errors / warnings 243s > try(as.character(unitizer.prepped, -1)) # positive 243s Error in .local(x, ...) : 243s Argument `width` must be a positive scalar numeric. 243s > prep.narrow <- as.character(unitizer.prepped, 5) # too small 243s Warning in .local(x, ...) : 243s Selected display width too small, will be ignored 243s > 243s > all.equal(prep.narrow, rds("browse_ascharnarrow")) 243s [1] TRUE 243s > 243s > # Colors work (should be last in this section) since the reference @global 243s > 243s > unitizer.prepped@global$unitizer.opts[["unitizer.color"]] <- TRUE 243s > old.opt <- options(crayon.enabled = TRUE) 243s > prep.color <- as.character(unitizer.prepped, 60) 243s > all.equal(prep.color, rds("browse_aschar3")) 243s [1] TRUE 243s > unitizer.prepped@global$unitizer.opts[["unitizer.color"]] <- FALSE 243s > options(old.opt) 243s > 243s > # - "processInput generates Correct Item Structure" ---------------------------- 243s > 243s > # Here we just test that the calls of each item are what we expect, making 243s > # sure that different behavior for Y or N depending on sub-section type is 243s > # observed correctly (e.g. a Y for new test means keep it, where as for 243s > # removed test means don't keep it) 243s > # For debugging: 243s > # cbind(substr(unitizer:::deparseCalls(unitizer.prepped), 1, 15), as.character(unitizer.prepped@mapping@review.type), unitizer.prepped@mapping@review.val, unitizer.prepped@mapping@reviewed) 243s > # cat(deparse(width=500, 243s > # lapply( 243s > # unitizer:::as.list(unitizer:::processInput(unitizer.prepped)), 243s > # function(x) call("quote", slot(x, "call"))) 243s > # ) ) 243s > unitizer.prepped@mapping@reviewed <- 243s + rep(TRUE, length(unitizer.prepped@mapping@reviewed)) 243s > unitizer.prepped@mapping@review.val <- 243s + rep("Y", length(unitizer.prepped@mapping@reviewed)) 243s > 243s > # Assume user accepted all tests 243s > 243s > lapply( 243s + unitizer:::as.list(unitizer:::processInput(unitizer.prepped)), slot, "call" 243s + ) 243s [[1]] 243s library(stats) 243s 243s [[2]] 243s runif(20) 243s 243s [[3]] 243s var <- 200 243s 243s [[4]] 243s matrix(1:9, 3) 243s 243s [[5]] 243s 1 + 1 243s 243s [[6]] 243s stop("woohoo") 243s 243s [[7]] 243s var1 <- list(1, 2, 3) 243s 243s [[8]] 243s sample(20) 243s 243s [[9]] 243s 1 + 20 243s 243s [[10]] 243s matrix(1:9, ncol = 3) 243s 243s [[11]] 243s lm(x ~ y, data.frame(x = 1:10, y = c(5, 3, 3, 2, 1, 8, 2, 1, 243s 4, 1.5))) 243s 243s > # Assume user accepted all but 1, 4, 6 and 11, note it isn't completely 243s > # obvious what should be kept since an N for anything but a new and passed 243s > # test will result in some object remaining in the list (typically the 243s > # reference copy thereof) 243s > unitizer.prepped@mapping@review.val[] <- "N" 243s > unitizer.prepped@mapping@review.val[c(2, 6, 8, 12)] <- "Y" 243s > lapply( 243s + unitizer:::as.list(unitizer:::processInput(unitizer.prepped)), slot, "call" 243s + ) 243s [[1]] 243s runif(20) 243s 243s [[2]] 243s stop("woohoo") 243s 243s [[3]] 243s [1] "I'll be removed" 243s 243s [[4]] 243s sample(20) 243s 243s [[5]] 243s matrix(1:9, ncol = 3) 243s 243s [[6]] 243s [1] "I three will be removed" 243s 243s > # - "unitizerBrowse subsetting works" ------------------------------------------ 243s > 243s > # note single bracket subsetting for `unitizerBrowse` overrides the `unitizerList` 243s > # subsetting 243s > unitizer:::deparseCalls(unitizer:::extractItems(unitizer.prepped[c(4, 8, 10)])) 243s [1] "matrix(1:9, 3)" "\"I too will be removed\"" 243s [3] "sample(20)" 243s > unitizer:::deparseCalls(unitizer:::extractItems(unitizer.prepped[c(2, 3, 11)])) 243s [1] "runif(20)" "var <- 200" "1 + 20" 243s > 243s > # - "Reference section mapping works" ------------------------------------------ 243s > 243s > # Copy over just two sections 243s > my.unitizer3 <- new("unitizer", id = 3, zero.env = zero.env) + 243s + my.unitizer2@items.new[-(2:6)] 243s > # Exclude section two tests 243s > # sections should copy over 243s > my.unitizer3 <- unitizer:::refSections(my.unitizer3, my.unitizer2) 243s > # just copy over 1st and 3rd sections 243s > identical(my.unitizer3@sections.ref, my.unitizer2@sections[-2]) 243s [1] TRUE 243s > my.unitizer3@section.ref.map 243s [1] 1 2 2 2 2 2 243s > 243s > # Make sure "removed" sections are NA when kept 243s > unitizer.prepped@mapping@reviewed <- 243s + rep(TRUE, length(unitizer.prepped@mapping@reviewed)) 243s > # don't delete removed 243s > unitizer.prepped@mapping@review.val <- 243s + ifelse(unitizer.prepped@mapping@review.type %in% c("Removed"), "N", "Y") 243s > items.processed <- unitizer:::processInput(unitizer.prepped) 243s > vapply(unitizer:::as.list(items.processed), slot, 1L, "section.id") 243s [1] 1 2 2 2 2 2 NA NA 3 3 3 3 3 NA 243s > 243s > # Now try to re-establish sections with removed tests 243s > my.unitizer4 <- 243s + new("unitizer", id = 4, zero.env = zero.env) + items.processed 243s > # sections should copy over 243s > my.unitizer4 <- unitizer:::refSections(my.unitizer4, my.unitizer2) 243s > is(my.unitizer4@sections.ref[[4L]], "unitizerSectionNA") 243s [1] TRUE 243s > my.unitizer4@section.ref.map 243s [1] 1 2 2 2 2 2 4 4 3 3 3 3 3 4 243s > 243s > # - "Item Extraction" ---------------------------------------------------------- 243s > 243s > items <- unitizer:::extractItems(unitizer.prepped) 243s > item.calls <- vapply( 243s + unitizer:::as.list(items), 243s + function(x) 243s + paste0(deparse(x@call, width.cutoff = 500), collapse = ""), character(1L) 243s + ) 243s > item.types <- vapply(unitizer:::as.list(items), slot, FALSE, "reference") 243s > item.ids <- vapply(unitizer:::as.list(items), slot, 1L, "id") 243s > item.df <- data.frame(item.calls, item.types, item.ids, stringsAsFactors = FALSE) 243s > 243s > all.equal(item.df[order(item.types, item.ids),], rds("browse_itemord")) 243s [1] TRUE 243s > 244s PASS 244s Begin testing t-capture.R 244s 244s R version 4.3.2 (2023-10-31) -- "Eye Holes" 244s Copyright (C) 2023 The R Foundation for Statistical Computing 244s Platform: aarch64-unknown-linux-gnu (64-bit) 244s 244s R is free software and comes with ABSOLUTELY NO WARRANTY. 244s You are welcome to redistribute it under certain conditions. 244s Type 'license()' or 'licence()' for distribution details. 244s 244s R is a collaborative project with many contributors. 244s Type 'contributors()' for more information and 244s 'citation()' on how to cite R or R packages in publications. 244s 244s Type 'demo()' for some demos, 'help()' for on-line help, or 244s 'help.start()' for an HTML browser interface to help. 244s Type 'q()' to quit R. 244s 244s > source(file.path("_helper", "init.R")) 244s > source(file.path("aammrtf", "ref.R")); make_ref_obj_funs("capture") 244s > 244s > # # Messing around trying to understand seek... 244s > # f <- tempfile() 244s > # con <- file(f, "w+b") 244s > # writeChar(paste(letters, LETTERS, collapse=" "), con) 244s > # readChar(con, 20) 244s > # pos <- seek(con, origin="current") 244s > # seek(con, pos, rw="write") 244s > # writeChar("xxxxxxxxx", con) 244s > # readChar(con, 3) 244s > # pos <- seek(con, origin="current") 244s > # seek(con, pos, rw="write") 244s > # writeChar("yyyyy", con) 244s > # close(con) 244s > # readLines(f) 244s > # unlink(f) 244s > 244s > # - "get_capture" -------------------------------------------------------------- 244s > 244s > old.max <- options(unitizer.max.capture.chars = 100L) 244s > cons <- new("unitizerCaptCons") 244s > base.char <- paste(rep(letters, 10), collapse = " ") 244s > writeChar(base.char, cons@out.c) 244s > 244s > # Error "Argument `chrs.max`" 244s > try(unitizer:::get_text_capture(cons, "output", TRUE, chrs.max = "howdy")) 244s Error in unitizer:::get_text_capture(cons, "output", TRUE, chrs.max = "howdy") : 244s Argument `chrs.max` must be integer(1L) and greater than 100L; using 200000L for nowTRUE 244s > # Warn max capt 244s > cpt0 <- unitizer:::get_text_capture(cons, "output", TRUE) 244s Warning in get_text(slot(cons, if (type == "message") "err.c" else "out.c")) : 244s Reached maximum text capture characters 100; see `getOption("unitizer.max.capture.chars")` 244s > nchar(cpt0) 244s [1] 100 244s > base.char.2 <- paste(rev(rep(letters, 10)), collapse = " ") 244s > writeChar(base.char.2, cons@err.c) 244s > sink(cons@err.c, type = "message") 244s > 244s > cpt0.err <- unitizer:::get_text_capture(cons, "message", FALSE) 244s Warning in get_text(slot(cons, if (type == "message") "err.c" else "out.c")) : 244s Reached maximum text capture characters 100; see `getOption("unitizer.max.capture.chars")` 244s > sink(type = "message") 244s > all.equal(cpt0.err, substr(base.char.2, 1, 100)) 244s [1] TRUE 244s > 244s > ## for some reason this test stopped working; not sure why, need to look into 244s > ## it; seemingly it messes up the pointer for the next read 244s > # writeChar("xxxxxx", cons@out.c) 244s > # cpt2 <- unitizer:::get_text_capture(cons, "output", TRUE) 244s > # expect_equal("xxxxxx", cpt2) 244s > writeChar(paste0(rep("yyyyyyy", 20L), collapse = ""), cons@out.c) 244s > # warn max capt 244s > cpt1 <- unitizer:::get_text_capture(cons, "output", TRUE) 244s Warning in get_text(slot(cons, if (type == "message") "err.c" else "out.c")) : 244s Reached maximum text capture characters 100; see `getOption("unitizer.max.capture.chars")` 244s > all.equal(cpt1, paste0(rep("y", 100), collapse = "")) 244s [1] TRUE 244s > unitizer:::close_and_clear(cons) 244s > options(old.max) 244s > 244s > # - "get_text" ----------------------------------------------------------------- 244s > 244s > old.max <- options(unitizer.max.capture.chars = 100L) 244s > f <- tempfile() 244s > con <- file(f, "w+b") 244s > base.char <- paste(letters, collapse = " ") 244s > sink(con, type = "message") 244s > cat(base.char, file = stderr()) 244s > # this needs to temporarily switch the sink to be able to issue the warning 244s > # Warn: "Reached maximum" 244s > unitizer:::get_text(con, 10) 244s Warning in unitizer:::get_text(con, 10) : 244s Reached maximum text capture characters 10; see `getOption("unitizer.max.capture.chars")` 244s [1] "a b c d e " 244s > # should still be to writing to our file, 10 chars in 244s > cat("boogiewoogy", file = stderr()) 244s > sink(type = "message") 244s > suppressWarnings(readLines(f)) # incomplete final line... 244s [1] "a b c d e boogiewoogy l m n o p q r s t u v w x y z" 244s > 244s > options(old.max) 244s > unlink(f) 244s > 244s > # - "connection capture works" ------------------------------------------------- 244s > 244s > out.num <- as.integer(stdout()) 244s > err.num <- as.integer(stderr()) 244s > err.con <- getConnection(sink.number(type = "message")) 244s > cons <- new("unitizerCaptCons") 244s > cons <- unitizer:::set_capture(cons) 244s > cat("hello there\n") 244s > cat("goodbye there\n", file = stderr()) 244s > capt <- unitizer:::get_capture(cons) 244s > cons <- unitizer:::unsink_cons(cons) 244s > capt 244s $output 244s [1] "hello there\n" 244s 244s $message 244s [1] "goodbye there\n" 244s 244s > # expect_identical(as.integer(stdout()), out.num) 244s > identical(as.integer(stdout()), out.num) 244s [1] TRUE 244s > identical(as.integer(stderr()), err.num) 244s [1] TRUE 244s > unitizer:::close_and_clear(cons) 244s > 244s > # Now, here we add an extra stdout sink. In both cases unsink_cons will not 244s > # touch the sinks since we're not in an expected state, leaving 244s > # close_and_clear to cleanup 244s > err.con <- getConnection(sink.number(type = "message")) 244s > cons <- new("unitizerCaptCons") 244s > cons <- unitizer:::set_capture(cons) 244s > cat("there hello\n") 244s > # message does not work with testthat 244s > cat("there goodbye\n", file = stderr()) 244s > f1 <- tempfile() 244s > f2 <- tempfile() 244s > c2 <- file(f2, "w") 244s > sink(f1) 244s > sink(c2, type = "message") 244s > cat("12 there hello\n") 244s > # message does not work with testthat 244s > cat("12 there goodbye\n", file = stderr()) 244s > capt <- unitizer:::get_capture(cons) 244s > cons <- unitizer:::unsink_cons(cons) 244s > unitizer:::close_and_clear(cons) 244s > attr(cons@out.c, "waive") 244s [1] TRUE 244s > attr(cons@err.c, "waive") 244s [1] TRUE 244s > capt 244s $output 244s [1] "there hello\n" 244s 244s $message 244s [1] "there goodbye\n" 244s 244s > readLines(f1) 244s [1] "12 there hello" 244s > readLines(f2) 244s [1] "12 there goodbye" 244s > close(c2) 244s > unlink(c(f1, f2)) 244s > 244s > # Same, but this time close the sinks properly, so the connections should not 244s > # be waived 244s > err.con <- getConnection(sink.number(type = "message")) 244s > cons <- new("unitizerCaptCons") 244s > cons <- unitizer:::set_capture(cons) 244s > cat("there hello\n") 244s > # message does not work with testthat 244s > cat("there goodbye\n", file = stderr()) 244s > f1 <- tempfile() 244s > f2 <- tempfile() 244s > c2 <- file(f2, "w") 244s > sink(f1) 244s > sink(c2, type = "message") 244s > cat("12 there hello\n") 244s > # message does not work with testthat 244s > cat("12 there goodbye\n", file = stderr()) 244s > sink() 244s > sink(cons@err.c, type = "message") 244s > capt <- unitizer:::get_capture(cons) 244s > cons <- unitizer:::unsink_cons(cons) 244s > attr(cons@out.c, "waive") # NULL 244s NULL 244s > attr(cons@err.c, "waive") # NULL 244s NULL 244s > capt 244s $output 244s [1] "there hello\n" 244s 244s $message 244s [1] "there goodbye\n" 244s 244s > unitizer:::close_and_clear(cons) 244s > readLines(f1) 244s [1] "12 there hello" 244s > readLines(f2) 244s [1] "12 there goodbye" 244s > close(c2) 244s > unlink(c(f1, f2)) 244s > # Try to mess up sink counter by replacing the real sink with a fake sink 244s > # should lead to a waived connection 244s > cons <- new("unitizerCaptCons") 244s > cons <- unitizer:::set_capture(cons) 244s > f1 <- tempfile() 244s > sink() 244s > sink(f1) 244s > capt <- unitizer:::get_capture(cons) 244s > cons <- unitizer:::unsink_cons(cons) 244s > attr(cons@out.c, "waive") 244s > attr(cons@err.c, "waive") 244s > capt 244s > # Try to fix so that we don't get a full stack release error 244s > sink() 244s > sink(cons@out.c) 244s > unitizer:::close_and_clear(cons) 244s > unlink(f1) 244s > # helper function 244s > f1 <- tempfile() 244s > f2 <- tempfile() 244s > c1 <- file(f1, "w+b") 244s > c2 <- file(f2, "w+b") 244s > sink(c2) 244s > unitizer:::is_stdout_sink(f1) 244s > sink() 244s > sink(c1) 244s > unitizer:::is_stdout_sink(f1) 244s > sink() 244s > close(c1) 244s > close(c2) 244s > unlink(c(f1, f2)) 244s > 244s > # - "connection breaking tests" ------------------------------------------------ 244s > 244s > # # These tests cannot be run as they blow away the entire sink stack which can 244s > # # mess up any testing done under capture 244s > # 244s > # test_that("connection breaking tests", { 244s > # # Test the more pernicious error where we substitute the stdout sink 244s > # 244s > # cons <- new("unitizerCaptCons") 244s > # cons <- unitizer:::set_capture(cons) 244s > # cat("woohoo\n") 244s > # cat("yohooo\n", file=stderr()) 244s > # f1 <- tempfile() 244s > # sink() 244s > # sink(f1) 244s > # capt <- unitizer:::get_capture(cons) 244s > # cons <- unitizer:::unsink_cons(cons) 244s > # sink() 244s > # unlink(f1) 244s > # expect_true(attr(cons@out.c, "waive")) 244s > # expect_null(attr(cons@err.c, "waive")) 244s > # expect_identical( 244s > # capt, list(output = "woohoo\n", message = "yohooo\n") 244s > # ) 244s > # expect_identical( 244s > # unitizer:::close_and_clear(cons), 244s > # structure(c(FALSE, TRUE), .Names = c("output", "message")) 244s > # ) 244s > # }) 244s > 244s > # - "close_and_clear" ---------------------------------------------------------- 244s > 244s > # need some careful handling to make sure we don't mess up the testthat's 244s > # sinking (legacy behavior) 244s > cons <- new("unitizerCaptCons") 244s > err.con <- cons@stderr.con 244s > on.exit(sink(err.con, type = "message")) 244s > # intended to cause an error 244s > cons@stderr.con <- list() 244s > # msg: "Unable to restore original " 244s > cons.txt <- capture.output(status <- unitizer:::close_and_clear(cons), 244s + type = "message") 244s | Unable to restore original message sink, setting back to normal stderr 244s 244s > any(grepl("connection", cons.txt)) 244s [1] TRUE 244s > sink(err.con, type = "message") 244s > status["message"] 244s message 244s FALSE 244s > 244s > # - "eval with capt" ----------------------------------------------------------- 244s > 244s > suppressWarnings(glob <- unitizer:::unitizerGlobal$new()) 244s > all.equal( 244s + (capt <- unitizer:::eval_with_capture(quote(1 + 1), global = glob))[1:8], 244s + rds(100) 244s + ) 244s [1] TRUE 244s > is(capt[[9]], "unitizerCaptCons") 244s [1] TRUE 244s > all.equal( 244s + ( 244s + capt <- unitizer:::eval_with_capture( 244s + cat("wow\n", file = stderr()), global = glob) 244s + )[1:8], 244s + rds(200) 244s + ) 244s [1] TRUE 244s > is(capt[[9]], "unitizerCaptCons") 244s [1] TRUE 244s > 244s PASS 244s Begin testing t-change.R 244s 244s R version 4.3.2 (2023-10-31) -- "Eye Holes" 244s Copyright (C) 2023 The R Foundation for Statistical Computing 244s Platform: aarch64-unknown-linux-gnu (64-bit) 244s 244s R is free software and comes with ABSOLUTELY NO WARRANTY. 244s You are welcome to redistribute it under certain conditions. 244s Type 'license()' or 'licence()' for distribution details. 244s 244s R is a collaborative project with many contributors. 244s Type 'contributors()' for more information and 244s 'citation()' on how to cite R or R packages in publications. 244s 244s Type 'demo()' for some demos, 'help()' for on-line help, or 244s 'help.start()' for an HTML browser interface to help. 244s Type 'q()' to quit R. 244s 244s > source(file.path("_helper", "init.R")) 245s > 245s > # - "Construction works" ------------------------------------------------------- 245s > 245s > # invalid slot 245s > try(new("unitizerChanges", removed = 1:3)) 245s Error in validObject(.Object) : 245s invalid class "unitizerChanges" object: slot `@`removed must be of length 2 245s > # invalid/ got character 245s > try(new("unitizerChanges", failed = letters[1:2])) 245s Error in validObject(.Object) : 245s invalid class "unitizerChanges" object: invalid object for slot "failed" in class "unitizerChanges": got class "character", should be or extend class "integer" 245s > 245s > # - "Output as expected" ------------------------------------------------------- 245s > 245s > my.changes <- new("unitizerChanges", failed = c(1L, 10L), new = c(1L, 245s + 5L), removed = c(2L, 4L), corrupted = c(3L, 8L)) 245s > show(my.changes) 245s - Replacing 1 out of 10 failed tests 245s - Adding 1 out of 5 new tests 245s - Removing 2 out of 4 removed tests 245s - Replacing 3 out of 8 tests with errors 245s > 245s > # - "Length Works" ------------------------------------------------------------- 245s > 245s > length(my.changes) # 7 245s [1] 7 245s > 245s PASS 245s Begin testing t-demo.R 245s 245s R version 4.3.2 (2023-10-31) -- "Eye Holes" 245s Copyright (C) 2023 The R Foundation for Statistical Computing 245s Platform: aarch64-unknown-linux-gnu (64-bit) 245s 245s R is free software and comes with ABSOLUTELY NO WARRANTY. 245s You are welcome to redistribute it under certain conditions. 245s Type 'license()' or 'licence()' for distribution details. 245s 245s R is a collaborative project with many contributors. 245s Type 'contributors()' for more information and 245s 'citation()' on how to cite R or R packages in publications. 245s 245s Type 'demo()' for some demos, 'help()' for on-line help, or 245s 'help.start()' for an HTML browser interface to help. 245s Type 'q()' to quit R. 245s 245s > source(file.path("aammrtf", "mock.R")) 245s > source(file.path("_helper", "init.R")) 245s > source(file.path("_helper", "pkgs.R")) 245s Install Packages 249s Setup Demos 249s > 249s > # Mostly makes sure the demo steps work, but since it is a convenient way of 249s > # generating a unitizer with actual errors and so forth, we use it to test a few 249s > # other things as well in the context of those unitizers 249s > 249s > # - "in_pkg" ------------------------------------------------------------------- 249s > 249s > base.dir <- file.path(FLM, "tests", "extra") 249s > in.pkg.file <- file.path(base.dir, "inpkg.R") 249s > 249s > unitizer:::read_line_set_vals(c("Q")) 249s > txt1 <- unitizer:::capture_output(unitize(in.pkg.file, interactive.mode = TRUE)) 250s > # `sub` needed due to inconsistencies in R 3.4 and 3.3 for top level error 250s > # messages 250s > txt1$message <- sub("^Error.*:", "", txt1$message) 250s > txt1 250s - Output ----------------------------------------------------------------------- 250s 250s 250s +------------------------------------------------------------------------------+ 250s | unitizer for: extra/inpkg.R | 250s +------------------------------------------------------------------------------+ 250s 250s Pass Fail New 250s - - 1 250s ........................... 250s - - 1 250s 250s - New -------------------------------------------------------------------------- 250s 250s | The following test is new. Add test to store ([Y]es, [N]o, [P]rev, [B]rowse, 250s | [R]erun, [Q]uit, [H]elp)? 250s 250s # should fail normally, but return TRUE if run in fastlm 250s 250s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 250s > hidden_fun() 250s 250s unitizer> Q 250s 250s | unitizer unchanged. 250s 250s - Message ---------------------------------------------------------------------- 250s 250s could not find function "hidden_fun" 250s | No changes recorded. 250s > unitizer:::read_line_set_vals(c("Q")) 250s > unitize(in.pkg.file, state = in_pkg(), interactive.mode = TRUE) 250s 250s +------------------------------------------------------------------------------+ 250s | unitizer for: extra/inpkg.R | 250s +------------------------------------------------------------------------------+ 250s 250s Pass Fail New 250s - - 1 250s ........................... 250s - - 1 250s 251s - New -------------------------------------------------------------------------- 251s 251s | The following test is new. Add test to store ([Y]es, [N]o, [P]rev, [B]rowse, 251s | [R]erun, [Q]uit, [H]elp)? 251s 251s # should fail normally, but return TRUE if run in fastlm 251s 251s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 251s > hidden_fun() 251s [1] TRUE 251s 251s unitizer> Q 251s 251s | No changes recorded. 251s | unitizer unchanged. 251s 251s > unitizer:::read_line_set_vals(c("Q")) 251s > try(unitize(in.pkg.file, state = in_pkg("ASDFASDFA"), interactive.mode = TRUE)) 251s 251s Error in loadNamespace(name) : there is no package called 'ASDFASDFA' 251s Error in in_pkg_to_env(x.raw@par.env, test.files) : 251s Unable to load "ASDFASDFA" namespace to use as parent environment; see `? 251s unitizerState` for instructions on how to specify a package namespace as a 251s parent environment for tests. 251s Error in as.state(state, test.files) : 251s Unable to convert `par.env` value to a namespace environment 251s Error in unitize_core(test.file.inf, list(store.id.inf), state = state, : 251s Argument `state` could not be evaluated. 251s > 251s > # - "copy fastlm dir works" ---------------------------------------------------- 251s > 251s > sort(tolower(list.files("."))) 251s [1] "description" "man" "namespace" "r" 251s [5] "tests" "utzflm.rcheck" 251s > readLines(file.path(".", "DESCRIPTION"))[[5L]] # v0.1.0 251s [1] "Version: 0.1.0" 251s > update_fastlm(".", version = "0.1.1") 251s > readLines(file.path(".", "DESCRIPTION"))[[5L]] 251s [1] "Version: 0.1.1" 251s > update_fastlm(".", version = "0.1.2") 251s > readLines(file.path(".", "DESCRIPTION"))[[5L]] 251s [1] "Version: 0.1.2" 251s > 251s > # - "show_file" ---------------------------------------------------------------- 251s > 251s > f <- tempfile() 251s > cat("this is a\ntest code\nfile\n", file = f) 251s > file.show <- capture.output(show_file(f)) 251s > file.show[[1L]] 251s [1] "+---------------+" 251s > start.file <- grep("+---+-----------+", file.show, fixed = TRUE) 251s > length(start.file) # 2 251s [1] 2 251s > writeLines(file.show[start.file[[1L]]:start.file[[2L]]]) 251s +---+-----------+ 251s | 1 | this is a | 251s | 2 | test code | 251s | 3 | file | 251s +---+-----------+ 251s > unlink(f) 251s > 251s > # Run actual demo bits; note we want to force `interactive.mode=TRUE` so that 251s > # `read_line_vals` values are used as user input; note that until we fix 251s > # / rationalize how sinking behaves within unitizer when the standard streams 251s > # come in sunk, we won't be able to fully test everything, since for example 251s > # the display of the captured stdout just won't happen. 251s > 251s > # - "demo create worked" ------------------------------------------------------- 251s > 251s > # In tests, initial version of package should be 0.1.0; the test store 251s > # does not exist so it doesn't get overwritten with subsequent updates 251s > # Note the initial install happens in the test running script 251s > 251s > unitizer:::update_fastlm(".", version = "0.1.0") 251s > inst_pak(".") 252s > unitizer:::read_line_set_vals(c("Y", "Y", "Y", "Y", "Y")) 252s > untz <- unitize(FLM.TEST.FILE, interactive.mode = TRUE) 252s 252s +------------------------------------------------------------------------------+ 252s | unitizer for: unitizer/fastlm1.R | 252s +------------------------------------------------------------------------------+ 252s 252s Pass Fail New 252s - - 4 252s ........................... 252s - - 4 252s 252s - New -------------------------------------------------------------------------- 252s 252s | The 4 tests in this section are new. Add tests to store ([Y]es, [N]o, [P]rev, 252s | [B]rowse, [R]erun, [Q]uit, [H]elp)? 252s 252s # Assignments and calls to `library` are not considered tests by 252s # `unitizer` so you will not need to review them 252s 252s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 252s > dat <- data.frame(x = 1:100, y = (1:100)^2) 252s > res <- fastlm(dat$x, dat$y) 252s 252s # The `unitizer>` prompt is like the standard R prompt. You may 252s # enter expressions such as `lm(y ~ x, dat)$coefficients`, or 252s # `str(res)`. 252s # 252s # Once you are done reviewing, you need to tell `unitizer` you 252s # accept the test by typing 'Y' at the prompt. Enter 'H' for help. 252s 252s > res 252s intercept slope rsq 252s -1717.000 101.000 0.939 252s attr(,"class") 252s [1] "fastlm" 252s 252s unitizer> Y 252s 252s # There are three more tests to review; accept them with 'Y' 252s 252s > get_slope(res) 252s [1] 101 252s 252s unitizer> Y 252s 252s > get_rsq(res) 252s [1] 0.939 252s 252s unitizer> Y 252s 252s # This last test is expected to cause an error; press 'Y' to 252s # accept it so future checks can confirm the same error persists 252s 252s > fastlm(1:100, 1:10) 252s Error in fastlm(1:100, 1:10) : 252s Arguments `x` and `y` must be the same length. 252s 252s unitizer> Y 252s 252s = Finalize Unitizer ============================================================ 252s 252s | You will IRREVERSIBLY modify 'unitizer/fastlm1.unitizer' by: 252s | - Adding 4 out of 4 new tests 252s 252s | Update unitizer ([Y]es, [N]o, [P]rev, [B]rowse, [R]erun)? 252s 252s unitizer> Y 252s 252s | unitizer updated. 252s 252s > is(untz, "unitizer_result") 252s [1] TRUE 252s > print(untz) 252s Test File: tests/unitizer/fastlm1.R 252s Store ID: tests/unitizer/fastlm1.unitizer 252s 252s id call ignored status user reviewed 252s 1 1 library(utzflm, lib.loc = g... * New N FALSE 252s 2 2 dat <- data.frame(x = 1:100... * New N FALSE 252s 3 3 res <- fastlm(dat$x, dat$y) * New N FALSE 252s 4 4 res New Y TRUE 252s 5 5 get_slope(res) New Y TRUE 252s 6 6 get_rsq(res) New Y TRUE 252s 7 7 fastlm(1:100, 1:10) New Y TRUE 252s > # Re-running doesn't change unitizer 252s > untz2 <- unitize(FLM.TEST.FILE, interactive.mode = TRUE) 252s 252s | 4/4 tests passed; nothing to review. 252s 252s > print(untz2) 252s Test File: tests/unitizer/fastlm1.R 252s Store ID: tests/unitizer/fastlm1.unitizer 252s 252s id call ignored status user reviewed 252s 1 1 library(utzflm, lib.loc = g... * Passed Y FALSE 252s 2 2 dat <- data.frame(x = 1:100... * Passed Y FALSE 252s 3 3 res <- fastlm(dat$x, dat$y) * Passed Y FALSE 252s 4 4 res Passed Y FALSE 252s 5 5 get_slope(res) Passed Y FALSE 252s 6 6 get_rsq(res) Passed Y FALSE 252s 7 7 fastlm(1:100, 1:10) Passed Y FALSE 252s 252s You chose NOT to save these changes to the unitizer store 252s > # Rejecting failed tests does not change unitizer 252s > update_fastlm(".", version = "0.1.1") 252s > inst_pak(".") 253s > 253s > unitizer:::read_line_set_vals(c("N", "N", "Y")) 253s > unitizer:::capture_output( 253s + untz3 <- unitize(FLM.TEST.FILE, interactive.mode = TRUE) 253s + ) 254s > print(untz3) 254s Test File: tests/unitizer/fastlm1.R 254s Store ID: tests/unitizer/fastlm1.unitizer 254s 254s id call ignored status user reviewed 254s 1 1 library(utzflm, lib.loc = g... * Failed N FALSE 254s 2 2 dat <- data.frame(x = 1:100... * Failed N FALSE 254s 3 3 res <- fastlm(dat$x, dat$y) * Failed N FALSE 254s 4 4 res Failed N TRUE 254s 5 5 get_slope(res) Failed N TRUE 254s 6 6 get_rsq(res) Passed Y FALSE 254s 7 7 fastlm(1:100, 1:10) Passed Y FALSE 254s 254s You chose NOT to save these changes to the unitizer store 254s > 254s > # - "demo review" -------------------------------------------------------------- 254s > 254s > # review is always in interactive mode 254s > unitizer:::read_line_set_vals(c("5", "Q")) 254s > review(FLM.TEST.STORE) 254s 254s +------------------------------------------------------------------------------+ 254s | unitizer for: tests/unitizer/fastlm1.unitizer | 254s +------------------------------------------------------------------------------+ 254s 254s *1. library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) . -:- 254s *2. dat <- data.frame(x = 1:100, y = (1:100)^2) . . . . . . -:- 254s *3. res <- fastlm(dat$x, dat$y) . . . . . . . . . . . . -:- 254s 4. res . . . . . . . . . . . . . . . . . . . . Passed:- 254s 5. get_slope(res) . . . . . . . . . . . . . . . . Passed:- 254s 6. get_rsq(res) . . . . . . . . . . . . . . . . . Passed:- 254s 7. fastlm(1:100, 1:10) . . . . . . . . . . . . . . Passed:- 254s 254s | What test do you wish to review (input a test number, [U]nreviewed)? 254s 254s unitizer> 5 254s - Passed ----------------------------------------------------------------------- 254s 254s | The 4 tests in this section passed. Keep tests in store ([Y]es, [N]o, [P]rev, 254s | [B]rowse, [Q]uit, [H]elp)? 254s 254s # There are three more tests to review; accept them with 'Y' 254s 254s > get_slope(res) 254s [1] 101 254s 254s unitizer> Q 254s 254s | No changes recorded. 254s | unitizer unchanged. 254s 254s > 254s > # - "use.diff" ----------------------------------------------------------------- 254s > 254s > # Use this opportunity to make sure `use.diff=FALSE` works as intended 254s > unitizer:::read_line_set_vals("Q") 254s > unitize(FLM.TEST.FILE, interactive.mode = TRUE, use.diff = FALSE) 254s 254s +------------------------------------------------------------------------------+ 254s | unitizer for: unitizer/fastlm1.R | 254s +------------------------------------------------------------------------------+ 254s 254s Pass Fail 254s 2 2 254s ...................... 254s 2 2 254s 254s - Failed ----------------------------------------------------------------------- 254s 254s | The 2 tests in this section failed because the new evaluations do not match 254s | the reference values from the store. Overwrite with new results ([Y]es, [N]o, 254s | [P]rev, [B]rowse, [R]erun, [Q]uit, [H]elp)? 254s 254s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 254s > dat <- data.frame(x = 1:100, y = (1:100)^2) 254s > res <- fastlm(dat$x, dat$y) 254s 254s # Our fast computations do not produce the same results as our 254s # original tests so they fail. If you need more detail than the 254s # provided diff you may use `.new`/`.NEW` or `.ref`/`.REF`. 254s # 254s # You should reject these tests by typing 'N' at the prompt since 254s # they are incorrect. 254s 254s > res 254s intercept slope rsq 254s -3.54e+13 7.01e+11 9.39e-01 254s attr(,"class") 254s [1] "fastlm" 254s 254s | Value mismatch: 254s 254s [1] "Mean relative difference: 1.99e+10" 254s 254s | State mismatch; see `.NEW$state` and `.REF$state`. 254s 254s unitizer> Q 254s 254s | No changes recorded. 254s | unitizer unchanged. 254s 254s > unitizer:::read_line_set_vals(c(".DIFF$state", "Q")) 254s > 254s > unitize(FLM.TEST.FILE, interactive.mode = TRUE, use.diff = FALSE) 254s 254s +------------------------------------------------------------------------------+ 254s | unitizer for: unitizer/fastlm1.R | 254s +------------------------------------------------------------------------------+ 254s 254s Pass Fail 254s 2 2 254s ...................... 254s 2 2 254s 254s - Failed ----------------------------------------------------------------------- 254s 254s | The 2 tests in this section failed because the new evaluations do not match 254s | the reference values from the store. Overwrite with new results ([Y]es, [N]o, 254s | [P]rev, [B]rowse, [R]erun, [Q]uit, [H]elp)? 254s 254s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 254s > dat <- data.frame(x = 1:100, y = (1:100)^2) 254s > res <- fastlm(dat$x, dat$y) 254s 254s # Our fast computations do not produce the same results as our 254s # original tests so they fail. If you need more detail than the 254s # provided diff you may use `.new`/`.NEW` or `.ref`/`.REF`. 254s # 254s # You should reject these tests by typing 'N' at the prompt since 254s # they are incorrect. 254s 254s > res 254s intercept slope rsq 254s -3.54e+13 7.01e+11 9.39e-01 254s attr(,"class") 254s [1] "fastlm" 254s 254s | Value mismatch: 254s 254s [1] "Mean relative difference: 1.99e+10" 254s 254s | State mismatch; see `.NEW$state` and `.REF$state`. 254s 254s unitizer> .DIFF$state 254s | State mismatch: 254s 254s Attributes: < Component "search.path": 1 string mismatch > 254s 254s unitizer> Q 254s 254s | No changes recorded. 254s | unitizer unchanged. 254s 254s > 254s > # - "failing diff" ------------------------------------------------------------- 254s > 254s > unitizer:::read_line_set_vals("Q") 254s > mock(diffobj::diffObj, quote(stop("A failing diff."))) 254s > unitize(FLM.TEST.FILE, interactive.mode = TRUE) 254s 254s +------------------------------------------------------------------------------+ 254s | unitizer for: unitizer/fastlm1.R | 254s +------------------------------------------------------------------------------+ 254s 254s Pass Fail 254s 2 2 254s ...................... 254s 2 2 254s 254s - Failed ----------------------------------------------------------------------- 254s 254s | The 2 tests in this section failed because the new evaluations do not match 254s | the reference values from the store. Overwrite with new results ([Y]es, [N]o, 254s | [P]rev, [B]rowse, [R]erun, [Q]uit, [H]elp)? 254s 254s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 254s > dat <- data.frame(x = 1:100, y = (1:100)^2) 254s > res <- fastlm(dat$x, dat$y) 254s 254s # Our fast computations do not produce the same results as our 254s # original tests so they fail. If you need more detail than the 254s # provided diff you may use `.new`/`.NEW` or `.ref`/`.REF`. 254s # 254s # You should reject these tests by typing 'N' at the prompt since 254s # they are incorrect. 254s 254s > res 254s intercept slope rsq 254s -3.54e+13 7.01e+11 9.39e-01 254s attr(,"class") 254s [1] "fastlm" 254s 254s Error in diffObj(curr.err@.ref, curr.err@.new, tar.banner = make_cont(".ref"), : 254s A failing diff. 254s | Value: 254s 254s | State mismatch; see `.DIFF$state` for details. 254s 254s unitizer> Q 254s 254s | No changes recorded. 254s | unitizer unchanged. 254s 254s > unmock(diffobj::diffObj) 254s > 254s > # - "multi-accept" ------------------------------------------------------------- 254s > 254s > # Test what happens if we back out of a multi-accept 254s > 254s > unitizer:::read_line_set_vals(c("YY", "N", "Q")) 254s > unitize(FLM.TEST.FILE, interactive.mode = TRUE) 254s 255s +------------------------------------------------------------------------------+ 255s | unitizer for: unitizer/fastlm1.R | 255s +------------------------------------------------------------------------------+ 255s 255s Pass Fail 255s 2 2 255s ...................... 255s 2 2 255s 255s - Failed ----------------------------------------------------------------------- 255s 255s | The 2 tests in this section failed because the new evaluations do not match 255s | the reference values from the store. Overwrite with new results ([Y]es, [N]o, 255s | [P]rev, [B]rowse, [R]erun, [Q]uit, [H]elp)? 255s 255s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 255s > dat <- data.frame(x = 1:100, y = (1:100)^2) 255s > res <- fastlm(dat$x, dat$y) 255s 255s # Our fast computations do not produce the same results as our 255s # original tests so they fail. If you need more detail than the 255s # provided diff you may use `.new`/`.NEW` or `.ref`/`.REF`. 255s # 255s # You should reject these tests by typing 'N' at the prompt since 255s # they are incorrect. 255s 255s > res 255s intercept slope rsq 255s -3.54e+13 7.01e+11 9.39e-01 255s attr(,"class") 255s [1] "fastlm" 255s 255s | Value mismatch: 255s 255s < .ref > .new 255s @@ 1,4 @@ @@ 1,4 @@ 255s intercept slope rsq intercept slope rsq 255s < -1717.000 101.000 0.939 > -3.54e+13 7.01e+11 9.39e-01 255s attr(,"class") attr(,"class") 255s [1] "fastlm" [1] "fastlm" 255s 255s | State mismatch; see `.DIFF$state` for details. 255s 255s unitizer> YY 255s 255s 4. res . . . . . Failed:- 255s 5. get_slope(res) . Failed:- 255s 255s Choose 'Y' for the 2 tests shown above ([Y]es, [N]o)? 255s unitizer> N 255s 255s 255s # Our fast computations do not produce the same results as our 255s # original tests so they fail. If you need more detail than the 255s # provided diff you may use `.new`/`.NEW` or `.ref`/`.REF`. 255s # 255s # You should reject these tests by typing 'N' at the prompt since 255s # they are incorrect. 255s 255s > res 255s intercept slope rsq 255s -3.54e+13 7.01e+11 9.39e-01 255s attr(,"class") 255s [1] "fastlm" 255s 255s | Value mismatch: 255s 255s < .ref > .new 255s @@ 1,4 @@ @@ 1,4 @@ 255s intercept slope rsq intercept slope rsq 255s < -1717.000 101.000 0.939 > -3.54e+13 7.01e+11 9.39e-01 255s attr(,"class") attr(,"class") 255s [1] "fastlm" [1] "fastlm" 255s 255s | State mismatch; see `.DIFF$state` for details. 255s 255s unitizer> Q 255s 255s | No changes recorded. 255s | unitizer unchanged. 255s 255s > 255s > # - "multi-input" -------------------------------------------------------------- 255s > 255s > # Or if we request to go to unreviewed when there are none 255s > unitizer:::read_line_set_vals(c("YY", "Y", "B", "U", "Q")) 255s > unitize(FLM.TEST.FILE, interactive.mode = TRUE) 255s 255s +------------------------------------------------------------------------------+ 255s | unitizer for: unitizer/fastlm1.R | 255s +------------------------------------------------------------------------------+ 255s 255s Pass Fail 255s 2 2 255s ...................... 255s 2 2 255s 255s - Failed ----------------------------------------------------------------------- 255s 255s | The 2 tests in this section failed because the new evaluations do not match 255s | the reference values from the store. Overwrite with new results ([Y]es, [N]o, 255s | [P]rev, [B]rowse, [R]erun, [Q]uit, [H]elp)? 255s 255s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 255s > dat <- data.frame(x = 1:100, y = (1:100)^2) 255s > res <- fastlm(dat$x, dat$y) 255s 255s # Our fast computations do not produce the same results as our 255s # original tests so they fail. If you need more detail than the 255s # provided diff you may use `.new`/`.NEW` or `.ref`/`.REF`. 255s # 255s # You should reject these tests by typing 'N' at the prompt since 255s # they are incorrect. 255s 255s > res 255s intercept slope rsq 255s -3.54e+13 7.01e+11 9.39e-01 255s attr(,"class") 255s [1] "fastlm" 255s 255s | Value mismatch: 255s 255s < .ref > .new 255s @@ 1,4 @@ @@ 1,4 @@ 255s intercept slope rsq intercept slope rsq 255s < -1717.000 101.000 0.939 > -3.54e+13 7.01e+11 9.39e-01 255s attr(,"class") attr(,"class") 255s [1] "fastlm" [1] "fastlm" 255s 255s | State mismatch; see `.DIFF$state` for details. 255s 255s unitizer> YY 255s 255s 4. res . . . . . Failed:- 255s 5. get_slope(res) . Failed:- 255s 255s Choose 'Y' for the 2 tests shown above ([Y]es, [N]o)? 255s unitizer> Y 255s 255s = Finalize Unitizer ============================================================ 255s 255s | You will IRREVERSIBLY modify 'unitizer/fastlm1.unitizer' by: 255s | - Replacing 2 out of 2 failed tests 255s 255s | Update unitizer ([Y]es, [N]o, [P]rev, [B]rowse, [R]erun)? 255s 255s unitizer> B 255s 255s *1. library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) . -:- 255s *2. dat <- data.frame(x = 1:100, y = (1:100)^2) . . . . . . -:- 255s *3. res <- fastlm(dat$x, dat$y) . . . . . . . . . . . . -:- 255s 4. res . . . . . . . . . . . . . . . . . . . . Failed:Y 255s 5. get_slope(res) . . . . . . . . . . . . . . . . Failed:Y 255s 6. get_rsq(res) . . . . . . . . . . . . . . . . . Passed:- 255s 7. fastlm(1:100, 1:10) . . . . . . . . . . . . . . Passed:- 255s 255s | What test do you wish to review (input a test number, [U]nreviewed)? 255s 255s unitizer> U 255s 255s | No unreviewed tests. 255s 255s = Finalize Unitizer ============================================================ 255s 255s | You will IRREVERSIBLY modify 'unitizer/fastlm1.unitizer' by: 255s | - Replacing 2 out of 2 failed tests 255s 255s | Update unitizer ([Y]es, [N]o, [P]rev, [B]rowse, [R]erun)? 255s 255s unitizer> Q 255s 255s | Changes discarded. 255s | unitizer unchanged. 255s 255s > 255s > # - "warn in parse" ------------------------------------------------------------ 255s > 255s > # Make sure parse warnings are issued 255s > unitizer:::read_line_set_vals(c("-2147483648L", "Q")) 255s > txt8 <- unitizer:::capture_output(unitize(FLM.TEST.FILE, 255s + interactive.mode = TRUE)) 255s > 255s > any(grepl("qualified with L", txt8$message)) 255s [1] TRUE 255s > 255s > # - "demo changes" ------------------------------------------------------------- 255s > # 255s > # Now actually accept the changes 255s > unitizer:::read_line_set_vals(c("Y", "Y", "Y")) 255s > untz5 <- unitize(FLM.TEST.FILE, interactive.mode = TRUE) 255s 256s +------------------------------------------------------------------------------+ 256s | unitizer for: unitizer/fastlm1.R | 256s +------------------------------------------------------------------------------+ 256s 256s Pass Fail 256s 2 2 256s ...................... 256s 2 2 256s 256s - Failed ----------------------------------------------------------------------- 256s 256s | The 2 tests in this section failed because the new evaluations do not match 256s | the reference values from the store. Overwrite with new results ([Y]es, [N]o, 256s | [P]rev, [B]rowse, [R]erun, [Q]uit, [H]elp)? 256s 256s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 256s > dat <- data.frame(x = 1:100, y = (1:100)^2) 256s > res <- fastlm(dat$x, dat$y) 256s 256s # Our fast computations do not produce the same results as our 256s # original tests so they fail. If you need more detail than the 256s # provided diff you may use `.new`/`.NEW` or `.ref`/`.REF`. 256s # 256s # You should reject these tests by typing 'N' at the prompt since 256s # they are incorrect. 256s 256s > res 256s intercept slope rsq 256s -3.54e+13 7.01e+11 9.39e-01 256s attr(,"class") 256s [1] "fastlm" 256s 256s | Value mismatch: 256s 256s < .ref > .new 256s @@ 1,4 @@ @@ 1,4 @@ 256s intercept slope rsq intercept slope rsq 256s < -1717.000 101.000 0.939 > -3.54e+13 7.01e+11 9.39e-01 256s attr(,"class") attr(,"class") 256s [1] "fastlm" [1] "fastlm" 256s 256s | State mismatch; see `.DIFF$state` for details. 256s 256s unitizer> Y 256s 256s # This one is also incorrect; reject with 'N' 256s 256s > get_slope(res) 256s [1] 7.01e+11 256s 256s | Value mismatch: 256s 256s < .ref > .new 256s @@ 1 @@ @@ 1 @@ 256s < [1] 101 > [1] 7.01e+11 256s 256s | State mismatch; see `.DIFF$state` for details. 256s 256s unitizer> Y 256s 256s = Finalize Unitizer ============================================================ 256s 256s | You will IRREVERSIBLY modify 'unitizer/fastlm1.unitizer' by: 256s | - Replacing 2 out of 2 failed tests 256s 256s | Update unitizer ([Y]es, [N]o, [P]rev, [B]rowse, [R]erun)? 256s 256s unitizer> Y 256s 256s | unitizer updated. 256s 256s > unitizer:::read_line_set_vals(NULL) 256s > 256s > # - "get_package_dir" ---------------------------------------------------------- 256s > 256s > # These were in t-get but we moved them here to avoid re-loading pkgs.R 256s > 256s > unitizer:::get_package_dir(f) # empty 256s character(0) 256s > test.dir.1 <- file.path(".", "utzflm.Rcheck", "utzflm", "R") 256s > identical( 256s + unitizer:::get_package_dir(test.dir.1), 256s + normalizePath(dirname(test.dir.1), winslash = "/") 256s + ) 256s [1] TRUE 256s > test.dir.2 <- file.path(".", "utzflm.Rcheck") 256s > identical( 256s + unitizer:::get_package_dir(file.path(test.dir.2, "tests", "tests.R")), 256s + normalizePath(file.path(test.dir.2, "utzflm"), winslash = "/") 256s + ) 256s [1] TRUE 256s > 256s PASS 256s Begin testing t-error.R 256s 256s R version 4.3.2 (2023-10-31) -- "Eye Holes" 256s Copyright (C) 2023 The R Foundation for Statistical Computing 256s Platform: aarch64-unknown-linux-gnu (64-bit) 256s 256s R is free software and comes with ABSOLUTELY NO WARRANTY. 256s You are welcome to redistribute it under certain conditions. 256s Type 'license()' or 'licence()' for distribution details. 256s 256s R is a collaborative project with many contributors. 256s Type 'contributors()' for more information and 256s 'citation()' on how to cite R or R packages in publications. 256s 256s Type 'demo()' for some demos, 'help()' for on-line help, or 256s 'help.start()' for an HTML browser interface to help. 256s Type 'q()' to quit R. 256s 256s > source(file.path("_helper", "init.R")) 256s > 256s > # - "Test Error Diffs" --------------------------------------------------------- 256s > 256s > diffs <- new( 256s + "unitizerItemTestsErrorsDiffs", 256s + value = new("unitizerItemTestsErrorsDiff", 256s + txt = "value", err = TRUE, diff = diffobj::diffChr(1, 2)) 256s + ) 257s > diffs$value@diff@target 257s [1] 1 257s > diffs$value@diff@current 257s [1] 2 257s > try(diffs$values) 257s Error in .local(x, i, j, ...) : 257s Argument `i` must be one of c("value", "conditions", "output", "message", "aborted", "state") 257s > try(diffs[[NA]]) 257s Error in .local(x, i, j, ...) : 257s Argument `i` must be character(1L) and not NA 257s > err <- new( 257s + "unitizerItemTestsErrors", 257s + value = new( 257s + "unitizerItemTestError", compare.err = TRUE, value = c("compare", "error") 257s + ) ) 257s > # - "Show Test Error" ---------------------------------------------------------- 257s > 257s > is(unitizer:::as.Diffs(err)@value, "unitizerItemTestsErrorsDiff") 257s [1] TRUE 257s > 257s PASS 257s Begin testing t-exec.R 257s 257s R version 4.3.2 (2023-10-31) -- "Eye Holes" 257s Copyright (C) 2023 The R Foundation for Statistical Computing 257s Platform: aarch64-unknown-linux-gnu (64-bit) 257s 257s R is free software and comes with ABSOLUTELY NO WARRANTY. 257s You are welcome to redistribute it under certain conditions. 257s Type 'license()' or 'licence()' for distribution details. 257s 257s R is a collaborative project with many contributors. 257s Type 'contributors()' for more information and 257s 'citation()' on how to cite R or R packages in publications. 257s 257s Type 'demo()' for some demos, 'help()' for on-line help, or 257s 'help.start()' for an HTML browser interface to help. 257s Type 'q()' to quit R. 257s 257s > source(file.path("_helper", "init.R")) 257s > source(file.path("aammrtf", "ref.R")); make_ref_obj_funs("exec") 257s > 257s > suppressWarnings(glob <- unitizer:::unitizerGlobal$new()) 257s > 257s > # - "Invisible Expression" ----------------------------------------------------- 257s > 257s > e <- new.env() 257s > exp <- quote(x <- 1:30) 257s > all.equal(1:30, unitizer:::eval_user_exp(exp, e, global = glob)$value) 257s [1] TRUE 257s > 257s > # `eval_user_exp` must be evaluated outside of test_that; also note that by 257s > # design this will output stuff to stderr and stdout 257s > out.err <- capture.output(type = "message", out.std <- capture.output({ 257s + test.obj.s3 <- structure("hello", class = "test_obj") 257s + setClass("testObj", list(a = "character")) 257s + test.obj.s4 <- new("testObj", a = "goodday") 257s + print.test_obj <- function(x, ...) stop("Error in Print") 257s + setMethod("show", "testObj", function(object) stop("Error in Show")) 257s + fun_signal <- function() signalCondition(simpleError("Error in Function", 257s + sys.call())) 257s + fun_error <- function() stop("Error in function 2") 257s + fun_error_cond <- function() stop(simpleError("Error in function 2", 257s + sys.call())) 257s + fun_error_cond_call <- function() fun_error_cond() 257s + fun_s3 <- function() test.obj.s3 257s + fun_s4 <- function() test.obj.s4 257s + fun_msg <- function() message("This is a Message") 257s + fun_warn <- function() warning("This is a warning", immediate. = TRUE) 257s + eval.env <- sys.frame(sys.nframe()) 257s + ex0 <- unitizer:::eval_user_exp(quote(stop()), eval.env, 257s + global = glob) 257s + unitizer:::set_trace(ex0$trace) 257s + trace0 <- unitizer:::unitizer_traceback() 257s + ex1 <- unitizer:::eval_user_exp(quote(fun_signal()), eval.env, 257s + global = glob) 257s + unitizer:::set_trace(ex1$trace) 257s + trace1 <- unitizer:::unitizer_traceback() 257s + ex2 <- unitizer:::eval_user_exp(quote(fun_error()), eval.env, 257s + global = glob) 257s + unitizer:::set_trace(ex2$trace) 257s + trace2 <- unitizer:::unitizer_traceback() 257s + ex2a <- unitizer:::eval_user_exp(expression(fun_error()), 257s + eval.env, global = glob) 257s + unitizer:::set_trace(ex2a$trace) 257s + trace2a <- unitizer:::unitizer_traceback() 257s + ex6 <- unitizer:::eval_user_exp(quote(fun_error_cond()), 257s + eval.env, global = glob) 257s + unitizer:::set_trace(ex6$trace) 257s + trace6 <- unitizer:::unitizer_traceback() 257s + ex7 <- unitizer:::eval_user_exp(quote(fun_error_cond_call()), 257s + eval.env, global = glob) 257s + unitizer:::set_trace(ex7$trace) 257s + trace7 <- unitizer:::unitizer_traceback() 257s + ex3 <- unitizer:::eval_user_exp(quote(fun_s3()), eval.env, 257s + global = glob) 257s + unitizer:::set_trace(ex3$trace) 257s + trace3 <- unitizer:::unitizer_traceback() 257s + ex3a <- unitizer:::eval_user_exp(expression(fun_s3()), eval.env, 257s + global = glob) 257s + unitizer:::set_trace(ex3a$trace) 257s + trace3a <- unitizer:::unitizer_traceback() 257s + ex4 <- unitizer:::eval_user_exp(quote(fun_s4()), eval.env, 257s + global = glob) 257s + ex4a <- unitizer:::eval_user_exp(expression(fun_s4()), eval.env, 257s + global = glob) 257s + unitizer:::set_trace(ex4a$trace) 257s + trace4a <- unitizer:::unitizer_traceback() 257s + ex5 <- unitizer:::eval_user_exp(quote(sum(1:20)), eval.env, 257s + global = glob) 257s + ex9 <- unitizer:::eval_user_exp(quote(fun_warn()), eval.env, 257s + global = glob) 257s + ex10 <- unitizer:::eval_user_exp(quote(fun_msg()), eval.env, 257s + global = glob) 257s + ex11 <- unitizer:::eval_user_exp(quote((function() quote(stop("shouldn't error")))()), 257s + eval.env, global = glob) 257s + })) 257s > # NOTE: deparsed test values generated with unitizer:::deparse_mixed 257s > 257s > # - "User Expression Evaluation" ----------------------------------------------- 257s > 257s > # a condition error, signaled, not stop (hence no aborted, etc.) 257s > identical(ex1, rds(100)) 257s [1] TRUE 257s > # a stop 257s > identical(ex2, rds(200)) 257s [1] TRUE 257s > # ex3 and ex3a are a total PITA because the calls need to be manually copied 257s > # b/c they don't deparse properly even with control="all", the trace and 257s > # call component loose the `structure` part in the quoted portions... 257s > # a stop in print; 257s > identical(ex3, rds(300)) 257s [1] TRUE 257s > identical(ex3a, rds(400)) 257s [1] TRUE 257s > # S4 objects; these originally caused problems since they don't deparse 257s > identical(ex4, rds(500)) 257s [1] TRUE 257s > identical(ex4a, rds(600)) 257s [1] TRUE 257s > # a normal expression 257s > identical(ex5, rds(700)) 257s [1] TRUE 257s > identical(ex9, rds(800)) 257s [1] TRUE 257s > all.equal(ex10, rds(900)) # not sure why identical doesn't work here 257s [1] TRUE 257s > # expect_false(ex11$aborted) 257s > ex11$aborted # FALSE 257s [1] FALSE 257s > 257s > # - "Trace Setting" ------------------------------------------------------------ 257s > 257s > identical(trace0, trace1) 257s [1] TRUE 257s > # expect_identical(trace2, list("stop(\"Error in function 2\")", 257s > # "fun_error()")) 257s > trace2 257s [[1]] 257s [1] "stop(\"Error in function 2\")" 257s 257s [[2]] 257s [1] "fun_error()" 257s 257s > trace6 257s [[1]] 257s [1] "stop(simpleError(\"Error in function 2\", sys.call()))" 257s 257s [[2]] 257s [1] "fun_error_cond()" 257s 257s > trace7 257s [[1]] 257s [1] "stop(simpleError(\"Error in function 2\", sys.call()))" 257s 257s [[2]] 257s [1] "fun_error_cond()" 257s 257s [[3]] 257s [1] "fun_error_cond_call()" 257s 257s > trace3a 257s [[1]] 257s [1] "stop(\"Error in Print\")" 257s 257s [[2]] 257s [1] "print.test_obj(\"hello\")" 257s 257s [[3]] 257s [1] "print(\"hello\")" 257s 257s > 257s > # needed to tweak this one so it would pass in R-devel 3.4.1 257s > # expect_true(all(mapply(function(x, y) grepl(y, x), trace4a, list("stop\\(\"Error in Show\"\\)", 257s > # "show\\(.*\"testObj\".*\\)", "show\\(.*\"testObj\".*\\)")))) 257s > all( 257s + mapply( 257s + function(x, y) grepl(y, x), 257s + trace4a, 257s + list( 257s + "stop\\(\"Error in Show\"\\)", 257s + "show\\(.*\"testObj\".*\\)", "show\\(.*\"testObj\".*\\)") 257s + ) ) 257s [1] TRUE 257s > # - "Clean Top Level Message" -------------------------------------------------- 257s > 257s > old.width <- options(width = 80L) 257s > a <- unitizer:::eval_with_capture( 257s + expression(stop("short stop message")), global = glob 257s + ) 257s > b <- unitizer:::eval_with_capture( 257s + expression(stop("short stop .* with regex message")), global = glob 257s + ) 257s > c <- unitizer:::eval_with_capture( 257s + expression(stop("this is a long error message that is supposed to cause R to add a new line after the error: part")), 257s + global = glob 257s + ) 257s > d <- unitizer:::eval_with_capture( 257s + expression(warning("short warning message")), global = glob 257s + ) 257s > e <- unitizer:::eval_with_capture( 257s + expression(warning("short warning message .* with regex")), global = glob 257s + ) 257s > f <- unitizer:::eval_with_capture( 257s + expression( 257s + warning("this is a long error message that is supposed to cause R to add a new line after the error: part") 257s + ), 257s + global = glob 257s + ) 257s > g <- unitizer:::eval_with_capture( 257s + quote(stop("short stop message")), global = glob 257s + ) 257s > h <- unitizer:::eval_with_capture( 257s + quote(stop("short stop .* with regex message")), global = glob 257s + ) 257s > i <- unitizer:::eval_with_capture( 257s + quote(stop("this is a long error message that is supposed to cause R to add a new line after the error: part")), 257s + global = glob 257s + ) 257s > j <- unitizer:::eval_with_capture( 257s + quote(warning("short warning message")), global = glob 257s + ) 257s > k <- unitizer:::eval_with_capture( 257s + quote(warning("short warning message .* with regex")), global = glob 257s + ) 257s > l <- unitizer:::eval_with_capture( 257s + quote(warning("this is a long error message that is supposed to cause R to add a new line after the error: part")), 257s + global = glob 257s + ) 257s > m <- unitizer:::eval_with_capture(expression("a"/3), global = glob) 257s > exp.q <- quote({ 257s + fun <- function() warning("error in fun") 257s + message("boo hay \n there \n") 257s + warning("this is a fairly long warning wladsfasdfasd that might wrap if we keep typing humpty dumpty sat on a wall and had a big fall") 257s + warning("ashorter warning blah") 257s + message("boo hay \n there \n") 257s + warning() 257s + fun() 257s + suppressWarnings(warning("quiet warn")) 257s + message("boo hay \n there \n") 257s + error(3) 257s + }) 257s > x <- unitizer:::eval_with_capture(exp.q, global = glob) 257s > exp.exp <- expression({ 257s + fun <- function() warning("error in fun") 257s + message("boo hay \n there \n") 257s + warning("this is a fairly long warning wladsfasdfasd that might wrap if we keep typing humpty dumpty sat on a wall and had a big fall") 257s + warning("ashorter warning blah") 257s + message("boo hay \n there \n") 257s + warning() 257s + fun() 257s + suppressWarnings(warning("quiet warn")) 257s + message("boo hay \n there \n") 257s + error(3) 257s + }) 257s > y <- unitizer:::eval_with_capture(exp.exp, global = glob) 257s > options(old.width) 257s > 257s > a$message 257s [1] "Error: short stop message\n" 257s > b$message 257s [1] "Error: short stop .* with regex message\n" 257s > c$message 257s [1] "Error: \n this is a long error message that is supposed to cause R to add a new line after the error: part\n" 257s > d$message 257s [1] "Warning: short warning message\n" 257s > e$message 257s [1] "Warning: short warning message .* with regex\n" 257s > f$message 257s [1] "Warning:\n this is a long error message that is supposed to cause R to add a new line after the error: part\n" 257s > g$message 257s [1] "Error: short stop message\n" 257s > h$message 257s [1] "Error: short stop .* with regex message\n" 257s > i$message 257s [1] "Error: \n this is a long error message that is supposed to cause R to add a new line after the error: part\n" 257s > j$message 257s [1] "Warning: short warning message\n" 257s > k$message 257s [1] "Warning: short warning message .* with regex\n" 257s > l$message 257s [1] "Warning:\n this is a long error message that is supposed to cause R to add a new line after the error: part\n" 257s > m$message 257s [1] "Error in \"a\"/3 : non-numeric argument to binary operator\n" 257s > 257s > # `sub` needed due to inconsistencies in R 3.4 and 3.3 for top level error 257s > # messages 257s > writeLines(sub("\\bError.*: ", "", x$message)) 257s boo hay 257s there 257s 257s Warning: 257s this is a fairly long warning wladsfasdfasd that might wrap if we keep typing humpty dumpty sat on a wall and had a big fall 257s Warning: ashorter warning blah 257s boo hay 257s there 257s 257s Warning: 257s Warning in fun() : error in fun 257s boo hay 257s there 257s 257s could not find function "error" 257s 257s > writeLines(sub("\\bError.*: ", "", y$message)) 257s boo hay 257s there 257s 257s Warning: 257s this is a fairly long warning wladsfasdfasd that might wrap if we keep typing humpty dumpty sat on a wall and had a big fall 257s Warning: ashorter warning blah 257s boo hay 257s there 257s 257s Warning: 257s Warning in fun() : error in fun 257s boo hay 257s there 257s 257s could not find function "error" 257s 257s > 257s > 257s PASS 257s Begin testing t-get.R 257s 257s R version 4.3.2 (2023-10-31) -- "Eye Holes" 257s Copyright (C) 2023 The R Foundation for Statistical Computing 257s Platform: aarch64-unknown-linux-gnu (64-bit) 257s 257s R is free software and comes with ABSOLUTELY NO WARRANTY. 257s You are welcome to redistribute it under certain conditions. 257s Type 'license()' or 'licence()' for distribution details. 257s 257s R is a collaborative project with many contributors. 257s Type 'contributors()' for more information and 257s 'citation()' on how to cite R or R packages in publications. 257s 257s Type 'demo()' for some demos, 'help()' for on-line help, or 257s 'help.start()' for an HTML browser interface to help. 257s Type 'q()' to quit R. 257s 257s > source(file.path("_helper", "init.R")) 258s > source(file.path("aammrtf", "mock.R")) 258s > 258s > toy.path <- file.path("_helper", "unitizers", "misc.unitizer") 258s > toy.stor <- readRDS(file.path(toy.path, "data.rds")) 258s > 258s > # - "Error Cases" -------------------------------------------------------------- 258s > 258s > try(get_unitizer(1)) 258s Error in get_unitizer.default(1) : 258s No method defined for object of class "numeric"; make sure that the specified `store.id` is a reference to a valid unitizer store and had defined `get_unitizer` and `set_unitizer` methods. 258s > try(get_unitizer(letters)) 258s Error in get_unitizer.character(letters) : 258s Argument `store.id` must be a 1 length character vector 258s > try(get_unitizer("_helper")) 258s Error in get_unitizer.character("_helper") : 258s Argument `store.id` does not appear to refer to a unitizer directory 258s > try(get_unitizer("t-get.R")) 258s Error in get_unitizer.character("t-get.R") : 258s Argument `store.id` does not appear to refer to a unitizer directory 258s > try(set_unitizer(1)) 258s Error in set_unitizer.default(1) : 258s No method defined for object of class "numeric"; make sure that the specified `store.id` is a reference to a valid unitizer store and had defined `get_unitizer` and `set_unitizer` methods. 258s > try(set_unitizer(letters)) 258s Error in set_unitizer.character(letters) : 258s Argument `store.id` must be a 1 length character vector 258s > # 4.3 changed reporting of missing argument errors 258s > tryCatch(set_unitizer("a"), error=function(e) conditionMessage(e)) 258s [1] "argument \"unitizer\" is missing, with no default" 258s > try(set_unitizer("a", "blergh")) 258s Error in set_unitizer.character("a", "blergh") : 258s Argument `unitizer` must be a unitizer 258s > !file.exists("a") # TRUE 258s [1] TRUE 258s > try(suppressWarnings(set_unitizer("tests/# ;!./# \\/", toy.stor))) 258s Error in set_unitizer.character("tests/# ;!./# \\/", toy.stor) : 258s Could not create `store.id`; make sure it is a valid file name; see warning for details 258s > 258s > # - "Get works as expected" ---------------------------------------------------- 258s > 258s > tmp.dir <- tempfile() 258s > dir.create(tmp.dir) 258s > tmp.sub.dir <- paste0(tmp.dir, "/get.test.dir") 258s > tmp.fake.utz <- paste0(tmp.dir, "/fake.unitizer") 258s > 258s > # expect_false(get_unitizer("asldkfjskfa")) 258s > get_unitizer("asldkfjskfa") # FALSE 258s [1] FALSE 258s > all.equal(get_unitizer(toy.path), toy.stor) 258s [1] TRUE 258s > is(toy.stor, "unitizer") 258s [1] TRUE 258s > dir.create(tmp.fake.utz) 258s > fake.utz <- file.path(tmp.fake.utz, "data.rds") 258s > cat("# this is not an RDS\n", file = fake.utz) 258s > # expect_error(capture.output(get_unitizer(tmp.fake.utz), type = "message"), 258s > # "Failed loading unitizer") 258s > try(capture.output(get_unitizer(tmp.fake.utz), type = "message")) 258s Error in get_unitizer.character(tmp.fake.utz) : 258s Failed loading unitizer; see prior error messages for details 258s > 258s > tmp.sub.dir <- paste0(tmp.dir, "/get.test.dir") 258s > tmp.sub.dir2 <- paste0(tmp.dir, "/get.test.dir2") 258s > tmp.sub.dir3 <- paste0(tmp.dir, "/load.dirs") 258s > 258s > # - "Set works as expected" ---------------------------------------------------- 258s > 258s > dir.create(tmp.sub.dir) 258s > set_unitizer(tmp.sub.dir, toy.stor) 258s [1] TRUE 258s > all.equal(readRDS(paste0(tmp.sub.dir, "/data.rds")), toy.stor) 258s [1] TRUE 258s > just.a.file <- tempfile() 258s > on.exit(unlink(just.a.file)) 258s > cat("just a file\n", file = just.a.file) 258s > err <- capture.output(try(set_unitizer(just.a.file, toy.stor)), type='message') 258s > any(grepl('not a directory', err)) 258s [1] TRUE 258s > 258s > # - "load/store_unitizer" ------------------------------------------------------ 258s > 258s > # Several different stores in different states (i.e. requiring upgrade, 258s > # not unitizers, etc.) 258s > dir.create(tmp.sub.dir3) 258s > make.path <- lapply(file.path(tmp.sub.dir3, dir("_helper/ref-objs/load/")), 258s + dir.create) 258s > if (!all(unlist(make.path))) stop("Failed making paths") 258s > file.copy(list.files("_helper/ref-objs/load", full.names = TRUE), tmp.sub.dir3, 258s + recursive = TRUE) 258s [1] TRUE TRUE TRUE TRUE TRUE TRUE 258s > par.frame <- new.env() 258s > store.ids <- as.list(list.files(tmp.sub.dir3, full.names = TRUE)) 258s > 258s > # must be upgraded, but cannot 258s > load.try <- unitizer:::capture_output( 258s + try( 258s + unitizer:::load_unitizers(store.ids, rep(NA_character_, 258s + length(store.ids)), par.frame = par.frame, interactive.mode = FALSE, 258s + mode = "unitize", force.upgrade = FALSE, show.progress=0L, transcript=FALSE 258s + ) ) ) 258s > any(grepl('could not be loaded', load.try$message)) 258s [1] TRUE 258s > any(grepl('could not be upgraded', load.try$message)) 258s [1] TRUE 258s > any(grepl('Cannot proceed', load.try$message)) 258s [1] TRUE 258s > 258s > # handle failure in store_unitizer, we just try this on one of the store ids 258s > 258s > out <- unitizer:::capture_output( 258s + unitizer:::load_unitizers( 258s + store.ids[4], rep(NA_character_, length(store.ids))[4], 258s + par.frame = par.frame, interactive.mode = FALSE, mode = "unitize", 258s + force.upgrade = TRUE, show.progress=0L, transcript=FALSE 258s + ) 258s + ) 258s > any(grepl('Upgraded test file does not match original', out$message)) 258s [1] TRUE 258s > 258s > # try weird store ids 258s > out <- unitizer:::capture_output( 258s + invalid.store <- try( 258s + unitizer:::load_unitizers( 258s + list(structure("hello", class = "unitizer_error_store")), 258s + NA_character_, par.frame = par.frame, 258s + interactive.mode = FALSE, mode = "unitize", force.upgrade = FALSE, 258s + show.progress=0L, transcript=FALSE 258s + ) ) 258s + ) 258s > inherits(invalid.store, "try-error") 258s [1] TRUE 258s > any(grepl("returned something other than", out$message)) 258s [1] TRUE 258s > 258s > # Load mix of loadable and not loadable objects 258s > glob <- suppressWarnings(unitizer:::unitizerGlobal$new()) 258s > # with warning: "does not exist|test file does not") 258s > out <- unitizer:::capture_output( 258s + untzs <- try( 258s + unitizer:::load_unitizers( 258s + store.ids, rep(NA_character_, length(store.ids)), par.frame = par.frame, 258s + interactive.mode = FALSE, mode = "unitize", force.upgrade = TRUE, 258s + global = glob, show.progress=0L, transcript=FALSE 258s + ) ) ) 258s > inherits(untzs, "try-error") 258s [1] TRUE 258s > any(grepl('could not be loaded', out$message)) 258s [1] TRUE 258s > any(grepl('could not be upgraded', out$message)) 258s [1] TRUE 258s > any(grepl('Cannot proceed', out$message)) 258s [1] TRUE 258s > 258s > # Test failure of storage of a loaded and upgraded unitizers 258s > 258s > untzs <- unitizer:::load_unitizers( 258s + store.ids[4], NA_character_, par.frame = par.frame, 258s + interactive.mode = FALSE, mode = "unitize", force.upgrade = TRUE, 258s + global = glob, show.progress=0L, transcript=FALSE 258s + ) 258s Warning in addSlot(object, "cons", NULL) : 258s Slot `cons` does not exist in current version of `unitizer` so not added to object. 258s Warning in addSlot(object, "jump.to.test", 0L) : 258s Slot `jump.to.test` does not exist in current version of `unitizer` so not added to object. 258s Warning in unitizer:::load_unitizers(store.ids[4], NA_character_, par.frame = par.frame, : 258s Upgraded test file does not match original test file ('internals.R' vs 'NA'). 259s > mock(unitizer:::set_unitizer, quote(stop("set fail"))) 259s > try(unitizer:::store_unitizer(untzs[[1]])) 259s Error in set_unitizer(unitizer@id, unitizer) : set fail 259s Error in unitizer:::store_unitizer(untzs[[1]]) : 259s Error attempting to save unitizer, see previous messages. 259s > unmock(unitizer:::set_unitizer) 259s > 259s > # Try reloading already loaded unitisers 259s > reload <- unitizer:::as.list(untzs) 259s > # this creates a global object, hence warning 259s > untzs1a <- unitizer:::load_unitizers( 259s + reload, rep(NA_character_, length(reload)), par.frame = par.frame, 259s + interactive.mode = FALSE, mode = "unitize", force.upgrade = FALSE, 259s + show.progress=0L, transcript=FALSE 259s + ) 259s Warning in .Object$initialize(...) : 259s Instantiated global object without global namespace registry; you should only see this warning you are using `repair_environments`. 259s > all(vapply(unitizer:::as.list(untzs1a), is, logical(1L), "unitizer")) 259s [1] TRUE 259s > 259s > # misc tests 259s > # warning Instantiated global object without 259s > 259s > untzs2 <- unitizer:::load_unitizers( 259s + list(tmp.sub.dir2), NA_character_, par.frame, interactive.mode = FALSE, 259s + mode = "unitize", force.upgrade = FALSE, show.progress=0L, transcript=FALSE 259s + ) 259s Warning in .Object$initialize(...) : 259s Instantiated global object without global namespace registry; you should only see this warning you are using `repair_environments`. 259s > is(untzs2[[1L]], "unitizer") 259s [1] TRUE 259s > identical(parent.env(untzs2[[1L]]@zero.env), par.frame) 259s [1] TRUE 259s > 259s > # something that won't get reset on load so we can check our re-load 259s > untzs2[[1L]]@eval.time <- 33 259s > unitizer:::store_unitizer(untzs2[[1L]]) 259s | unitizer updated. 259s 259s > 259s > # warning Instantiated global object without 259s > untzs2.1 <- unitizer:::load_unitizers( 259s + list(tmp.sub.dir2), NA_character_, par.frame, interactive.mode = FALSE, 259s + mode = "unitize", force.upgrade = FALSE, show.progress=0L, transcript=FALSE 259s + ) 259s Warning in .Object$initialize(...) : 259s Instantiated global object without global namespace registry; you should only see this warning you are using `repair_environments`. 259s > untzs2.1[[1L]]@eval.time # 33 259s [1] 33 259s > unlink(c(tmp.sub.dir2, tmp.sub.dir3, tmp.sub.dir), recursive = TRUE) 259s > 259s > # - "is_package" --------------------------------------------------------------- 259s > 259s > unitizer:::is_package_dir(system.file(package = "stats")) 259s [1] TRUE 259s > unitizer:::is_package_dir(system.file(package = "methods")) 259s [1] TRUE 259s > 259s > ## Seems like some change now tests no longer installed by default with 259s > ## packages, at least in the unix distros, so can't easily test with 259s > ## has.tests==TRUE 259s > 259s > unitizer:::pretty_path(file.path(system.file(package = "stats"), 259s + "DESCRIPTION")) 259s [1] "package:stats/DESCRIPTION" 259s > old.wd <- getwd() 259s > setwd(system.file(package = "stats")) 259s > unitizer:::pretty_path(file.path(system.file(package = "stats"), "DESCRIPTION")) 259s [1] "DESCRIPTION" 259s > unitizer:::pretty_path(file.path(system.file(package = "stats"))) 259s [1] "." 259s > setwd(old.wd) 259s > 259s > # just picked some folder we know will not work (No Desc) 259s > unitizer:::is_package_dir(file.path(system.file(package = "stats"), "R")) 259s [1] "No DESCRIPTION file" 259s > unitizer:::is_package_dir("ASDFASDF") 259s [1] "not an existing directory" 259s > unitizer:::is_package_dir(file.path(system.file(package = "unitizer"), 259s + "expkg", "baddescription1")) 259s [1] "DESCRIPTION file did not have a package name entry" 259s > # *get_*package_dir 259s > pkg.f <- file.path(system.file(package = "unitizer"), "tests", 259s + "interactive", "run.R") 259s > length(unitizer:::get_package_dir(pkg.f)) == 1L 259s [1] TRUE 259s > length(unitizer:::get_package_dir(dirname(pkg.f))) == 1L 259s [1] TRUE 259s > f <- tempfile() 259s > cat("helloworld", file = f) 259s > length(unitizer:::get_package_dir(f)) == 0L 259s [1] TRUE 259s > unlink(f) 259s > 259s > # some more tests moved to t-demo.R to avoid reloading pkgs 259s > 259s > # - "is_unitizer_dir" ---------------------------------------------------------- 259s > 259s > base.dir <- file.path(system.file(package = "unitizer"), "expkg", "infer") 259s > unitizer:::is_unitizer_dir(base.dir) # FALSE 259s [1] FALSE 259s > unitizer:::is_unitizer_dir( 259s + file.path(base.dir, "tests", "unitizer", "infer.unitizer") 259s + ) 259s [1] TRUE 259s > # - "infer_unitizer_location" -------------------------------------------------- 259s > 259s > infer <- function(...) infer_unitizer_location(..., interactive.mode = FALSE) 259s > base.dir <- file.path(system.file(package = "unitizer"), "expkg", "infer") 259s > 259s > # Verify package is still in state we built tests on; need to sort b/c 259s > # different platforms have different lexical sorts 259s > identical( 259s + sort(c("aaa.R", "aaa.unitizer", "abc.R", "abc.unitizer", "inf.R", 259s + "inf.unitizer", "infer.R", "infer.unitizer", "zzz.R", "zzz.unitizer")), 259s + list.files(file.path(base.dir, "tests", "unitizer")) 259s + ) 259s [1] TRUE 259s > # Package dir 259s > unitizer:::capture_output(inf <- infer(base.dir)) 259s > basename(inf) 259s [1] "infer.R" 259s > unitizer:::capture_output(inf <- infer(base.dir, type = "d")) 259s > basename(inf) 259s [1] "unitizer" 259s > unitizer:::capture_output(inf <- infer(base.dir, type = "u")) 259s > basename(inf) 259s [1] "infer.unitizer" 259s > 259s > inf.dir <- infer(file.path(base.dir, "*")) # warn 259s Warning in infer_unitizer_location.character(..., interactive.mode = FALSE) : 259s 5 possible targets; too many to unambiguously infer desired file 259s > identical(file.path(base.dir, "*"), inf.dir) 259s [1] TRUE 259s > 259s > unitizer:::capture_output(inf <- infer(file.path(base.dir, "z"))) 259s > basename(inf) 259s [1] "zzz.R" 259s > unitizer:::capture_output(inf <- infer(file.path(base.dir, "z"), type = "u")) 259s > basename(inf) 259s [1] "zzz.unitizer" 259s > 259s > # Normal dir 259s > base.dir2 <- file.path(base.dir, "tests", "unitizer") 259s > # note don't need * to generate warning 259s > out <- unitizer:::capture_output(inf.dir2 <- infer(base.dir2)) # warn 259s > any(grepl("5 possible targets", out$message)) 259s [1] TRUE 259s > identical(base.dir2, inf.dir2) 259s [1] TRUE 259s > out <- unitizer:::capture_output(infer(file.path(base.dir2, "a"))) 259s > any(grepl("2 possible targets", out$message)) 259s [1] TRUE 259s > out <- unitizer:::capture_output(infer(file.path(base.dir2, "a"), type = "u")) 259s > any(grepl("2 possible targets", out$message)) 259s [1] TRUE 259s > out <- 259s + unitizer:::capture_output(fname <- basename(infer(file.path(base.dir2, "z")))) 259s > fname 259s [1] "zzz.R" 259s > any(grepl('Inferred test file location:', out)) 259s [1] TRUE 259s > out <- unitizer:::capture_output( 259s + fname <- basename(infer(file.path(base.dir2, "z"), type="u")) 259s + ) 259s > fname 259s [1] "zzz.unitizer" 259s > any(grepl('Inferred unitizer location:', out)) 259s [1] TRUE 259s > 259s > # Random file without setting working dir first, in order for this to work 259s > # non-interactivel we need it to work with the R CMD check dir structure, 259s > # and possibly with the covr dir structure 259s > if (interactive()) infer("tests2") 259s > 259s > # Interactive mode 259s > unitizer:::read_line_set_vals(c("26", "Q")) 259s > # warn/output 259s > select <- unitizer:::infer_unitizer_location( 259s + file.path(base.dir, "*"), type = "f", interactive.mode = TRUE 259s + ) 259s Possible matching files from "tests/unitizer": 259s 1: aaa.R 259s 2: abc.R 259s 3: inf.R 259s 4: infer.R 259s 5: zzz.R 259s unitizer> 26 259s | Type a number in `1:5` at the prompt 259s [1] 26 259s unitizer> Q 259s 259s No file selected 259s Warning in infer_unitizer_location.character(file.path(base.dir, "*"), type = "f", : 259s Invalid user selection 259s > identical(select, file.path(base.dir, "*")) 259s [1] TRUE 259s > 259s > unitizer:::read_line_set_vals(c("5")) 259s > # output 259s > sel.loc <- unitizer:::infer_unitizer_location(file.path(base.dir, 259s + "*"), type = "f", interactive.mode = TRUE) 259s Possible matching files from "tests/unitizer": 259s 1: aaa.R 259s 2: abc.R 259s 3: inf.R 259s 4: infer.R 259s 5: zzz.R 259s unitizer> 5 259s Selected file: zzz.R 259s > basename(sel.loc) 259s [1] "zzz.R" 259s > unitizer:::read_line_set_vals(NULL) 259s > 259s > # Non standard inferences 259s > # warn 259s > out <- unitizer:::capture_output( 259s + unitizer:::infer_unitizer_location(NULL, interactive = FALSE) 259s + ) 259s > any(grepl("too many to unambiguously", out$message)) 259s [1] TRUE 259s > 259s > fake.class <- structure(list(), class = "thisclassdoesn'texist") 259s > identical(infer(fake.class), fake.class) 259s [1] TRUE 259s > 259s > # no match since file can't exist (warn) 259s > f <- tempfile() 259s > out <- capture.output( 259s + invisible(unitizer:::infer_unitizer_location(f)), type='message' 259s + ) 259s > any(grepl("No possible matching files", out)) 259s [1] TRUE 259s > 259s > 259s > unlink(tmp.dir, recursive = TRUE) 259s > 259s > 259s PASS 259s Begin testing t-global.R 259s 259s R version 4.3.2 (2023-10-31) -- "Eye Holes" 259s Copyright (C) 2023 The R Foundation for Statistical Computing 259s Platform: aarch64-unknown-linux-gnu (64-bit) 259s 259s R is free software and comes with ABSOLUTELY NO WARRANTY. 259s You are welcome to redistribute it under certain conditions. 259s Type 'license()' or 'licence()' for distribution details. 259s 259s R is a collaborative project with many contributors. 259s Type 'contributors()' for more information and 259s 'citation()' on how to cite R or R packages in publications. 259s 259s Type 'demo()' for some demos, 'help()' for on-line help, or 259s 'help.start()' for an HTML browser interface to help. 259s Type 'q()' to quit R. 259s 259s > source(file.path("_helper", "init.R")) 259s > 259s > # Most tests involving global are scattered all over the place, just putting a 259s > # few extra ones that are very specifically about global here 259s > # 259s > # - "Singleton Implementation Working" ----------------------------------------- 259s > 259s > invisible(unitizer:::unitizerGlobal$new()) # warn 259s Warning in .Object$initialize(...) : 259s Instantiated global object without global namespace registry; you should only see this warning you are using `repair_environments`. 259s > glob.first <- unitizer:::unitizerGlobal$new(set.global = TRUE) 259s > try(unitizer:::unitizerGlobal$new(set.global = TRUE)) 259s Error in .Object$initialize(...) : 259s Internal Error: global tracking object already exists; this should never happen; contact maintainer 259s > try(unitizer:::unitizerGlobal$new()) 259s Error in .Object$initialize(...) : 259s Internal Error: global tracking object already exists; this should never happen; contact maintainer 259s > glob.first$release() 259s > 259s > # - "Dummy Display" ------------------------------------------------------------ 259s > 259s > show(new("unitizerDummy")) # not recorded 259s 259s > 259s > # - "Disable / Enable" --------------------------------------------------------- 259s > 259s > suppressWarnings(glob <- unitizer:::unitizerGlobal$new()) 259s > glob$disable() 259s An object of class "unitizerGlobalStatus" 259s Slot "search.path": 259s [1] 0 259s 259s Slot "options": 259s [1] 0 259s 259s Slot "working.directory": 259s [1] 0 259s 259s Slot "random.seed": 259s [1] 0 259s 259s Slot "namespaces": 259s [1] 0 259s 259s > glob$enable(c(search.path = 2L)) # warn state setting 259s Warning in glob$enable(c(search.path = 2L)) : 259s State setting for `search.path` has already been disabled and cannot be re-enabled 259s An object of class "unitizerGlobalStatus" 259s Slot "search.path": 259s [1] 0 259s 259s Slot "options": 259s [1] 0 259s 259s Slot "working.directory": 259s [1] 0 259s 259s Slot "random.seed": 259s [1] 0 259s 259s Slot "namespaces": 259s [1] 0 259s 259s > 259s > 259s PASS 259s Begin testing t-handledruns.R 259s 259s R version 4.3.2 (2023-10-31) -- "Eye Holes" 259s Copyright (C) 2023 The R Foundation for Statistical Computing 259s Platform: aarch64-unknown-linux-gnu (64-bit) 259s 259s R is free software and comes with ABSOLUTELY NO WARRANTY. 259s You are welcome to redistribute it under certain conditions. 259s Type 'license()' or 'licence()' for distribution details. 259s 259s R is a collaborative project with many contributors. 259s Type 'contributors()' for more information and 259s 'citation()' on how to cite R or R packages in publications. 259s 259s Type 'demo()' for some demos, 'help()' for on-line help, or 259s 'help.start()' for an HTML browser interface to help. 259s Type 'q()' to quit R. 259s 260s > source(file.path("_helper", "init.R")) 260s > 260s > # - "Ensure we get warning if we try to run in handlers" ----------------------- 260s > 260s > try(unitize("_helper/unitizers/trivial.R")) 260s 260s Warning in check_call_stack() : 260s It appears you are running unitizer inside an error handling function such as 260s `withCallingHanlders`, `tryCatch`, or `withRestarts`. This is strongly dis- 260s couraged as it may cause unpredictable behavior from unitizer in the event tests 260s produce conditions / errors. We strongly recommend you re-run your tests 260s outside of such handling functions. 260s Warning in history_capt(history, interactive.mode) : 260s Unable to capture history in non-interactive mode. 260s | 4/4 tests passed; nothing to review. 260s 260s > tryCatch(unitize("_helper/unitizers/trivial.R")) 260s 260s Warning in check_call_stack() : 260s It appears you are running unitizer inside an error handling function such as 260s `withCallingHanlders`, `tryCatch`, or `withRestarts`. This is strongly dis- 260s couraged as it may cause unpredictable behavior from unitizer in the event tests 260s produce conditions / errors. We strongly recommend you re-run your tests 260s outside of such handling functions. 261s Warning in history_capt(history, interactive.mode) : 261s Unable to capture history in non-interactive mode. 261s | 4/4 tests passed; nothing to review. 261s 261s > withRestarts(unitize("_helper/unitizers/trivial.R")) 261s 261s Warning in check_call_stack() : 261s It appears you are running unitizer inside an error handling function such as 261s `withCallingHanlders`, `tryCatch`, or `withRestarts`. This is strongly dis- 261s couraged as it may cause unpredictable behavior from unitizer in the event tests 261s produce conditions / errors. We strongly recommend you re-run your tests 261s outside of such handling functions. 261s Warning in history_capt(history, interactive.mode) : 261s Unable to capture history in non-interactive mode. 261s | 4/4 tests passed; nothing to review. 261s 261s > 261s > # need to figure out why running this without `try` in covr causes cover to 261s > # fail with 261s > # Error in aggregate.data.frame(mf[1L], mf[-1L], FUN = FUN, ...) : 261s > # no rows to aggregate 261s > 261s > # - "Ensure we get error if we try to do something stupid..." ------------------ 261s > 261s > try( 261s + withRestarts( 261s + unitize("_helper/unitizers/trivial.R"), 261s + unitizerInteractiveFail = function() NULL 261s + ) 261s + ) 261s 261s Warning in check_call_stack() : 261s It appears you are running unitizer inside an error handling function such as 261s `withCallingHanlders`, `tryCatch`, or `withRestarts`. This is strongly dis- 261s couraged as it may cause unpredictable behavior from unitizer in the event tests 261s produce conditions / errors. We strongly recommend you re-run your tests 261s outside of such handling functions. 261s Error in check_call_stack() : 261s "unitizerInteractiveFail" restart is already defined; unitizer relies on this 261s restart to manage evaluation so unitizer will not run if it is defined outside 261s of `unitize`. If you did not define this restart contact maintainer. 261s > 261s > 261s PASS 261s Begin testing t-ischecks.R 261s 261s R version 4.3.2 (2023-10-31) -- "Eye Holes" 261s Copyright (C) 2023 The R Foundation for Statistical Computing 261s Platform: aarch64-unknown-linux-gnu (64-bit) 261s 261s R is free software and comes with ABSOLUTELY NO WARRANTY. 261s You are welcome to redistribute it under certain conditions. 261s Type 'license()' or 'licence()' for distribution details. 261s 261s R is a collaborative project with many contributors. 261s Type 'contributors()' for more information and 261s 'citation()' on how to cite R or R packages in publications. 261s 261s Type 'demo()' for some demos, 'help()' for on-line help, or 261s 'help.start()' for an HTML browser interface to help. 261s Type 'q()' to quit R. 261s 261s > source(file.path("_helper", "init.R")) 261s > # - "int.pos" ------------------------------------------------------------------ 261s > 261s > unitizer:::is.int.pos.1L(c(1, 2, 3)) # FALSE 261s [1] FALSE 261s > unitizer:::is.int.pos.1L(1) 261s [1] TRUE 261s > unitizer:::is.int.pos.1L(1) 261s [1] TRUE 261s > unitizer:::is.int.pos.1L(-1) # FALSE 261s [1] FALSE 261s > unitizer:::is.int.pos.1L(NA_integer_) # FALSE 261s [1] FALSE 261s > unitizer:::is.int.pos.2L(1:2) 261s [1] TRUE 261s > unitizer:::is.int.pos.2L(c(1, 2)) 261s [1] TRUE 261s > 261s > # - "is.valid_two_arg" --------------------------------------------------------- 261s > 261s > f1 <- function(x, y) NULL 261s > f2 <- function(...) NULL 261s > f3 <- function(x, ...) NULL 261s > f4 <- function(x, y, z) NULL 261s > f5 <- function(x, y, z = 3) NULL 261s > f6 <- function(x) NULL 261s > unitizer:::is.two_arg_fun(f1) 261s [1] TRUE 261s > unitizer:::is.two_arg_fun(f2) 261s [1] TRUE 261s > unitizer:::is.two_arg_fun(f3) 261s [1] TRUE 261s > unitizer:::is.two_arg_fun(f4) 261s [1] "cannot have any non-optional arguments other than first two" 261s > unitizer:::is.two_arg_fun(f5) 261s [1] TRUE 261s > unitizer:::is.two_arg_fun(f6) 261s [1] "does not have at least two arguments" 261s > unitizer:::is.two_arg_fun(1) 261s [1] "is not a function" 261s > 261s > # - "is.valid_capt_setting" ---------------------------------------------------- 261s > 261s > capt.test <- unitizer:::is.valid_capt_setting(c(T, T)) 261s | value must be logical(2L) containing TRUE 261s | / FALSE and with names `c("output", "message") 261s 261s > capt.test 261s [1] FALSE 261s > 261s PASS 261s Begin testing t-item.R 261s 261s R version 4.3.2 (2023-10-31) -- "Eye Holes" 261s Copyright (C) 2023 The R Foundation for Statistical Computing 261s Platform: aarch64-unknown-linux-gnu (64-bit) 261s 261s R is free software and comes with ABSOLUTELY NO WARRANTY. 261s You are welcome to redistribute it under certain conditions. 261s Type 'license()' or 'licence()' for distribution details. 261s 261s R is a collaborative project with many contributors. 261s Type 'contributors()' for more information and 261s 'citation()' on how to cite R or R packages in publications. 261s 261s Type 'demo()' for some demos, 'help()' for on-line help, or 261s 'help.start()' for an HTML browser interface to help. 261s Type 'q()' to quit R. 261s 262s > source(file.path("_helper", "init.R")) 262s > source(file.path("aammrtf", "ref.R")); make_ref_obj_funs("item") 262s > 262s > options(unitizer.color = FALSE) 262s > 262s > # These tests are intended to cover all the functions/classes/methods in: 262s > # - item.R 262s > # - item.sub.R 262s > # - test_eval.R # indirectly 262s > # - heal.R 262s > # - unitizer.R 262s > # Basically everything that can be tested non-interactively 262s > # Helper funs 262s > 262s > callDep <- function(x) paste0(deparse(x@call, width.cutoff = 500), 262s + collapse = "") 262s > lsObjs <- function(x) paste0(x@ls$names, x@ls$status, collapse = ", ") 262s > lsStat <- function(x) x@ls$status 262s > lsInv <- function(x) isTRUE(attr(x@ls, "invalid")) 262s > # Get started 262s > 262s > new.exps <- expression( 262s + 1 + 1, 262s + a <- 54, # keep 262s + b <- 38, # keep 262s + a + b, 262s + e <- 5 * a, # keep 262s + a ^ 2, # Keep 262s + f <- e * a, 262s + matrix(rep(f, 20)) # keep 262s + ) 262s > ref.exps <- expression( 262s + 1 + 1, 262s + a <- 54, 262s + b <- 38, 262s + a + b, 262s + e <- 5 * a, 262s + e ^ 3 262s + ) 262s > 262s > Sys.sleep(0.2) 262s > my.unitizer <- new("unitizer", id = 1, zero.env = new.env()) 262s > # add ref.exps as new items 262s > coi(my.unitizer <- my.unitizer + ref.exps) 262s > my.unitizer2 <- new("unitizer", id = 2, zero.env = new.env()) 262s > # now convert them to reference items 262s > coi(my.unitizer2 <- my.unitizer2 + my.unitizer@items.new) 262s > # now test against new.exps 262s > coi(my.unitizer2 <- my.unitizer2 + new.exps) 262s > 262s > # - "item funs" ---------------------------------------------------------------- 262s > 262s > item <- my.unitizer@items.new[[1L]] 262s > unitizer:::itemType(item) 262s [1] "new" 262s > try(unitizer:::itemType(item) <- "asdfasd") 262s Error in unitizer:::`itemType<-`(`*tmp*`, value = "asdfasd") : 262s Argument `value` must be in c("new", "reference") 262s > unitizer:::itemType(item) <- "reference" 262s > unitizer:::itemType(item) 262s [1] "reference" 262s > try(unitizer:::itemsType(my.unitizer@items.new) <- as.character(1:1000)) 262s Error in unitizer:::`itemsType<-`(`*tmp*`, value = c("1", "2", "3", "4", : 262s Argument `value` must be length 1L or have same length as argument `x` 262s > try(item$booboo) 262s Error in .local(x, i, j, ...) : 262s Argument `name` must be in c("call", "state", "value", "conditions", "output", "message", "aborted") 262s > 262s > # - "unitizer creation worked as expected" ------------------------------------- 262s > 262s > validObject(my.unitizer, complete = TRUE) 262s [1] TRUE 262s > all.equal(capture.output(show(my.unitizer@items.new[[1L]])), rds(100)) 262s [1] TRUE 262s > identical(length(my.unitizer2), length(new.exps)) 262s [1] TRUE 262s > identical(length(my.unitizer2@items.new), length(new.exps)) 262s [1] TRUE 262s > identical(length(my.unitizer2@items.ref), length(ref.exps)) 262s [1] TRUE 262s > all.equal( 262s + as.expression( 262s + lapply(unitizer:::as.list(my.unitizer2@items.new), slot, "call") 262s + ), 262s + new.exps 262s + ) 262s [1] TRUE 262s > all.equal( 262s + as.expression( 262s + lapply(unitizer:::as.list(my.unitizer2@items.ref), slot, "call") 262s + ), 262s + ref.exps 262s + ) 262s [1] TRUE 262s > vals <- lapply( 262s + unitizer:::as.list(my.unitizer2@items.new), function(x) x@data@value[[1L]] 262s + ) 262s > vals.ign <- unitizer:::ignored(my.unitizer2@items.new) 262s > all.equal(vals[!vals.ign], lapply(new.exps, eval)[!vals.ign]) 262s [1] TRUE 262s > all(vapply(vals[vals.ign], is, logical(1L), "unitizerDummy")) 262s [1] TRUE 262s > 262s > vals <- lapply( 262s + unitizer:::as.list(my.unitizer2@items.ref), function(x) x@data@value[[1L]] 262s + ) 262s > vals.ign <- unitizer:::ignored(my.unitizer2@items.ref) 262s > all.equal(vals[!vals.ign], lapply(ref.exps, eval)[!vals.ign]) 262s [1] TRUE 262s > all(vapply(vals[vals.ign], is, logical(1L), "unitizerDummy")) 262s [1] TRUE 262s > my.unitizer2@items.new.map 262s [1] 1 2 3 4 5 NA NA NA 262s > my.unitizer2@items.ref.map 262s [1] 1 2 3 4 5 NA 262s > my.unitizer2@tests.fail 262s [1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE 262s > my.unitizer2@tests.status 262s [1] Pass Pass Pass Pass Pass New New New 262s Levels: Pass Fail New Deleted Error 262s > my.unitizer2@section.map 262s [1] 1 1 1 1 1 1 1 1 262s > unitizer:::ignored(my.unitizer2@items.new) 262s [1] FALSE TRUE TRUE FALSE TRUE FALSE TRUE FALSE 262s > unitizer:::ignored(my.unitizer2@items.ref) 262s [1] FALSE TRUE TRUE FALSE TRUE FALSE 262s > 262s > # - "Size Measurement works" --------------------------------------------------- 262s > 262s > # Used to produce warnings because the same base.env was used for every 262s > # unitizer because it was created on package load as part of the S4 class 262s > # definition instead of in "initialize", so any time we instantiated more 262s > # than one object they all shared the same environment, causing issues with 262s > # saveRDS 262s > x <- unitizer:::sizeUntz(my.unitizer2) 262s > is.matrix(x) && is.numeric(x) 262s [1] TRUE 262s > colnames(x) 262s [1] "size" "rds" 262s > 262s > # - "Environment healing works" ------------------------------------------------ 262s > 262s > items.mixed <- my.unitizer2@items.new[4:5] + my.unitizer2@items.ref[[1]] + 262s + my.unitizer2@items.new[c(2, 6, 8)] 262s > items.sorted <- unitizer:::healEnvs(items.mixed, my.unitizer2) 262s > env.anc <- lapply(unitizer:::as.list(items.sorted), function(x) rev(unitizer:::env_ancestry(x@env, 262s + my.unitizer2@base.env))) 262s > max.len <- max(vapply(env.anc, length, 1L)) 262s > env.anc.2 <- lapply(env.anc, function(x) { 262s + length(x) <- max.len 262s + x 262s + }) 262s > env.anc.df <- as.data.frame(env.anc.2, stringsAsFactors = FALSE) 262s > # Here only the first item is reference, all others 262s > length(unique(unlist(env.anc.df[2, ]))) 262s [1] 1 262s > all( 262s + apply( 262s + env.anc.df[-(1:2), -1], 1, 262s + function(x) length(unique(Filter(Negate(is.na), x))) 262s + ) == 1L 262s + ) 262s [1] TRUE 262s > # First item is reference, all others are new 262s > unitizer:::itemsType(items.sorted) 262s [1] "reference" "new" "new" "new" "new" "new" 262s [7] "new" "new" 262s > # Expected order of ids 262s > vapply(unitizer:::as.list(items.sorted), function(x) x@id, integer(1L)) 262s [1] 1 2 3 4 5 6 7 8 262s > lapply(unitizer:::as.list(items.sorted), function(x) x@ls$names) 262s [[1]] 262s character(0) 262s 262s [[2]] 262s character(0) 262s 262s [[3]] 262s character(0) 262s 262s [[4]] 262s [1] "a" "b" 262s 262s [[5]] 262s character(0) 262s 262s [[6]] 262s [1] "a" "b" "e" 262s 262s [[7]] 262s character(0) 262s 262s [[8]] 262s [1] "a" "b" "e" "f" 262s 262s > unique(unlist(lapply(unitizer:::as.list(items.sorted), function(x) x@ls$status))) 262s [1] "" 262s > # Tests with conditions 262s > 262s > # - "Items with conditions" ---------------------------------------------------- 262s > 262s > my_fun <- function() { 262s + warning("hello") 262s + 25 262s + } 262s > ref.exps1a <- expression(stop("boom"), my_fun()) 262s > my.unitizer1a <- new("unitizer", id = 100, zero.env = new.env()) 262s > # add ref.exps as new items 262s > coi(my.unitizer1a <- my.unitizer1a + ref.exps1a) 262s > 262s > all.equal(capture.output(show(my.unitizer1a@items.new[[1L]])), rds(200)) 262s [1] TRUE 262s > all.equal(capture.output(show(my.unitizer1a@items.new[[2L]])), rds(300)) 262s [1] TRUE 262s > all.equal( 262s + capture.output(show(my.unitizer1a@items.new[[1L]]@data@conditions)), rds(400) 262s + ) 262s [1] TRUE 262s > # - "Environment healing works 2" ---------------------------------------------- 262s > 262s > # Stars highlight items we are selecting, but keep in mind that unitizer only 262s > # cares about non ignored tests, and that the selection status of ignored test 262s > # has nothing to do with what we end up with wrt to ignored tests 262s > 262s > new.exps2 <- expression( 262s + 1 + 1, # 1 * 262s + a <- 54, # 2 262s + b <- runif(5), # 3 262s + howdy <- "yowser", # 4 * 262s + a + b, # 5 * 262s + e <- 5 * a, # 6 262s + a ^ 2, # 7 262s + f <- e * a, # 8 262s + matrix(rep(f, 20)) # 9 * 262s + ) 262s > ref.exps2 <- expression( 262s + 1 + 1, # 1 262s + a <- 54, # 2 262s + b <- runif(5), # 3 * 262s + 25 + 3, # 4 262s + q <- b ^ 2 / a, # 5 * 262s + a + b, # 6 262s + z <- w <- list(1, 2, 3), # 7 262s + Reduce(`+`, z), # 8 * Doesn't exist, should connect back to `a + b` 262s + e <- 5 * a, # 9 262s + e ^ 3, # 10 * 262s + e * a # 11 * 262s + ) 262s > 262s > # Note that healEnvs modifies objects that contain environments, and as such 262s > # you won't get the same result if you run this function twice, so don't be 262s > # surprised if tests fail in those circumstances 262s > my.unitizer3 <- new("unitizer", id = 1, zero.env = new.env()) 262s > # add ref.exps as new items 262s > coi(my.unitizer3 <- my.unitizer3 + ref.exps2) 263s > my.unitizer4 <- new("unitizer", id = 2, zero.env = new.env()) 263s > # now convert them to reference items 263s > coi(my.unitizer4 <- my.unitizer4 + my.unitizer3@items.new) 263s > # now test against new.exps 263s > coi(my.unitizer4 <- my.unitizer4 + new.exps2) 263s > coi( 263s + items.mixed2 <- my.unitizer4@items.ref[c(8, 10, 3, 5, 11)] + 263s + my.unitizer4@items.new[c(1, 4, 5, 9)] 263s + ) 263s > items.sorted2 <- unitizer:::healEnvs(items.mixed2, my.unitizer4) 263s > 263s > env.anc <- lapply(unitizer:::as.list(items.sorted2), function(x) rev(unitizer:::env_ancestry(x@env, 263s + my.unitizer4@base.env))) 263s > max.len <- max(vapply(env.anc, length, 1L)) 263s > env.anc.2 <- lapply(env.anc, function(x) { 263s + length(x) <- max.len 263s + x 263s + }) 263s > # oldest ancestor the same 263s > env.anc.df <- as.data.frame(env.anc.2, stringsAsFactors = FALSE) 263s > length(unique(unname(unlist(env.anc.df[1, ])))) # 1 263s [1] 1 263s > # "base.env should be unitizer env") 263s > identical( 263s + env.anc.df[1, 1], unitizer:::env_name(my.unitizer4@base.env) 263s + ) 263s [1] TRUE 263s > # "all tests should also have another sub base.env") 263s > length(unique(unlist(env.anc.df[2, ]))) == 1L 263s [1] TRUE 263s > # "and it should be the items.ref here") 263s > identical( 263s + env.anc.df[2, 1], unitizer:::env_name(my.unitizer4@items.ref@base.env) 263s + ) 263s [1] TRUE 263s > items <- items.sorted2 263s > items.lst <- unitizer:::as.list(items) 263s > # "new items should all have normal status", 263s > heal.info <- cbind( 263s + type = unitizer:::itemsType(items), ignored = unitizer:::ignored(items), 263s + id = vapply(items.lst, slot, 1L, "id"), 263s + call = vapply(items.lst, callDep, ""), 263s + ls = vapply(items.lst, lsObjs, ""), 263s + ls.invalid = vapply(items.lst, lsInv, TRUE) 263s + ) 263s > # "" 263s > unique(unlist(lapply(items.lst[unitizer:::itemsType(items) == "new"], lsStat))) 263s [1] "" 263s > # "Reference tests should have no ls data", 263s > unique(vapply(items.lst[unitizer:::ignored(items)], lsObjs, "")) 263s [1] "" 263s > all(vapply(items.lst[unitizer:::ignored(items)], lsInv, logical(1L))) 263s [1] TRUE 263s > 263s > # - "ls works" ----------------------------------------------------------------- 263s > 263s > my.unitizer5 <- new("unitizer", id = 2, zero.env = new.env()) 263s > # now add back our composite elements as references 263s > coi(my.unitizer5 <- my.unitizer5 + items.sorted2) 263s > # and new items 263s > coi(my.unitizer5 <- my.unitizer5 + new.exps2) 263s > 263s > # This is an ignored test, so there will be some problems 263s > env.val <- new.env(parent = my.unitizer5@items.new[[3]]@env) 263s > env.eval <- new.env(parent = env.val) 263s > assign(".NEW", my.unitizer5@items.new[[3]], env.val) 263s > assign(".new", my.unitizer5@items.new[[3]]@data@value[[1L]], 263s + env.val) 263s > assign(".REF", my.unitizer5@items.ref[[my.unitizer5@items.new.map[[3]]]], 263s + env.val) 263s > assign(".ref", my.unitizer5@items.ref[[my.unitizer5@items.new.map[[3]]]]@data@value[[1L]], 263s + env.val) 263s > ls.res <- evalq(unitizer:::unitizer_ls(), env.eval) # warn 263s Warning in unitizer:::unitizer_ls() : 263s The ls output for `.ref` is invalid. This may be because you had corrupted environment chains that had to be repaired. Re-generating the `unitizer` with `unitize(..., force.update=TRUE)` should fix the problem. If it persists, please contact maintainer. 263s > # Reference tests won't show up since they were nuked by `healEnvs` 263s > all.equal(ls.res, rds(500)) 263s [1] TRUE 263s > # These are normal tests so should work 263s > env.val <- new.env(parent = my.unitizer5@items.new[[9]]@env) 263s > env.eval <- new.env(parent = env.val) 263s > assign(".NEW", my.unitizer5@items.new[[9]], env.val) 263s > assign(".new", my.unitizer5@items.new[[9]]@data@value[[1L]], 263s + env.val) 263s > assign(".REF", my.unitizer5@items.ref[[my.unitizer5@items.new.map[[9]]]], 263s + env.val) 263s > assign(".ref", my.unitizer5@items.ref[[my.unitizer5@items.new.map[[9]]]]@data@value[[1L]], 263s + env.val) 263s > all.equal(evalq(unitizer:::unitizer_ls(), env.eval), 263s + rds(600)) 263s [1] TRUE 263s > all.equal(capture.output(print(evalq(unitizer:::unitizer_ls(), 263s + env.eval))), rds(700)) 263s [1] TRUE 263s > 263s > # - "Environment Healing Works #3" --------------------------------------------- 263s > # 263s > # Main difference to previous versions is that we're testing that moving the 263s > # order of tests around between ref and new still works 263s > # 263s > # Test that reference tests moving around doesn't cause major issues 263s > 263s > new.exps6 <- expression( 263s + 1 + 1, # 1 * 263s + a <- 54, # 2 263s + b <- runif(5), # 3 263s + howdy <- "yowser", # 4 263s + a + b, # 5 263s + e <- 5 * a, # 6 263s + a ^ 2, # 7 * 263s + f <- 25, # 8 * 263s + matrix(rep(f, 20)) # 9 263s + ) 263s > ref.exps6 <- expression( 263s + 1 + 1, # 1 263s + a <- 54, # 2 263s + f <- 25, # 3 263s + matrix(rep(f, 20)), # 4 * 263s + b <- runif(5), # 5 263s + boomboom <- "boo", # 6 263s + a + b, # 7 * 263s + a + b + f, # 8 263s + e <- 5 * a, # 9 263s + a ^ 2 # 10 263s + ) 263s > my.unitizer10 <- new("unitizer", id = 1, zero.env = new.env()) 263s > # add ref.exps as new items 263s > coi(my.unitizer10 <- my.unitizer10 + ref.exps6) 263s > my.unitizer11 <- new("unitizer", id = 2, zero.env = new.env()) 263s > # now convert them to reference items 263s > coi(my.unitizer11 <- my.unitizer11 + my.unitizer10@items.new) 263s > # now test against new.exps 263s > coi(my.unitizer11 <- my.unitizer11 + new.exps6) 263s > items.mixed3 <- my.unitizer11@items.ref[c(4, 7)] + 263s + my.unitizer11@items.new[c(1, 7, 8)] 263s > items.sorted3 <- unitizer:::healEnvs(items.mixed3, my.unitizer11) 263s > 263s > # Both reference tests get appended to item #1, which means among other things 263s > # that for the second refernce test, the `a` object is absent (but `b` is 263s > # present because it gets sucked in by virtue of being an ignored test just 263s > # ahead of it) 263s > items <- items.sorted3 263s > items.lst <- unitizer:::as.list(items) 263s > cbind( 263s + type = unitizer:::itemsType(items), ignored = unitizer:::ignored(items), 263s + id = vapply(items.lst, slot, 1L, "id"), 263s + call = vapply(items.lst, callDep, ""), 263s + ls = vapply(items.lst, lsObjs, ""), 263s + ls.invalid = vapply(items.lst, lsInv, TRUE) 263s + ) 263s type ignored id call ls 263s [1,] "new" "FALSE" "1" "1 + 1" "" 263s [2,] "reference" "TRUE" "2" "a <- 54" "" 263s [3,] "reference" "TRUE" "3" "f <- 25" "" 263s [4,] "reference" "FALSE" "4" "matrix(rep(f, 20))" "a, f" 263s [5,] "reference" "TRUE" "5" "b <- runif(5)" "" 263s [6,] "reference" "TRUE" "6" "boomboom <- \"boo\"" "" 263s [7,] "reference" "FALSE" "7" "a + b" "a*, b, boomboom, f*" 263s [8,] "new" "TRUE" "6" "e <- 5 * a" "" 263s [9,] "new" "FALSE" "7" "a^2" "a, b, e, howdy" 263s ls.invalid 263s [1,] "FALSE" 263s [2,] "TRUE" 263s [3,] "TRUE" 263s [4,] "FALSE" 263s [5,] "TRUE" 263s [6,] "TRUE" 263s [7,] "FALSE" 263s [8,] "TRUE" 263s [9,] "FALSE" 263s > # - "No circular environment references" --------------------------------------- 263s > 263s > # This is to test for issue #2, which resulted in a self referential environment 263s > # in the stored items. The following code used to fail: 263s > new.exps3 <- expression(1 + 1, a <- 54, b <- 5, 2 + 2, runif(1)) 263s > ref.exps3 <- expression(1 + 1, a <- 54, 2 + 2, runif(1)) 263s > my.unitizer6 <- new("unitizer", id = 1, zero.env = new.env()) 263s > # add ref.exps as new items 263s > coi(my.unitizer6 <- my.unitizer6 + ref.exps3) 263s > my.unitizer7 <- new("unitizer", id = 2, zero.env = new.env()) 263s > # now convert them to reference items 263s > coi(my.unitizer7 <- my.unitizer7 + my.unitizer6@items.new) 263s > # now test against new.exps 263s > coi(my.unitizer7 <- my.unitizer7 + new.exps3) 263s > # Note this doesn't test that there are no circular references, only that what 263s > # used to fail no longer fails. 263s > 263s > cbind(my.unitizer7@tests.new, my.unitizer7@tests.result) 263s value conditions output message aborted 263s [1,] FALSE TRUE TRUE TRUE TRUE TRUE 263s [2,] FALSE TRUE TRUE TRUE TRUE TRUE 263s [3,] TRUE FALSE FALSE FALSE FALSE FALSE 263s [4,] FALSE TRUE TRUE TRUE TRUE TRUE 263s [5,] FALSE FALSE TRUE TRUE TRUE TRUE 263s > 263s > # - "testFuns" ----------------------------------------------------------------- 263s > 263s > # Error objects 263s > 263s > # these two should just work fine 263s > is(new("testFuns", output = all.equal, value = function(x, y) TRUE), "testFuns") 263s [1] TRUE 263s > is(new("testFuns"), "testFuns") 263s [1] TRUE 263s > try(new("testFuns", output = all.equal, value = function(x, y, z) TRUE)) 263s Error in validObject(.Object) : 263s invalid class "unitizerItemTestFun" object: Slot `@fun` must be a function with the first two parameters non-optional and all others optional (cannot have any non-optional arguments other than first two). 263s > # this should work too now, since technically has two args 263s > is( 263s + new("testFuns", output = all.equal, value = function(x, y = 1, z = 1) TRUE), 263s + "testFuns" 263s + ) 263s [1] TRUE 263s > try(new("testFuns", cabbage = all.equal)) 263s Error in initialize(value, ...) : 263s Can't initialize invalid slots "cabbage" 263s > 263s > # - "Misc" --------------------------------------------------------------------- 263s > 263s > new.exps4 <- expression(a <- function() b(), b <- function() TRUE, a()) 263s > my.unitizer8 <- new("unitizer", id = 3, zero.env = new.env()) 263s > new.exps5 <- expression(a <- function() b(), NULL, b <- function() TRUE, a()) 263s > my.unitizer9 <- new("unitizer", id = 4, zero.env = new.env()) 263s > coi(x <- my.unitizer9 + new.exps5) 263s > 263s > local({ 263s + fun <- function() quote(stop("This error should not be thrown")) 263s + is( 263s + new( 263s + "unitizerItem", value = fun(), call = quote(fun()), 263s + env = sys.frame(sys.parent() + 1L) 263s + ), 263s + "unitizerItem" 263s + ) 263s + }) 263s [1] TRUE 263s > # Nested environment hand waving can break down under certain circumstances 263s > # this first one should work because there are no tests until after all 263s > # the pieces necessary to run `a()` are defined: 263s > coi(res <- my.unitizer8 + new.exps4) 263s > is(res, "unitizer") 263s [1] TRUE 263s > # this should break because the NULL forces `b` to be stored in a different 263s > # environment to `a`; note: funky error message matching because in 263s > # at least some versions of rdevel reported fun name seems to change 263s > # (possibly related to level 3 bytecode) 263s > # could not find fun 263s > x@items.new[[4]]@data@message[[1]] 263s [1] "Error in b() : could not find function \"b\"\n" 263s > 263s > # - "Comparison Function Errors" ----------------------------------------------- 263s > 263s > exps <- expression(fun <- function(x, y) warning("not gonna work"), 263s + unitizer_sect(compare = fun, expr = { 263s + 1 + 1 263s + })) 263s > my.unitizer <- new("unitizer", id = 25, zero.env = new.env()) 263s > # add ref.exps as new items 263s > coi(my.unitizer <- my.unitizer + exps) 263s > coi(my.unitizer2 <- new("unitizer", id = 26, zero.env = new.env()) + 263s + my.unitizer@items.new) 263s > # warn: not gonna work 263s > coi(my.unitizer2 <- my.unitizer2 + exps) 263s Warning in close_and_clear(e1@global$cons) : 263s Test comparison functions appear to have produced output, which should not happen (see `?unitizer_sect` for more details). If you did not provide custom testing functions, contact maintainer. First 50 lines follow: 263s Warning in fun(2, 2) : not gonna work 263s 263s > as.character(my.unitizer2@tests.status) 263s [1] "Pass" "Error" 263s > my.unitizer2@tests.errorDetails[[2]]@value@value 263s [1] "comparison function `fun` signaled a condition of class `c(\"simpleWarning\", \"warning\", \"condition\")`, with message \"not gonna work\" and call `fun(2, 2)`." 263s > 263s > # - "Language Objects Tested Properly" ----------------------------------------- 263s > 263s > exps <- expression(quote(x), quote(x + y), quote(identity(x)), 263s + expression(1 + y), quote(expression(1 + y))) 263s > my.unitizer <- new("unitizer", id = 27, zero.env = new.env()) 263s > # add ref.exps as new items 263s > coi(my.unitizer <- my.unitizer + exps) 263s > coi(my.unitizer2 <- new("unitizer", id = 28, zero.env = new.env()) + 263s + my.unitizer@items.new) 263s > coi(my.unitizer2 <- my.unitizer2 + exps) 263s > # This used to error b/c expressions returning unevaluated calls/symbols were 263s > # not compared as such (they were evaluated) 263s > as.character(my.unitizer2@tests.status) 263s [1] "Pass" "Pass" "Pass" "Pass" "Pass" 263s > 263s > # - "Test Fun Captured Properly" ----------------------------------------------- 263s > 263s > new("unitizerItemTestFun", fun = identical)@fun.name 263s [1] "identical" 263s > 263s > 263s PASS 263s Begin testing t-list.R 263s 263s R version 4.3.2 (2023-10-31) -- "Eye Holes" 263s Copyright (C) 2023 The R Foundation for Statistical Computing 263s Platform: aarch64-unknown-linux-gnu (64-bit) 263s 263s R is free software and comes with ABSOLUTELY NO WARRANTY. 263s You are welcome to redistribute it under certain conditions. 263s Type 'license()' or 'licence()' for distribution details. 263s 263s R is a collaborative project with many contributors. 263s Type 'contributors()' for more information and 263s 'citation()' on how to cite R or R packages in publications. 263s 263s Type 'demo()' for some demos, 'help()' for on-line help, or 263s 'help.start()' for an HTML browser interface to help. 263s Type 'q()' to quit R. 263s 263s > source(file.path("_helper", "init.R")) 263s > 263s > lst <- new("unitizerList") 263s > 263s > # - "unitizerList basic tests" ------------------------------------------------- 263s > 263s > length(lst) == 0L 263s [1] TRUE 263s > is(lst <- unitizer:::append(lst, 5), "unitizerList") 263s [1] TRUE 263s > length(lst) == 1L 263s [1] TRUE 263s > is( 263s + lst <- unitizer:::append( 263s + lst, list("booyah", list(1:3), matrix(1:9, nrow = 3)) 263s + ), "unitizerList" 263s + ) 263s [1] TRUE 263s > length(lst) == 4L 263s [1] TRUE 263s > is(lst[3L], "unitizerList") 263s [1] TRUE 263s > is(lst[[3L]], "list") 263s [1] TRUE 263s > lst <- unitizer:::append(lst, list(data.frame(a = letters[1:3])), 2L) 263s > is(lst[[3L]], "data.frame") 263s [1] TRUE 263s > length(lst[1:4]) == 4L 263s [1] TRUE 263s > lst[[4L]] <- "boo" 263s > is(lst[[4L]], "character") 263s [1] TRUE 263s > lst[4L:5L] <- letters[1:2] 263s > 263s > c(lst[[4L]], lst[[5L]]) 263s [1] "a" "b" 263s > lst[[4L]] 263s [1] "a" 263s > 263s > is(unitizer:::as.list(lst), "list") 263s [1] TRUE 263s > length(unitizer:::as.list(lst)) == 5L 263s [1] TRUE 263s > is(unitizer:::as.expression(lst), "expression") 263s [1] TRUE 263s > 263s > try(unitizer:::getItem(lst)) # error 263s Error in .local(x, ...) : 263s Internal pointer for `x` not initialized; initialize with `nextItem` 263s > lst <- unitizer:::nextItem(lst) 263s > unitizer:::getItem(lst) 263s [1] 5 263s > lst <- unitizer:::nextItem(lst) 263s > unitizer:::getItem(lst) 263s [1] "booyah" 263s > lst <- unitizer:::prevItem(lst) 263s > unitizer:::getItem(lst) 263s [1] 5 263s > lst <<- lst # leftover from testthat testing? 263s > 263s > # - "unitizerList pointer seeking" --------------------------------------------- 263s > 263s > for (i in 1:10) lst <- unitizer:::nextItem(lst) 263s > try(unitizer:::getItem(lst)) 263s Error in .local(x, ...) : Internal pointer for `x` is corrupted 263s > unitizer:::done(lst) 263s [1] TRUE 263s > is(lst <- unitizer:::reset(lst, "back"), "unitizerList") 263s [1] TRUE 263s > try(unitizer:::reset(lst, letters)) 263s Error in .local(x, ...) : 263s Argument `position` must be `NULL`, or "front" or "back" 263s > try(unitizer:::reset(lst, NA_character_)) 263s Error in .local(x, ...) : 263s Argument `position` must be `NULL`, or "front" or "back" 263s > try(unitizer:::getItem(lst)) 263s Error in .local(x, ...) : 263s Internal pointer for `x` not initialized; initialize with `prevItem` 263s > lst <- unitizer:::prevItem(lst) 263s > unitizer:::getItem(lst) == "b" 263s [1] TRUE 263s > while (!unitizer:::done(lst)) { 263s + item <- unitizer:::getItem(lst) 263s + lst <- unitizer:::prevItem(lst) 263s + } 263s > item == 5L 263s [1] TRUE 263s > try(unitizer:::getItem(lst)) 263s Error in .local(x, ...) : 263s Internal pointer for `x` outside of range for `x`; test for this condition with `done`, or reset with `reset` 263s > withCallingHandlers( 263s + lst[[4]] <- "new value", 263s + warning = function() stop("A Warning!") 263s + ) 263s > 263s > for (i in 1:5) lst <- unitizer:::nextItem(lst) 263s > lst@.pointer 263s [1] 5 263s > 263s > # - "unitizerList value replacement and pointer adjustments" ------------------- 263s > 263s > lst[[4]] <- NULL 263s > lst@.pointer 263s [1] 4 263s > unitizer:::reset(lst, "back") 263s An object of class "unitizerList" 263s Slot ".items": 263s [[1]] 263s [1] 5 263s 263s [[2]] 263s [1] "booyah" 263s 263s [[3]] 263s a 263s 1 a 263s 2 b 263s 3 c 263s 263s [[4]] 263s [1] "b" 263s 263s 263s Slot ".pointer": 263s [1] 5 263s 263s Slot ".seek.fwd": 263s [1] FALSE 263s 263s > lst.len <- length(lst) 263s > identical(lst@.pointer, lst.len) 263s [1] TRUE 263s > lst[2:3] <- letters[1:2] 263s > identical(lst@.pointer, lst.len) 263s [1] TRUE 263s > lst[2:3] <- list(NULL, NULL) 263s > identical(lst@.pointer, lst.len) 263s [1] TRUE 263s > lst[2:3] <- NULL 263s > identical(lst@.pointer, lst.len - 2L) 263s [1] TRUE 263s > 263s > lst <- unitizer:::reset(lst, "front") 263s > for (i in 1:2) lst <- unitizer:::nextItem(lst) 263s > curr.point <- lst@.pointer 263s > lst[[3]] <- NULL 263s > identical(curr.point, lst@.pointer) 263s [1] TRUE 263s > lst <- unitizer:::append(lst, list(5, 6, "blaskdjf"), 1L) 263s > identical(curr.point + 3L, lst@.pointer) 263s [1] TRUE 263s > lst <- unitizer:::append(lst, list(matrix(1:9, nrow = 3)), 5L) 263s > identical(curr.point + 3L, lst@.pointer) 263s [1] TRUE 263s > 263s > # - "Append Factors Works" ----------------------------------------------------- 263s > 263s > vec <- factor(letters[1:3], levels = letters) 263s > vec2 <- factor(letters[10:15], levels = letters) 263s > 263s > all.equal(structure(c(1L, 2L, 3L, 10L, 11L, 12L, 13L, 14L, 263s + 15L), .Label = c("a", "b", "c", "d", "e", "f", "g", "h", 263s + "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", 263s + "u", "v", "w", "x", "y", "z"), class = "factor"), append(vec, 263s + vec2)) 263s [1] TRUE 263s > all.equal(structure(c(1L, 2L, 10L, 11L, 12L, 13L, 14L, 15L, 263s + 3L), .Label = c("a", "b", "c", "d", "e", "f", "g", "h", "i", 263s + "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", 263s + "v", "w", "x", "y", "z"), class = "factor"), append(vec, 263s + vec2, 2)) 263s [1] TRUE 263s > 263s > all.equal(structure(c(10L, 11L, 12L, 13L, 1L, 2L, 3L, 14L, 263s + 15L), .Label = c("a", "b", "c", "d", "e", "f", "g", "h", 263s + "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", 263s + "u", "v", "w", "x", "y", "z"), class = "factor"), append(vec2, 263s + vec, 4)) 263s [1] TRUE 263s > try(append(vec2, vec, 20)) 263s Error in append(vec2, vec, 20) : 263s Argument after must be integer like between 0 and length(x) 263s > try(append(vec2, vec, -5)) 263s Error in append(vec2, vec, -5) : 263s Argument after must be integer like between 0 and length(x) 263s > 263s > # - "List coersion works even inside apply functions" -------------------------- 263s > 263s > ulist <- new("unitizerList", .items = list("a", 1, 2, "b")) 263s > identical(lapply(ulist, identity), ulist@.items) 263s [1] TRUE 263s > 263s > # - "Errors" ------------------------------------------------------------------- 263s > 263s > setClass("uhtsdfoqiuerhzb", slots = c(a = "integer")) 263s > dummy <- new("uhtsdfoqiuerhzb", a = 1L) 263s > lst2 <- new("unitizerList", .items = list(1, 2, 3)) 263s > try(append(lst2, 5, after = -1)) 264s Error in append(lst2, 5, after = -1) : 264s Argument `after` must be a length 1 numeric greater than zero 264s > try(append(lst2, dummy)) 264s Error in as.list.default(values) : 264s no method for coercing this S4 class to a vector 264s Error in append(lst2, dummy) : 264s Unable to coerce argument `values` to appropriate type; see previous errors for details. 264s > 264s > lst3 <- new("unitizerList", .items = expression(1, 2, 3)) 264s > try(append(lst3, dummy)) 264s Error in as.expression.default(values) : 264s no method for coercing this S4 class to a vector 264s Error in append(lst3, dummy) : 264s Unable to coerce argument `values` to appropriate type; see previous errors for details. 264s > 264s > # - "Set Names" ---------------------------------------------------------------- 264s > 264s > nlst <- new("unitizerList", .items = list(a = "a", b = "b")) 264s > names(nlst) <- toupper(names(nlst)) 264s > as.list(nlst) 264s $A 264s [1] "a" 264s 264s $B 264s [1] "b" 264s 264s > 264s > 264s PASS 264s Begin testing t-misc.R 264s 264s R version 4.3.2 (2023-10-31) -- "Eye Holes" 264s Copyright (C) 2023 The R Foundation for Statistical Computing 264s Platform: aarch64-unknown-linux-gnu (64-bit) 264s 264s R is free software and comes with ABSOLUTELY NO WARRANTY. 264s You are welcome to redistribute it under certain conditions. 264s Type 'license()' or 'licence()' for distribution details. 264s 264s R is a collaborative project with many contributors. 264s Type 'contributors()' for more information and 264s 'citation()' on how to cite R or R packages in publications. 264s 264s Type 'demo()' for some demos, 'help()' for on-line help, or 264s 'help.start()' for an HTML browser interface to help. 264s Type 'q()' to quit R. 264s 264s > source(file.path("_helper", "init.R")) 264s > source(file.path("aammrtf", "ref.R")); make_ref_obj_funs("refobjs") 264s > 264s > # - "Text wrapping" ------------------------------------------------------------ 264s > 264s > var <- "humpty dumpty sat on a truck and had a big dump" 264s > # expect_true(all(nchar(unlist(unitizer:::text_wrap(var, 10))) <= 264s > writeLines(unlist(unitizer:::text_wrap(var, 10))) 264s humpty dum 264s pty sat on 264s a truck a 264s nd had a b 264s ig dump 264s > all(nchar(unlist(unitizer:::text_wrap(var, 10))) <= 10) 264s [1] TRUE 264s > 264s > var2 <- rep(var, 4) 264s > # expect_true(all(nchar(wrp <- unlist(unitizer:::text_wrap(var2, 264s > # c(20, 15)))) <= 20) && length(wrp) == 14) 264s > writeLines(unlist(unitizer:::text_wrap(var2, c(20, 15)))) 264s humpty dumpty sat on 264s a truck and had a b 264s ig dump 264s humpty dumpty s 264s at on a truck a 264s nd had a big du 264s mp 264s humpty dumpty sat on 264s a truck and had a b 264s ig dump 264s humpty dumpty s 264s at on a truck a 264s nd had a big du 264s mp 264s > all(nchar(wrp <- unlist(unitizer:::text_wrap(var2, c(20, 15)))) <= 264s + 20) && length(wrp) == 14 264s [1] TRUE 264s > 264s > # - "Headers" ------------------------------------------------------------------ 264s > 264s > # these basically require visual inspection 264s > 264s > unitizer:::H1("hello world") 264s +------------------------------------------------------------------------------+ 264s | hello world | 264s +------------------------------------------------------------------------------+ 264s 264s > unitizer:::H2("hello world") 264s = hello world ================================================================== 264s 264s > unitizer:::H3("hello world") 264s - hello world ------------------------------------------------------------------ 264s 264s > 264s > # cause an error 264s > try(print(unitizer:::H1(rep_len("hello world", 10)))) 264s Error in header(x, 1L) : 264s Argument `x` must be a one length character vector 264s > 264s > h.w.long <- paste0(rep_len("hello world", 10), collapse = " ") 264s > unitizer:::H1(h.w.long) 264s +------------------------------------------------------------------------------+ 264s | hello world hello world hello world hello world hello world hello world | 264s | hello world hello world hello world hello world | 264s +------------------------------------------------------------------------------+ 264s 264s > unitizer:::H2(h.w.long) 264s = hello world hello world hello world hello world hello world hello world h... = 264s 264s > print(unitizer:::H2("No margin"), margin = "none") # no extra line below 264s = No margin ==================================================================== 264s > 264s > # - "Valid Names convert names to valid" --------------------------------------- 264s > 264s > # expect_equal(unitizer:::valid_names("hello"), "hello") 264s > unitizer:::valid_names("hello") 264s [1] "hello" 264s > # expect_equal(unitizer:::valid_names(".hello"), ".hello") 264s > unitizer:::valid_names(".hello") 264s [1] ".hello" 264s > # expect_equal(unitizer:::valid_names("1hello"), "`1hello`") 264s > unitizer:::valid_names("1hello") 264s [1] "`1hello`" 264s > # expect_equal(unitizer:::valid_names("hello kitty"), "`hello kitty`") 264s > unitizer:::valid_names("hello kitty") 264s [1] "`hello kitty`" 264s > # expect_equal(unitizer:::valid_names("h3llo"), "`h3llo`") 264s > unitizer:::valid_names("h3llo") 264s [1] "`h3llo`" 264s > # expect_equal(unitizer:::valid_names("h_llo"), "h_llo") 264s > unitizer:::valid_names("h_llo") 264s [1] "h_llo" 264s > # expect_equal(unitizer:::valid_names("$hot"), "`$hot`") 264s > unitizer:::valid_names("$hot") 264s [1] "`$hot`" 264s > # expect_equal(unitizer:::valid_names("HELLO"), "HELLO") 264s > unitizer:::valid_names("HELLO") 264s [1] "HELLO" 264s > 264s > # - "strtrunc" ----------------------------------------------------------------- 264s > 264s > # expect_equal(unitizer:::strtrunc("hollywood is for starlets", 264s > # 5), "ho...") 264s > unitizer:::strtrunc("hollywood is for starlets", 5) 264s [1] "ho..." 264s > # expect_error(unitizer:::strtrunc(5, "hollywood is for starlets")) 264s > try(unitizer:::strtrunc(5, "hollywood is for starlets")) 264s Error in unitizer:::strtrunc(5, "hollywood is for starlets") : 264s Argument `x` must be character 264s > 264s > # - "environment name tools" --------------------------------------------------- 264s > 264s > env1 <- new.env(parent = globalenv()) 264s > env2 <- new.env(parent = env1) 264s > env3 <- new.env(parent = env2) 264s > env4 <- new.env(parent = env3) 264s > # expect_true(is.character(ename <- unitizer:::env_name(env3)) && 264s > # identical(length(ename), 1L)) 264s > is.character(ename <- unitizer:::env_name(env3)) && identical(length(ename), 1L) 264s [1] TRUE 264s > # expect_true(is.character(envanc <- unitizer:::env_ancestry(env4)) && 264s > # identical(length(envanc), 5L) && identical(envanc[[5L]], 264s > # "R_GlobalEnv")) 264s > is.character(envanc <- unitizer:::env_ancestry(env4)) && 264s + identical(length(envanc), 5L) && identical(envanc[[5L]], "R_GlobalEnv") 264s [1] TRUE 264s > 264s > # - "deparse peek" ------------------------------------------------------------- 264s > 264s > expr1 <- quote(1 + 1 + 3) 264s > expr2 <- quote(for (i in 1:100) { 264s + loop.val <- sample(1:1000, 200, replace = TRUE) 264s + loop.val <- loop.val * 200/3000 * mean(runif(20000)) 264s + }) 264s > # expect_equal("1 + 1 + 3", unitizer:::deparse_peek(expr1, 20L)) 264s > unitizer:::deparse_peek(expr1, 20L) 264s [1] "1 + 1 + 3" 264s > 264s > # expect_error(unitizer:::deparse_peek(expr1, 3L)) 264s > try(unitizer:::deparse_peek(expr1, 3L)) 264s Error in unitizer:::deparse_peek(expr1, 3L) : 264s Argument `len` must be an integer greater than four 264s > # expect_equal("1 ...", unitizer:::deparse_peek(expr1, 5L)) 264s > unitizer:::deparse_peek(expr1, 5L) 264s [1] "1 ..." 264s > 264s > # expect_equal("for (i in 1:100) { loop.val <- sam...", unitizer:::deparse_peek(expr2, 264s > # 40L)) 264s > unitizer:::deparse_peek(expr2, 40L) 264s [1] "for (i in 1:100) { loop.val <- sam..." 264s > 264s > # - "deparse fun" -------------------------------------------------------------- 264s > 264s > # expect_identical(unitizer:::deparse_fun(quote(fun)), "fun") 264s > unitizer:::deparse_fun(quote(fun)) 264s [1] "fun" 264s > # expect_identical(unitizer:::deparse_fun(quote(function(x) NULL)), 264s > # NA_character_) 264s > unitizer:::deparse_fun(quote(function(x) NULL)) 264s [1] NA 264s > # expect_identical(unitizer:::deparse_fun("hello"), character(0L)) 264s > unitizer:::deparse_fun("hello") 264s character(0) 264s > 264s > # - "deparse_prompt" ----------------------------------------------------------- 264s > 264s > suppressWarnings(glob <- unitizer:::unitizerGlobal$new()) 264s > item <- unitizer:::exec(quote(if (TRUE) { 264s + 25 264s + } else { 264s + 42 264s + }), new.env(), glob) 264s > unitizer:::deparse_prompt(item) 264s [1] "> if (TRUE) {" "+ 25" "+ } else {" "+ 42" 264s [5] "+ }" 264s > 264s > # - "deparse_mixed" ------------------------------------------------------------ 264s > 264s > b <- setNames(1:3, letters[1:3]) 264s > x <- quote(1 + b) 264s > x[[3]] <- b 264s > # expect_equal(unitizer:::deparse_mixed(x), "quote(1 + 1:3)") 264s > unitizer:::deparse_mixed(x) 264s [1] "quote(1 + 1:3)" 264s > y <- quote(1 + 3 + b) 264s > y[[3]] <- b 264s > # expect_equal(unitizer:::deparse_mixed(y), "quote(1 + 3 + 1:3)") 264s > unitizer:::deparse_mixed(y) 264s [1] "quote(1 + 3 + 1:3)" 264s > 264s > # - "(Un)ordered Lists" -------------------------------------------------------- 264s > 264s > vec <- c("hello htere how are you blah blah blah blah blah", 264s + "this is helpful you know", "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.", 264s + letters[1:10]) 264s > 264s > # expect_equal(as.character(unitizer:::OL(vec), width = 100L), 264s > # c(" 1. hello htere how are you blah blah blah blah blah", 264s > # " 2. this is helpful you know", " 3. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut ", 264s > # " labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco ", 264s > # " laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in ", 264s > # " voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat ", 264s > # " non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.", 264s > # " 4. a", " 5. b", " 6. c", " 7. d", " 8. e", " 9. f", 264s > # "10. g", "11. h", "12. i", "13. j")) 264s > writeLines(as.character(unitizer:::OL(vec), width = 100L)) 264s 1. hello htere how are you blah blah blah blah blah 264s 2. this is helpful you know 264s 3. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut 264s labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco 264s laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in 264s voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat 264s non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 264s 4. a 264s 5. b 264s 6. c 264s 7. d 264s 8. e 264s 9. f 264s 10. g 264s 11. h 264s 12. i 264s 13. j 264s > 264s > # expect_equal(as.character(unitizer:::UL(vec), width = 20L), c("- hello htere how ", 264s > # " are you blah blah ", " blah blah blah", "- this is helpful ", 264s > # " you know", "- Lorem ipsum dolor ", " sit amet, consec-", 264s > # " tetur adipisicing ", " elit, sed do ", " eiusmod tempor ", 264s > # " incididunt ut ", " labore et dolore ", " magna aliqua. Ut ", 264s > # " enim ad minim ", " veniam, quis ", " nostrud exer-", 264s > # " citation ullamco ", " laboris nisi ut ", " aliquip ex ea ", 264s > # " commodo consequat.", " Duis aute irure ", " dolor in reprehen-", 264s > # " derit in voluptate", " velit esse cillum ", " dolore eu fugiat ", 264s > # " nulla pariatur. ", " Excepteur sint ", " occaecat cupidatat", 264s > # " non proident, sunt", " in culpa qui ", " officia deserunt ", 264s > # " mollit anim id est", " laborum.", "- a", "- b", "- c", 264s > # "- d", "- e", "- f", "- g", "- h", "- i", "- j")) 264s > 264s > writeLines(as.character(unitizer:::UL(vec), width = 20L)) 264s - hello htere how 264s are you blah blah 264s blah blah blah 264s - this is helpful 264s you know 264s - Lorem ipsum dolor 264s sit amet, consec- 264s tetur adipisicing 264s elit, sed do 264s eiusmod tempor 264s incididunt ut 264s labore et dolore 264s magna aliqua. Ut 264s enim ad minim 264s veniam, quis 264s nostrud exer- 264s citation ullamco 264s laboris nisi ut 264s aliquip ex ea 264s commodo consequat. 264s Duis aute irure 264s dolor in reprehen- 264s derit in voluptate 264s velit esse cillum 264s dolore eu fugiat 264s nulla pariatur. 264s Excepteur sint 264s occaecat cupidatat 264s non proident, sunt 264s in culpa qui 264s officia deserunt 264s mollit anim id est 264s laborum. 264s - a 264s - b 264s - c 264s - d 264s - e 264s - f 264s - g 264s - h 264s - i 264s - j 264s > 264s > # test_that("Messing with traceback", { 264s > # warning("Missing traceback tests") 264s > # # Main problem with this is that there may not be a good way to cause a trace 264s > # # back to register while not also stopping execution of this file, so not 264s > # # sure if this can be tested 264s > # } ) 264s > 264s > # - "Compare Conditions" ------------------------------------------------------- 264s > 264s > lst1 <- new("conditionList", .items = list(simpleWarning("warning", 264s + quote(yo + yo)), simpleWarning("warning2", quote(yo2 + yo)), 264s + simpleWarning("warning3", quote(yo3 + yo)), simpleError("error1", 264s + quote(make_an_error())))) 264s > lst2 <- new("conditionList", .items = list(simpleWarning("warning", 264s + quote(yo + yo)), simpleWarning("warning2", quote(yo2 + yo)), 264s + simpleError("error1", quote(make_an_error())))) 264s > 264s > all.equal(lst1, lst1) 264s [1] TRUE 264s > # expect_equal("Condition count mismatch; expected 4 (got 3)", 264s > # all.equal(lst1, lst2)) 264s > all.equal(lst1, lst2)# 264s [1] "Condition count mismatch; expected 4 (got 3)" 264s > # expect_equal("There is one condition mismatch at index [[3]]", 264s > # all.equal(lst2, lst1[1L:3L])) 264s > all.equal(lst2, lst1[1L:3L]) 264s [1] "There is one condition mismatch at index [[3]]" 264s > # expect_equal("There are 2 condition mismatches, first one at index [[1]]", 264s > # all.equal(lst2, lst1[2L:4L])) 264s > all.equal(lst2, lst1[2L:4L]) 264s [1] "There are 2 condition mismatches, first one at index [[1]]" 264s > attr(lst1[[3L]], "unitizer.printed") <- TRUE 264s > # expect_equal("There is one condition mismatch at index [[3]]", 264s > # all.equal(lst2, lst1[1L:3L])) 264s > all.equal(lst2, lst1[1L:3L]) 264s [1] "There is one condition mismatch at index [[3]]" 264s > # expect_equal(c("Condition type mismatch, `target` is 'Error', but `current` is 'Warning'", 264s > # "Condition mismatch may involve print/show methods; carefully review conditions with `.NEW$conditions` and `.REF$conditions` as just typing `.ref` or `.new` at the prompt will invoke print/show methods, which themselves may be the cause of the mismatch"), 264s > # all.equal(lst2[[3]], lst1[[3]])) 264s > all.equal(lst2[[3]], lst1[[3]]) 264s [1] "Condition type mismatch, `target` is 'Error', but `current` is 'Warning'" 264s [2] "Condition mismatch may involve print/show methods; carefully review conditions with `.NEW$conditions` and `.REF$conditions` as just typing `.ref` or `.new` at the prompt will invoke print/show methods, which themselves may be the cause of the mismatch" 264s > 264s > attr(lst1[[3L]], "unitizer.printed") <- NULL 264s > lst1[[2L]] <- simpleWarning("warning2", quote(yo2 + yoyo)) 264s > # This used to produce "one condition mismatch at index [[2]]", but with the 264s > # relation of condition call comparison, no longer fails. Arguably this one 264s > # should still fail as none of the parameters are named. 264s > all.equal(lst2, lst1[c(1L:2L, 4L)]) 264s [1] TRUE 264s > 264s > # single condition display with a more complex condition 264s > large.cond <- simpleWarning(paste0(collapse = "\n", c("This is a complicated warning:", 264s + as.character(unitizer:::UL(c("one warning", "two warning", 264s + "three warning"))))), quote(make_a_warning())) 264s > lst3 <- new("conditionList", .items = list(large.cond)) 264s > show1 <- capture.output(show(lst3)) 264s > all.equal(show1, rds("misc_cndlistshow1")) 264s [1] TRUE 264s > 264s > attr(lst3[[1L]], "unitizer.printed") <- TRUE 264s > lst3[[2L]] <- simpleWarning("warning2", quote(yo2 + yoyo)) 264s > lst3 264s Condition list with 2 conditions: 264s 1. [print] Warning in make_a_warning() : This is a complicated warning: 264s - one warning 264s - two warning 264s - three warning 264s 2. Warning in yo2 + yoyo : warning2 264s 264s [print] means condition was issued by a print or show method for an auto-printed 264s result. 264s > 264s > # empty condition 264s > lst3[0] 264s Empty condition list 264s > 264s > # Conditions with mismatched calls (due to instability in call generation for C 264s > # errors issue285) 264s > lst4a <- new("conditionList", 264s + .items = list( 264s + simpleWarning("A", quote(fun(a=b, c=d))), 264s + simpleWarning("B", quote(fun(a=b, c=d))), 264s + simpleWarning("C", quote(fun(a=b, c=d))), 264s + simpleWarning("D", quote(fun(a, c=d))), 264s + simpleWarning("E", quote(fun())), 264s + simpleWarning("F"), 264s + simpleWarning("G", quote(fun(a=b, c=d))), 264s + simpleWarning("H", quote(fun(a=b, c=d))), 264s + simpleWarning("I", quote(foo(a=b, c=d))) 264s + )) 264s > lst4b <- new("conditionList", 264s + .items = list( 264s + simpleWarning("A", quote(fun(a=b, c=d))), 264s + simpleWarning("B", quote(fun(a=B, c=d))), 264s + simpleWarning("C", quote(fun(b, c=d))), 264s + simpleWarning("D", quote(fun(a=b, c=d))), 264s + simpleWarning("E", quote(fun(a=b, c=d))), 264s + simpleWarning("F", quote(fun(a=b, c=d))), 264s + simpleWarning("G"), 264s + simpleWarning("H", quote(fun())), 264s + simpleWarning("I", quote(bar(a=b, c=d))) 264s + )) 264s > all.equal(lst4a, lst4b) 264s [1] "There are 2 condition mismatches, first one at index [[2]]" 264s > all.equal(lst4a[c(2, 9)], lst4b[c(2, 9)]) 264s [1] "There are 2 condition mismatches, first one at index [[1]]" 264s > 264s > # - "Compare Functions With Traces" -------------------------------------------- 264s > 264s > fun.a <- base::library 264s > identical(fun.a, base::library) 264s [1] TRUE 264s > trace(library, where = .BaseNamespaceEnv) 264s Tracing function "library" in package "namespace:base" 264s [1] "library" 264s > identical(fun.a, base::library) # FALSE 264s [1] FALSE 264s > unitizer:::identical_fun(fun.a, base::library) 264s [1] TRUE 264s > unitizer:::identical_fun(base::library, fun.a) # FALSE 264s [1] FALSE 264s > untrace(library, where = .BaseNamespaceEnv) 264s Untracing function "library" in package "namespace:base" 264s > # expect_error(unitizer:::identical_fun(1, base::library)) 264s > try(unitizer:::identical_fun(1, base::library)) 264s Error in unitizer:::identical_fun(1, base::library) : 264s Arguments `x` and `y` must both be functions. 264s > # expect_error(unitizer:::identical_fun(base::library, 1)) 264s > try(unitizer:::identical_fun(base::library, 1)) 264s Error in unitizer:::identical_fun(base::library, 1) : 264s Arguments `x` and `y` must both be functions. 264s > unitizer:::identical_fun(base::print, base::print) 264s [1] TRUE 264s > # make sure all.equal dispatches properly out of namespace 264s > 264s > # expect_equal(evalq(all.equal(new("conditionList", .items = list(simpleWarning("warning", 264s > # quote(yo + yo)), simpleWarning("warning2", quote(yo2 + yo)), 264s > # simpleWarning("warning3", quote(yo3 + yo)), simpleError("error1", 264s > # quote(make_an_error())))), new("conditionList", .items = list(simpleWarning("warning", 264s > # quote(yo + yo)), simpleWarning("warning2", quote(yo2 + yo)), 264s > # simpleError("error1", quote(make_an_error()))))), envir = getNamespace("stats")), 264s > # "Condition count mismatch; expected 4 (got 3)") 264s > evalq(all.equal(new("conditionList", .items = list(simpleWarning("warning", 264s + quote(yo + yo)), simpleWarning("warning2", quote(yo2 + yo)), 264s + simpleWarning("warning3", quote(yo3 + yo)), simpleError("error1", 264s + quote(make_an_error())))), new("conditionList", .items = list(simpleWarning("warning", 264s + quote(yo + yo)), simpleWarning("warning2", quote(yo2 + yo)), 264s + simpleError("error1", quote(make_an_error()))))), envir = getNamespace("stats")) 264s [1] "Condition count mismatch; expected 4 (got 3)" 264s > 264s > # - "word_cat" ----------------------------------------------------------------- 264s > 264s > str <- "Humpty dumpty sat on a wall and took a big fall. All the kings horses and men couldn't put humpty dumpty together again" 264s > # expect_equal(capture.output(unitizer:::word_cat(str, width = 20L)), 264s > # c("Humpty dumpty sat on", "a wall and took a ", "big fall. All the ", 264s > # "kings horses and men", "couldn't put humpty ", "dumpty together ", 264s > # "again")) 264s > unitizer:::word_cat(str, width = 20L) 264s Humpty dumpty sat on 264s a wall and took a 264s big fall. All the 264s kings horses and men 264s couldn't put humpty 264s dumpty together 264s again 264s > # expect_error(unitizer:::word_cat(stop("boom"), width = 20L, sep = " "), 264s > # "boom") 264s > try(unitizer:::word_cat(stop("boom"), width = 20L, sep = " ")) 264s Error in word_wrap_split(..., width = width, tolerance = tolerance, sep = sep) : 264s boom 264s > str2 <- rep("goodbye goodbye") 264s > str1 <- rep("hello hello hello", 2) 264s > # expect_equal(c("hello hello ", "hello hello ", "hello hello ", 264s > # "goodbye ", "goodbye"), capture.output()) 264s > unitizer:::word_cat(str1, str2, width = 14L) 264s hello hello 264s hello hello 264s hello hello 264s goodbye 264s goodbye 264s > 264s > # Make sure default works 264s > old.width <- options(width = 20L) 264s > # expect_equal(capture.output(unitizer:::word_cat(str)), c("Humpty dumpty sat on", 264s > # "a wall and took a ", "big fall. All the ", "kings horses and men", 264s > # "couldn't put humpty ", "dumpty together ", "again")) 264s > unitizer:::word_cat(str) 264s Humpty dumpty sat on 264s a wall and took a 264s big fall. All the 264s kings horses and men 264s couldn't put humpty 264s dumpty together 264s again 264s > options(old.width) 264s > 264s > # - "relativize_path" ---------------------------------------------------------- 264s > 264s > base <- file.path(system.file(package = "unitizer"), "expkg") 264s > wd <- file.path(base, "infer") 264s > p1 <- file.path(wd, "R") 264s > p2 <- file.path(base, "unitizerdummypkg1") 264s > # expect_equal(unitizer:::relativize_path(p1, wd), "R") 264s > unitizer:::relativize_path(p1, wd) 264s [1] "R" 264s > # expect_equal(unitizer:::relativize_path(p2, wd), "../unitizerdummypkg1") 264s > unitizer:::relativize_path(p2, wd) 264s [1] "../unitizerdummypkg1" 264s > # expect_equal(unitizer:::relativize_path(c(p1, p2), wd), c("R", 264s > # "../unitizerdummypkg1")) 264s > unitizer:::relativize_path(c(p1, p2), wd) 264s [1] "R" "../unitizerdummypkg1" 264s > # expect_equal(unitizer:::relativize_path(c(p1, p2), wd), c("R", 264s > # "../unitizerdummypkg1")) 264s > unitizer:::relativize_path(c(p1, p2), wd) 264s [1] "R" "../unitizerdummypkg1" 264s > # expect_equal(unitizer:::relativize_path(c(p1, p2, file.path("notarealpath", 264s > # "foo")), wd), c("R", "../unitizerdummypkg1", file.path("notarealpath", 264s > # "foo"))) 264s > unitizer:::relativize_path( 264s + c(p1, p2, file.path("notarealpath", "foo")), wd 264s + ) 264s [1] "R" "../unitizerdummypkg1" "notarealpath/foo" 264s > # expect_equal(unitizer:::relativize_path("/a/b/c/d/e/x.txt"), 264s > # "/a/b/c/d/e/x.txt") 264s > unitizer:::relativize_path("/a/b/c/d/e/x.txt", exists = TRUE) 264s [1] "/a/b/c/d/e/x.txt" 264s > # ## This was too difficult to get to behave consistently across windows and 264s > # ## other platforms (see docs) 264s > # wd <- sub("^[a-zA-Z]:", "", getwd()) 264s > # all.equal( 264s > # unitizer:::relativize_path( 264s > # "/a/b/c/d/e/x.txt", only.if.shorter = FALSE, exists = TRUE 264s > # ), 264s > # do.call( 264s > # file.path, 264s > # c( 264s > # as.list( 264s > # rep( 264s > # "..", 264s > # length(unlist(strsplit(wd, .Platform$file.sep, fixed = TRUE))) - 264s > # 1L 264s > # ) ), 264s > # list("a/b/c/d/e/x.txt") 264s > # ) ) ) 264s > 264s > # - "path_clean" --------------------------------------------------------------- 264s > 264s > try(unitizer:::path_clean(list())) 264s Error in unitizer:::path_clean(list()) : 264s Argument `path` must be character 264s > unitizer:::path_clean(file.path("a", "", "b", "c")) 264s [1] "a/b/c" 264s > 264s > # - "unitizer:::merge_lists" --------------------------------------------------- 264s > 264s > unitizer:::merge_lists(list(a = 1, b = 2), list(c = 3)) 264s $a 264s [1] 1 264s 264s $b 264s [1] 2 264s 264s $c 264s [1] 3 264s 264s > unitizer:::merge_lists(list(a = 1, b = 2, c = 3), list(d = 5, c = 5)) 264s $a 264s [1] 1 264s 264s $b 264s [1] 2 264s 264s $c 264s [1] 5 264s 264s $d 264s [1] 5 264s 264s > unitizer:::merge_lists(list(a = 1, b = 2, c = 3), list(a = NULL, d = 5, c = 5)) 264s $a 264s NULL 264s 264s $b 264s [1] 2 264s 264s $c 264s [1] 5 264s 264s $d 264s [1] 5 264s 264s > 264s > # - "filename to storeid" ------------------------------------------------------ 264s > 264s > filename_to_storeid("tests.R") 264s [1] "tests.unitizer" 264s > filename_to_storeid("tests.rock") 264s Warning in filename_to_storeid("tests.rock") : 264s Unable to translate file name 'tests.rock' to `store.id` because it does not match regex '\.[rR]$', please provide explicit `store.id` or rename to end in '.R'. Returning in NULL for `store.id`. 264s NULL 264s > 264s > # - "pretty_path" -------------------------------------------------------------- 264s > # not supposed to exist 264s > res <- unitizer:::pretty_path("xadfasdfxcfasdfasd") # warn 264s > 264s > if(FALSE) { 264s + # "fails CRAN" 264s + # expect_identical(res, "xadfasdfxcfasdfasd") 264s + res 264s + unitizer:::pretty_path(normalizePath(".")) 264s + unitizer:::pretty_path(file.path(system.file(package = "stats"), 264s + "DESCRIPTION")) 264s + } 264s > # - "quit" --------------------------------------------------------------------- 264s > 264s > # for some reason cover tests run via travis can't handle the with_mock, 264s > # so we just use truly-quit=FALSE; UPDATE (mabye du to compiler?) 264s > # with_mock( 264s > # quit=function(...) stop("quit!\n"), { 264s > # unitizer:::read_line_set_vals("y") 264s > # expect_error(capture.output(unitizer:::unitizer_quit()), "quit!") 264s > # unitizer:::read_line_set_vals("n") 264s > # capture.output(uq2 <- unitizer:::unitizer_quit()) 264s > # expect_equal(uq2, NULL) 264s > # unitizer:::read_line_set_vals(c("q", "q", "q", "q", "q", "q")) 264s > # expect_error(capture.output(unitizer:::unitizer_quit()), "quit!") 264s > # } 264s > # ) 264s > unitizer:::read_line_set_vals("y") 264s > capture.output(q.res.1 <- unitizer:::unitizer_quit(truly.quit = FALSE)) 264s | You are attempting to quit R from within `unitizer`. If you do so 264s | you will lose any unsaved `unitizers`. Use `Q` to quit `unitizer` 264s | gracefully. Are you sure you want to exit R? 264s 264s [1] "Quit R? [y/n]: y" 264s > q.res.1 264s [1] TRUE 264s > unitizer:::read_line_set_vals("n") 264s > capture.output(q.res.2 <- unitizer:::unitizer_quit(truly.quit = FALSE)) 264s | You are attempting to quit R from within `unitizer`. If you do so 264s | you will lose any unsaved `unitizers`. Use `Q` to quit `unitizer` 264s | gracefully. Are you sure you want to exit R? 264s 264s [1] "Quit R? [y/n]: n" 264s > q.res.2 # FALSE 264s [1] FALSE 264s > unitizer:::read_line_set_vals(c("q", "q", "q", "q", "q", "q")) 264s > capture.output(q.res.3 <- unitizer:::unitizer_quit(truly.quit = FALSE)) 264s | You are attempting to quit R from within `unitizer`. If you do so 264s | you will lose any unsaved `unitizers`. Use `Q` to quit `unitizer` 264s | gracefully. Are you sure you want to exit R? 264s 264s | Sorry, could not understand you, quitting then. 264s 264s [1] "Quit R? [y/n]: q" "Quit R? [y/n]: q" "Quit R? [y/n]: q" "Quit R? [y/n]: q" 264s [5] "Quit R? [y/n]: q" "Quit R? [y/n]: q" 264s > q.res.3 264s [1] TRUE 264s > unitizer:::read_line_set_vals(NULL) 264s > 264s > # - "mock_item" ---------------------------------------------------------------- 264s > 264s > is(mock_item(), "unitizerItem") 264s [1] TRUE 264s > 264s > # - "diff conditionList" ------------------------------------------------------- 264s > 264s > cond1 <- new("conditionList", .items = list(simpleWarning("hello", 264s + call = quote(fun())), simpleWarning("goodbye", call = quote(fun())))) 264s > is(diffobj::diffObj(cond1, cond1), "Diff") 264s [1] TRUE 264s > 264s > # - "Condition object structure" ----------------------------------------------- 264s > 264s > # We're assuming a particular structure for the condition object in 264s > # `faux_prompt` and `unitizer_prompt` so we put in a test here to make sure it 264s > # doesn't change 264s > cond <- simpleError("hello") 264s > is.list(cond) 264s [1] TRUE 264s > identical(names(cond), c("message", "call")) 264s [1] TRUE 264s > identical(class(cond), c("simpleError", "error", "condition")) 264s [1] TRUE 264s > 264s > # - "options" ------------------------------------------------------------------ 264s > 264s > # not great tests... 264s > 264s > old.opts <- options() 264s > new.opts <- unitizer:::options_zero() 264s > 264s > all(names(new.opts) %in% names(old.opts)) 264s [1] TRUE 264s > length(new.opts) <= length(old.opts) 264s [1] TRUE 264s > options(old.opts) 264s > 264s > 264s PASS 264s Begin testing t-nav.R 265s 265s R version 4.3.2 (2023-10-31) -- "Eye Holes" 265s Copyright (C) 2023 The R Foundation for Statistical Computing 265s Platform: aarch64-unknown-linux-gnu (64-bit) 265s 265s R is free software and comes with ABSOLUTELY NO WARRANTY. 265s You are welcome to redistribute it under certain conditions. 265s Type 'license()' or 'licence()' for distribution details. 265s 265s R is a collaborative project with many contributors. 265s Type 'contributors()' for more information and 265s 'citation()' on how to cite R or R packages in publications. 265s 265s Type 'demo()' for some demos, 'help()' for on-line help, or 265s 'help.start()' for an HTML browser interface to help. 265s Type 'q()' to quit R. 265s 265s > source(file.path("_helper", "init.R")) 265s > nav <- file.path("_helper", "unitizers", "nav.R") 265s > 265s > # Simple navigation tests that don't require complex unitizers 265s > 265s > # - "Re-run bookmark" -----=---------------------------------------------------- 265s > 265s > # Relates to #278. Tests both Review and Browse 265s > 265s > unitizer:::read_line_set_vals( 265s + c("R", "Y", "B", "7", "R", "Y", "B", "9", "R", "Y", "Q") 265s + ) 265s > unitize(nav, interactive.mode=TRUE) 265s 266s +------------------------------------------------------------------------------+ 266s | unitizer for: nav.R | 266s +------------------------------------------------------------------------------+ 266s 266s Pass Fail New 266s A - - 2 266s B - - 2 266s .................. 266s - - 4 266s 266s = A ============================================================================ 266s 266s - New -------------------------------------------------------------------------- 266s 266s | The 2 tests in this section are new. Add tests to store ([Y]es, [N]o, [P]rev, 266s | [B]rowse, [R]erun, [Q]uit, [H]elp)? 266s 266s > a <- 42 266s > a + 1 266s [1] 43 266s 266s unitizer> R 266s 266s | Toggling re-run mode ON for this unitizer 266s 266s = Finalize Unitizer ============================================================ 266s 266s | You have 4 unreviewed tests; press `B` to browse tests, `U` to go to first 266s | unreviewed test. 266s 266s | You made no changes to the unitizer so there is no need to update it. While 266s | unnecessary, you can force an update by typing O at the prompt. 266s 266s | Re-run unitizer ([Y]es, [P]rev, [B]rowse, [U]nreviewed, [R]erun, f[O]rce)? 266s 266s unitizer> Y 266s 266s | unitizer unchanged. 266s 266s +------------------------------------------------------------------------------+ 266s | unitizer for: nav.R | 266s +------------------------------------------------------------------------------+ 266s 266s Pass Fail New 266s A - - 2 266s B - - 2 266s .................. 266s - - 4 266s 266s = A ============================================================================ 266s 266s - New -------------------------------------------------------------------------- 266s 266s | The 2 tests in this section are new. Add tests to store ([Y]es, [N]o, [P]rev, 266s | [B]rowse, [R]erun, [Q]uit, [H]elp)? 266s 266s | Jumping to test #3 because that was the test under review when test re-run was 266s | requested. 266s 266s > a <- 42 266s > a + 1 266s [1] 43 266s 266s unitizer> B 266s 266s = ============== 266s *1. z <- 24 . . -:- 266s = A ======================= 266s *2. a <- 42 . . -:- 266s 3. a + 1 . . . New:- 266s 4. a + 2 . . . New:- 266s = B ======================= 266s *5. b <- 25 . . -:- 266s *6. bb <- 26 . . -:- 266s 7. b + 1 . . . New:- 266s *8. bbb <- 27 . . -:- 266s 9. b + 2 . . . New:- 266s 266s | What test do you wish to review (input a test number, [U]nreviewed)? 266s 266s unitizer> 7 266s = B ============================================================================ 266s 266s - New -------------------------------------------------------------------------- 266s 266s | The 2 tests in this section are new. Add tests to store ([Y]es, [N]o, [P]rev, 266s | [B]rowse, [R]erun, [Q]uit, [H]elp)? 266s 266s > b <- 25 266s > bb <- 26 266s > b + 1 266s [1] 26 266s 266s unitizer> R 266s 266s | Toggling re-run mode ON for this unitizer 266s 267s = Finalize Unitizer ============================================================ 267s 267s | You have 4 unreviewed tests; press `B` to browse tests, `U` to go to first 267s | unreviewed test. 267s 267s | You made no changes to the unitizer so there is no need to update it. While 267s | unnecessary, you can force an update by typing O at the prompt. 267s 267s | Re-run unitizer ([Y]es, [P]rev, [B]rowse, [U]nreviewed, [R]erun, f[O]rce)? 267s 267s unitizer> Y 267s 267s | unitizer unchanged. 267s 267s +------------------------------------------------------------------------------+ 267s | unitizer for: nav.R | 267s +------------------------------------------------------------------------------+ 267s 267s Pass Fail New 267s A - - 2 267s B - - 2 267s .................. 267s - - 4 267s 267s = B ============================================================================ 267s 267s - New -------------------------------------------------------------------------- 267s 267s | The 2 tests in this section are new. Add tests to store ([Y]es, [N]o, [P]rev, 267s | [B]rowse, [R]erun, [Q]uit, [H]elp)? 267s 267s | Jumping to test #7 because that was the test under review when test re-run was 267s | requested. 267s 267s > b <- 25 267s > bb <- 26 267s > b + 1 267s [1] 26 267s 267s unitizer> B 267s 267s = ============== 267s *1. z <- 24 . . -:- 267s = A ======================= 267s *2. a <- 42 . . -:- 267s 3. a + 1 . . . New:- 267s 4. a + 2 . . . New:- 267s = B ======================= 267s *5. b <- 25 . . -:- 267s *6. bb <- 26 . . -:- 267s 7. b + 1 . . . New:- 267s *8. bbb <- 27 . . -:- 267s 9. b + 2 . . . New:- 267s 267s | What test do you wish to review (input a test number, [U]nreviewed)? 267s 267s unitizer> 9 267s = B ============================================================================ 267s 267s - New -------------------------------------------------------------------------- 267s 267s | The 2 tests in this section are new. Add tests to store ([Y]es, [N]o, [P]rev, 267s | [B]rowse, [R]erun, [Q]uit, [H]elp)? 267s 267s > bbb <- 27 267s > b + 2 267s [1] 27 267s 267s unitizer> R 267s 267s | Toggling re-run mode ON for this unitizer 267s 267s = Finalize Unitizer ============================================================ 267s 267s | You have 4 unreviewed tests; press `B` to browse tests, `U` to go to first 267s | unreviewed test. 267s 267s | You made no changes to the unitizer so there is no need to update it. While 267s | unnecessary, you can force an update by typing O at the prompt. 267s 267s | Re-run unitizer ([Y]es, [P]rev, [B]rowse, [U]nreviewed, [R]erun, f[O]rce)? 267s 267s unitizer> Y 267s 267s | unitizer unchanged. 267s 267s +------------------------------------------------------------------------------+ 267s | unitizer for: nav.R | 267s +------------------------------------------------------------------------------+ 267s 267s Pass Fail New 267s A - - 2 267s B - - 2 267s .................. 267s - - 4 267s 267s = B ============================================================================ 267s 267s - New -------------------------------------------------------------------------- 267s 267s | The 2 tests in this section are new. Add tests to store ([Y]es, [N]o, [P]rev, 267s | [B]rowse, [R]erun, [Q]uit, [H]elp)? 267s 267s | Jumping to test #9 because that was the test under review when test re-run was 267s | requested. 267s 267s > bbb <- 27 267s > b + 2 267s [1] 27 267s 267s unitizer> Q 267s 267s | No changes recorded. 267s | unitizer unchanged. 267s 267s > 267s > 268s PASS 268s Begin testing t-parse.R 268s 268s R version 4.3.2 (2023-10-31) -- "Eye Holes" 268s Copyright (C) 2023 The R Foundation for Statistical Computing 268s Platform: aarch64-unknown-linux-gnu (64-bit) 268s 268s R is free software and comes with ABSOLUTELY NO WARRANTY. 268s You are welcome to redistribute it under certain conditions. 268s Type 'license()' or 'licence()' for distribution details. 268s 268s R is a collaborative project with many contributors. 268s Type 'contributors()' for more information and 268s 'citation()' on how to cite R or R packages in publications. 268s 268s Type 'demo()' for some demos, 'help()' for on-line help, or 268s 'help.start()' for an HTML browser interface to help. 268s Type 'q()' to quit R. 268s 268s > source(file.path("_helper", "init.R")) 268s > source(file.path("aammrtf", "ref.R")); make_ref_obj_funs("refobjs") 268s > 268s > txt <- "# This is an early comment\n\n hello <- 25\n\n # multi\n # line\n # comment\n\n matrix(1:9, 3) # and another!\n\n unitizer_sect(\"here is a section\", {\n # test that were not crazy\n\n 1 + 1 == 2 # TRUE hopefully\n\n # Still not crazy\n\n 2 * 2 == 2 ^ 2\n # Tada\n } )\n sample(1:10)\n\n # and this comment belongs to whom?\n\n runif(20)\n print(\"woo\") # and I?\n " 268s > all <- unitizer:::parse_dat_get(text = txt) 268s > prs <- all$expr 268s > dat <- all$dat 268s > dat$parent <- pmax(0L, dat$parent) 268s > # With R4.0 some of the ids started changing 268s > normalize_id <- function(dat) { 268s + idu <- sort(unique(dat[["id"]])) 268s + id <- with(dat, match(id, idu)) 268s + parent <- with(dat, ifelse(parent == 0L, 0L, match(parent, 268s + idu))) 268s + dat[["id"]] <- id 268s + dat[["parent"]] <- parent 268s + dat 268s + } 268s > dat <- normalize_id(dat) 268s > dat.split <- dat.split.2 <- par.ids.3 <- NULL 268s > if.text <- "if # IFFY\n(x > 3 # ifcond\n){ hello\n #whome to attach?\n} else #final\ngoodbye" 268s > 268s > # - "Top Level Parents Identified Correctly" ----------------------------------- 268s > 268s > # "Identified top level parents?" 268s > par.ids <- with(dat, unitizer:::top_level_parse_parents(id, parent)) 268s > par.ids 268s [1] 0 0 7 7 7 7 7 0 0 0 0 24 24 24 24 24 24 24 24 24 24 24 24 24 0 268s [26] 0 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 268s [51] 64 64 64 64 64 64 64 64 64 64 64 64 64 64 0 75 75 75 75 75 75 75 75 75 75 268s [76] 0 0 83 83 83 83 83 83 0 90 90 90 90 90 90 0 268s > dat.split <- split(dat, par.ids) 268s > 268s > # "Identified sub-level top level parents correctly" 268s > par.ids.2 <- with(dat.split$`64`, unitizer:::top_level_parse_parents(id, 268s + parent, 64L)) 268s > par.ids.2 268s [1] 28 64 64 31 64 64 64 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 268s [26] 62 62 62 62 62 62 62 62 62 62 62 62 64 268s > dat.split.2 <- split(dat.split$`64`, par.ids.2) 268s > 268s > # "Parent relationships in `unitizer_sect` piece." 268s > 268s > par.ids.3 <- with(dat.split.2$`62`, unitizer:::top_level_parse_parents(id, 268s + parent, 62L)) 268s > par.ids.3 268s [1] 62 62 62 44 44 44 44 44 44 44 44 44 62 62 62 59 59 59 59 59 59 59 59 59 59 268s [26] 59 59 59 62 62 268s > 268s > # - "Comments Are Assigned" ---------------------------------------------------- 268s > 268s > # "Did we assign comments correctly to topmost level?" 268s > lapply(unitizer:::comments_assign(prs, dat.split$`0`), attr, "comment") 268s [[1]] 268s [1] "# This is an early comment" 268s 268s [[2]] 268s [1] "# multi" "# line" "# comment" "# and another!" 268s 268s [[3]] 268s NULL 268s 268s [[4]] 268s NULL 268s 268s [[5]] 268s [1] "# and this comment belongs to whom?" 268s 268s [[6]] 268s [1] "# and I?" 268s 268s > 268s > # "No comments here so no changes should occur" 268s > all.equal(unitizer:::comments_assign(prs[[3]], dat.split.2$`64`), prs[[3]]) 268s [1] TRUE 268s > 268s > # "Comments in `unitizer_sect` body assigned correctly" 268s > lapply(unitizer:::comments_assign(prs[[3]][[3]], split(dat.split.2$`62`, 268s + par.ids.3)$`62`), attr, "comment") 268s [[1]] 268s NULL 268s 268s [[2]] 268s [1] "# test that were not crazy" "# TRUE hopefully" 268s 268s [[3]] 268s [1] "# Still not crazy" 268s 268s > 268s > # - "Ancestry Descend" --------------------------------------------------------- 268s > 268s > x <- unitizer:::parse_dat_get(text = "1 + 1; fun(x, fun(y + z))")$dat 268s > x <- normalize_id(x) 268s > 268s > unitizer:::ancestry_descend(x$id, x$parent, 0) 268s children level 268s [1,] 7 0 268s [2,] 6 0 268s [3,] 26 0 268s [4,] 2 1 268s [5,] 3 1 268s [6,] 5 1 268s [7,] 10 1 268s [8,] 9 1 268s [9,] 13 1 268s [10,] 12 1 268s [11,] 24 1 268s [12,] 25 1 268s [13,] 1 2 268s [14,] 4 2 268s [15,] 8 2 268s [16,] 11 2 268s [17,] 16 2 268s [18,] 15 2 268s [19,] 23 2 268s [20,] 21 2 268s [21,] 14 3 268s [22,] 19 3 268s [23,] 18 3 268s [24,] 22 3 268s [25,] 17 4 268s [26,] 20 4 268s > 268s > # - "Clean up Parse Data" ------------------------------------------------------ 268s > 268s > dat <- unitizer:::parse_dat_get(text = "{function(x) NULL;; #comment\n}")$dat 268s > # set negative ids to be top level parents 268s > dat <- transform(dat, parent = ifelse(parent < 0, 0L, parent)) 268s > dat <- normalize_id(dat) 268s > 268s > # "Ancestry Descend" 268s > dat.anc <- unitizer:::ancestry_descend(dat$id, dat$parent, 0L) 268s > dat.anc 268s children level 268s [1,] 15 0 268s [2,] 1 1 268s [3,] 13 1 268s [4,] 12 1 268s [5,] 14 1 268s [6,] 11 2 268s [7,] 10 2 268s [8,] 9 3 268s [9,] 8 3 268s [10,] 2 4 268s [11,] 3 4 268s [12,] 4 4 268s [13,] 5 4 268s [14,] 7 4 268s [15,] 6 5 268s > 268s > # "Excise `exprlist`" 268s > unitizer:::prsdat_fix_exprlist(dat, dat.anc)$token 268s [1] "expr" "'{'" "expr" "FUNCTION" 268s [5] "'('" "SYMBOL_FORMALS" "')'" "NULL_CONST" 268s [9] "expr" "COMMENT" "'}'" 268s > 268s > dat.1 <- unitizer:::parse_dat_get(text = "{1 ; ; ;2;}")$dat 268s > # set negative ids to be top level parents 268s > dat.1 <- transform(dat.1, parent = ifelse(parent < 0, 0L, parent)) 268s > dat.1 <- normalize_id(dat.1) 268s > 268s > # "Another `exprlist` test" 268s > unname( 268s + as.list( 268s + unitizer:::prsdat_fix_exprlist( 268s + dat.1, 268s + unitizer:::ancestry_descend(dat.1$id, dat.1$parent, 0L) 268s + )[c("parent", "token")] 268s + ) ) 268s [[1]] 268s [1] 0 14 3 14 10 14 14 268s 268s [[2]] 268s [1] "expr" "'{'" "NUM_CONST" "expr" "NUM_CONST" "expr" 268s [7] "'}'" 268s 268s > dat.2 <- unitizer:::parse_dat_get(text = "{NULL; yowza; #comment\nhello\n}")$dat 268s > # set negative ids to be top level parents 268s > dat.2 <- transform(dat.2, parent = ifelse(parent < 0, 0L, parent)) 268s > dat.2 <- normalize_id(dat.2) 268s > 268s > # "Yet another `exprlist`" 268s > unname( 268s + as.list( 268s + unitizer:::prsdat_fix_exprlist( 268s + dat.2, unitizer:::ancestry_descend(dat.2$id, dat.2$parent, 0L) 268s + )[c("parent", "token")] 268s + ) ) 268s [[1]] 268s [1] 0 13 3 13 7 13 13 11 13 13 268s 268s [[2]] 268s [1] "expr" "'{'" "NULL_CONST" "expr" "SYMBOL" 268s [6] "expr" "COMMENT" "SYMBOL" "expr" "'}'" 268s 268s > 268s > dat.2a <- normalize_id( 268s + unitizer:::parse_dat_get(text = "for(i in x) {if(x) break else next}")$dat 268s + ) 268s > # "`for` cleanup" 268s > 268s > as.list(unitizer:::prsdat_fix_for(dat.2a[-1L, ])) 268s $line1 268s [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 268s 268s $col1 268s [1] 1 5 10 10 13 13 14 14 16 17 17 18 20 20 26 31 31 35 268s 268s $line2 268s [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 268s 268s $col2 268s [1] 3 5 10 10 35 13 34 15 16 17 17 18 24 24 29 34 34 35 268s 268s $id 268s [1] 1 3 5 7 22 9 21 10 11 12 14 13 15 16 17 18 19 20 268s 268s $parent 268s [1] 23 23 7 23 23 22 22 21 21 14 21 21 16 21 21 19 21 22 268s 268s $token 268s [1] "FOR" "SYMBOL" "SYMBOL" "expr" "expr" "'{'" "expr" "IF" 268s [9] "'('" "SYMBOL" "expr" "')'" "BREAK" "expr" "ELSE" "NEXT" 268s [17] "expr" "'}'" 268s 268s $terminal 268s [1] TRUE TRUE TRUE FALSE FALSE TRUE FALSE TRUE TRUE TRUE FALSE TRUE 268s [13] TRUE FALSE TRUE TRUE FALSE TRUE 268s 268s $text 268s [1] "for" "i" "x" "" "" "{" "" "if" "(" 268s [10] "x" "" ")" "break" "" "else" "next" "" "}" 268s 268s > 268s > dat.3 <- normalize_id(unitizer:::parse_dat_get(text = if.text)$dat) 268s > 268s > # "`if` cleanup" 268s > 268s > unname(as.list(unitizer:::prsdat_fix_if(dat.3[-1, ])[c("id", "token")])) 268s [[1]] 268s [1] 1 2 11 4 6 5 7 8 9 17 12 13 14 15 16 19 20 21 268s 268s [[2]] 268s [1] "IF" "COMMENT" "expr" "SYMBOL" "expr" "GT" 268s [7] "NUM_CONST" "expr" "COMMENT" "expr" "'{'" "SYMBOL" 268s [13] "expr" "COMMENT" "'}'" "COMMENT" "SYMBOL" "expr" 268s 268s > 268s > # - "Full Parse Works Properly" ------------------------------------------------ 268s > 268s > # "Full Comment Parse" 268s > unitizer:::comm_extract(unitizer:::parse_with_comments(text = txt)) 268s [[1]] 268s NULL 268s 268s [[2]] 268s [[2]][[1]] 268s [1] "# This is an early comment" 268s 268s [[2]][[2]] 268s [[2]][[2]][[1]] 268s NULL 268s 268s 268s [[2]][[3]] 268s [[2]][[3]][[1]] 268s NULL 268s 268s 268s [[2]][[4]] 268s [[2]][[4]][[1]] 268s NULL 268s 268s 268s 268s [[3]] 268s [[3]][[1]] 268s [1] "# multi" "# line" "# comment" "# and another!" 268s 268s [[3]][[2]] 268s [[3]][[2]][[1]] 268s NULL 268s 268s 268s [[3]][[3]] 268s [[3]][[3]][[1]] 268s NULL 268s 268s [[3]][[3]][[2]] 268s [[3]][[3]][[2]][[1]] 268s NULL 268s 268s 268s [[3]][[3]][[3]] 268s [[3]][[3]][[3]][[1]] 268s NULL 268s 268s 268s [[3]][[3]][[4]] 268s [[3]][[3]][[4]][[1]] 268s NULL 268s 268s 268s 268s [[3]][[4]] 268s [[3]][[4]][[1]] 268s NULL 268s 268s 268s 268s [[4]] 268s [[4]][[1]] 268s NULL 268s 268s [[4]][[2]] 268s [[4]][[2]][[1]] 268s NULL 268s 268s 268s [[4]][[3]] 268s [[4]][[3]][[1]] 268s NULL 268s 268s 268s [[4]][[4]] 268s [[4]][[4]][[1]] 268s NULL 268s 268s [[4]][[4]][[2]] 268s [[4]][[4]][[2]][[1]] 268s NULL 268s 268s 268s [[4]][[4]][[3]] 268s [[4]][[4]][[3]][[1]] 268s [1] "# test that were not crazy" "# TRUE hopefully" 268s 268s [[4]][[4]][[3]][[2]] 268s [[4]][[4]][[3]][[2]][[1]] 268s NULL 268s 268s 268s [[4]][[4]][[3]][[3]] 268s [[4]][[4]][[3]][[3]][[1]] 268s NULL 268s 268s [[4]][[4]][[3]][[3]][[2]] 268s [[4]][[4]][[3]][[3]][[2]][[1]] 268s NULL 268s 268s 268s [[4]][[4]][[3]][[3]][[3]] 268s [[4]][[4]][[3]][[3]][[3]][[1]] 268s NULL 268s 268s 268s [[4]][[4]][[3]][[3]][[4]] 268s [[4]][[4]][[3]][[3]][[4]][[1]] 268s NULL 268s 268s 268s 268s [[4]][[4]][[3]][[4]] 268s [[4]][[4]][[3]][[4]][[1]] 268s NULL 268s 268s 268s 268s [[4]][[4]][[4]] 268s [[4]][[4]][[4]][[1]] 268s [1] "# Still not crazy" 268s 268s [[4]][[4]][[4]][[2]] 268s [[4]][[4]][[4]][[2]][[1]] 268s NULL 268s 268s 268s [[4]][[4]][[4]][[3]] 268s [[4]][[4]][[4]][[3]][[1]] 268s NULL 268s 268s [[4]][[4]][[4]][[3]][[2]] 268s [[4]][[4]][[4]][[3]][[2]][[1]] 268s NULL 268s 268s 268s [[4]][[4]][[4]][[3]][[3]] 268s [[4]][[4]][[4]][[3]][[3]][[1]] 268s NULL 268s 268s 268s [[4]][[4]][[4]][[3]][[4]] 268s [[4]][[4]][[4]][[3]][[4]][[1]] 268s NULL 268s 268s 268s 268s [[4]][[4]][[4]][[4]] 268s [[4]][[4]][[4]][[4]][[1]] 268s NULL 268s 268s [[4]][[4]][[4]][[4]][[2]] 268s [[4]][[4]][[4]][[4]][[2]][[1]] 268s NULL 268s 268s 268s [[4]][[4]][[4]][[4]][[3]] 268s [[4]][[4]][[4]][[4]][[3]][[1]] 268s NULL 268s 268s 268s [[4]][[4]][[4]][[4]][[4]] 268s [[4]][[4]][[4]][[4]][[4]][[1]] 268s NULL 268s 268s 268s 268s 268s 268s 268s [[5]] 268s [[5]][[1]] 268s NULL 268s 268s [[5]][[2]] 268s [[5]][[2]][[1]] 268s NULL 268s 268s 268s [[5]][[3]] 268s [[5]][[3]][[1]] 268s NULL 268s 268s [[5]][[3]][[2]] 268s [[5]][[3]][[2]][[1]] 268s NULL 268s 268s 268s [[5]][[3]][[3]] 268s [[5]][[3]][[3]][[1]] 268s NULL 268s 268s 268s [[5]][[3]][[4]] 268s [[5]][[3]][[4]][[1]] 268s NULL 268s 268s 268s 268s 268s [[6]] 268s [[6]][[1]] 268s [1] "# and this comment belongs to whom?" 268s 268s [[6]][[2]] 268s [[6]][[2]][[1]] 268s NULL 268s 268s 268s [[6]][[3]] 268s [[6]][[3]][[1]] 268s NULL 268s 268s 268s 268s [[7]] 268s [[7]][[1]] 268s [1] "# and I?" 268s 268s [[7]][[2]] 268s [[7]][[2]][[1]] 268s NULL 268s 268s 268s [[7]][[3]] 268s [[7]][[3]][[1]] 268s NULL 268s 268s 268s 268s > 268s > # "EQ_SUB and SYMBOL_SUB test" 268s > unitizer:::comm_extract( 268s + unitizer:::parse_with_comments( 268s + text = "structure(1:3, # the data\nclass # the label\n=#the equal sign\n'hello' # the class\n)" 268s + ) ) 268s [[1]] 268s NULL 268s 268s [[2]] 268s [[2]][[1]] 268s NULL 268s 268s [[2]][[2]] 268s [[2]][[2]][[1]] 268s NULL 268s 268s 268s [[2]][[3]] 268s [[2]][[3]][[1]] 268s [1] "# the data" 268s 268s [[2]][[3]][[2]] 268s [[2]][[3]][[2]][[1]] 268s NULL 268s 268s 268s [[2]][[3]][[3]] 268s [[2]][[3]][[3]][[1]] 268s NULL 268s 268s 268s [[2]][[3]][[4]] 268s [[2]][[3]][[4]][[1]] 268s NULL 268s 268s 268s 268s [[2]]$class 268s [[2]]$class[[1]] 268s [1] "# the label" "#the equal sign" "# the class" 268s 268s 268s 268s > 268s > # "Function with `exprlist`" 268s > 268s > unitizer:::comm_extract( 268s + unitizer:::parse_with_comments( 268s + text = "function(x #first arg\n, y=25 #second arg with default\n) {x + y; # first comment\n; yo #second comment\n x / y; #lastcomment \n;}" 268s + ) ) 268s [[1]] 268s NULL 268s 268s [[2]] 268s [[2]][[1]] 268s NULL 268s 268s [[2]][[2]] 268s [[2]][[2]][[1]] 268s [1] "#first arg" 268s 268s 268s [[2]][[3]] 268s [[2]][[3]][[1]] 268s NULL 268s 268s [[2]][[3]]$x 268s [[2]][[3]]$x[[1]] 268s NULL 268s 268s 268s [[2]][[3]]$y 268s [[2]][[3]]$y[[1]] 268s NULL 268s 268s 268s 268s [[2]][[4]] 268s [[2]][[4]][[1]] 268s [1] "#second arg with default" 268s 268s [[2]][[4]][[2]] 268s [[2]][[4]][[2]][[1]] 268s NULL 268s 268s 268s [[2]][[4]][[3]] 268s [[2]][[4]][[3]][[1]] 268s [1] "# first comment" 268s 268s [[2]][[4]][[3]][[2]] 268s [[2]][[4]][[3]][[2]][[1]] 268s NULL 268s 268s 268s [[2]][[4]][[3]][[3]] 268s [[2]][[4]][[3]][[3]][[1]] 268s NULL 268s 268s 268s [[2]][[4]][[3]][[4]] 268s [[2]][[4]][[3]][[4]][[1]] 268s NULL 268s 268s 268s 268s [[2]][[4]][[4]] 268s [[2]][[4]][[4]][[1]] 268s [1] "#second comment" 268s 268s 268s [[2]][[4]][[5]] 268s [[2]][[4]][[5]][[1]] 268s [1] "#lastcomment " 268s 268s [[2]][[4]][[5]][[2]] 268s [[2]][[4]][[5]][[2]][[1]] 268s NULL 268s 268s 268s [[2]][[4]][[5]][[3]] 268s [[2]][[4]][[5]][[3]][[1]] 268s NULL 268s 268s 268s [[2]][[4]][[5]][[4]] 268s [[2]][[4]][[5]][[4]][[1]] 268s NULL 268s 268s 268s 268s 268s [[2]][[5]] 268s [[2]][[5]][[1]] 268s NULL 268s 268s [[2]][[5]][[2]] 268s [[2]][[5]][[2]][[1]] 268s NULL 268s 268s 268s [[2]][[5]][[3]] 268s [[2]][[5]][[3]][[1]] 268s NULL 268s 268s 268s [[2]][[5]][[4]] 268s [[2]][[5]][[4]][[1]] 268s NULL 268s 268s 268s [[2]][[5]][[5]] 268s [[2]][[5]][[5]][[1]] 268s NULL 268s 268s 268s [[2]][[5]][[6]] 268s [[2]][[5]][[6]][[1]] 268s NULL 268s 268s 268s [[2]][[5]][[7]] 268s [[2]][[5]][[7]][[1]] 268s NULL 268s 268s 268s [[2]][[5]][[8]] 268s [[2]][[5]][[8]][[1]] 268s NULL 268s 268s 268s [[2]][[5]][[9]] 268s [[2]][[5]][[9]][[1]] 268s NULL 268s 268s 268s 268s 268s > 268s > # "`for` loop" 268s > unitizer:::comm_extract( 268s + unitizer:::parse_with_comments( 268s + text = "for(i #in counter\nin 1:10#incounter again\n) {x + y; # first comment\n; next; yo #second comment\n x / y; break; #lastcomment \n;}" 268s + ) ) 268s [[1]] 268s NULL 268s 268s [[2]] 268s [[2]][[1]] 268s NULL 268s 268s [[2]][[2]] 268s [[2]][[2]][[1]] 268s NULL 268s 268s 268s [[2]][[3]] 268s [[2]][[3]][[1]] 268s [1] "#in counter" 268s 268s 268s [[2]][[4]] 268s [[2]][[4]][[1]] 268s [1] "#incounter again" 268s 268s [[2]][[4]][[2]] 268s [[2]][[4]][[2]][[1]] 268s NULL 268s 268s 268s [[2]][[4]][[3]] 268s [[2]][[4]][[3]][[1]] 268s NULL 268s 268s 268s [[2]][[4]][[4]] 268s [[2]][[4]][[4]][[1]] 268s NULL 268s 268s 268s 268s [[2]][[5]] 268s [[2]][[5]][[1]] 268s NULL 268s 268s [[2]][[5]][[2]] 268s [[2]][[5]][[2]][[1]] 268s NULL 268s 268s 268s [[2]][[5]][[3]] 268s [[2]][[5]][[3]][[1]] 268s [1] "# first comment" 268s 268s [[2]][[5]][[3]][[2]] 268s [[2]][[5]][[3]][[2]][[1]] 268s NULL 268s 268s 268s [[2]][[5]][[3]][[3]] 268s [[2]][[5]][[3]][[3]][[1]] 268s NULL 268s 268s 268s [[2]][[5]][[3]][[4]] 268s [[2]][[5]][[3]][[4]][[1]] 268s NULL 268s 268s 268s 268s [[2]][[5]][[4]] 268s [[2]][[5]][[4]][[1]] 268s NULL 268s 268s 268s [[2]][[5]][[5]] 268s [[2]][[5]][[5]][[1]] 268s [1] "#second comment" 268s 268s 268s [[2]][[5]][[6]] 268s [[2]][[5]][[6]][[1]] 268s NULL 268s 268s [[2]][[5]][[6]][[2]] 268s [[2]][[5]][[6]][[2]][[1]] 268s NULL 268s 268s 268s [[2]][[5]][[6]][[3]] 268s [[2]][[5]][[6]][[3]][[1]] 268s NULL 268s 268s 268s [[2]][[5]][[6]][[4]] 268s [[2]][[5]][[6]][[4]][[1]] 268s NULL 268s 268s 268s 268s [[2]][[5]][[7]] 268s [[2]][[5]][[7]][[1]] 268s [1] "#lastcomment " 268s 268s 268s 268s 268s > 268s > # "`if` statement" 268s > unitizer:::comm_extract(unitizer:::parse_with_comments(text = if.text)) 268s [[1]] 268s NULL 268s 268s [[2]] 268s [[2]][[1]] 268s NULL 268s 268s [[2]][[2]] 268s [[2]][[2]][[1]] 268s [1] "# IFFY" 268s 268s 268s [[2]][[3]] 268s [[2]][[3]][[1]] 268s [1] "# ifcond" 268s 268s [[2]][[3]][[2]] 268s [[2]][[3]][[2]][[1]] 268s NULL 268s 268s 268s [[2]][[3]][[3]] 268s [[2]][[3]][[3]][[1]] 268s NULL 268s 268s 268s [[2]][[3]][[4]] 268s [[2]][[3]][[4]][[1]] 268s NULL 268s 268s 268s 268s [[2]][[4]] 268s [[2]][[4]][[1]] 268s NULL 268s 268s [[2]][[4]][[2]] 268s [[2]][[4]][[2]][[1]] 268s NULL 268s 268s 268s [[2]][[4]][[3]] 268s [[2]][[4]][[3]][[1]] 268s NULL 268s 268s 268s 268s [[2]][[5]] 268s [[2]][[5]][[1]] 268s [1] "#final" 268s 268s 268s 268s > 268s > # "formula" 268s > unitizer:::comm_extract( 268s + unitizer:::parse_with_comments( 268s + text = ". + x # hello\n#yowza\n~#bust a move\ny" 268s + ) ) 268s [[1]] 268s NULL 268s 268s [[2]] 268s [[2]][[1]] 268s [1] "# hello" 268s 268s [[2]][[2]] 268s [[2]][[2]][[1]] 268s NULL 268s 268s 268s [[2]][[3]] 268s [[2]][[3]][[1]] 268s NULL 268s 268s 268s [[2]][[4]] 268s [[2]][[4]][[1]] 268s NULL 268s 268s 268s 268s [[3]] 268s [[3]][[1]] 268s [1] "#yowza" 268s 268s [[3]][[2]] 268s [[3]][[2]][[1]] 268s [1] "#bust a move" 268s 268s 268s [[3]][[3]] 268s [[3]][[3]][[1]] 268s NULL 268s 268s 268s 268s > 268s > # "`repeat`" 268s > unitizer:::comm_extract( 268s + unitizer:::parse_with_comments( 268s + text = "repeat #first\n{runif(10); #comm\nbreak;}" 268s + ) ) 268s [[1]] 268s NULL 268s 268s [[2]] 268s [[2]][[1]] 268s NULL 268s 268s [[2]][[2]] 268s [[2]][[2]][[1]] 268s [1] "#first" 268s 268s 268s [[2]][[3]] 268s [[2]][[3]][[1]] 268s NULL 268s 268s [[2]][[3]][[2]] 268s [[2]][[3]][[2]][[1]] 268s NULL 268s 268s 268s [[2]][[3]][[3]] 268s [[2]][[3]][[3]][[1]] 268s [1] "#comm" 268s 268s [[2]][[3]][[3]][[2]] 268s [[2]][[3]][[3]][[2]][[1]] 268s NULL 268s 268s 268s [[2]][[3]][[3]][[3]] 268s [[2]][[3]][[3]][[3]][[1]] 268s NULL 268s 268s 268s 268s [[2]][[3]][[4]] 268s [[2]][[3]][[4]][[1]] 268s NULL 268s 268s 268s 268s 268s > 268s > # "S4 slot" 268s > unitizer:::comm_extract( 268s + unitizer:::parse_with_comments(text = "test@#comment\nhello <- 3") 268s + ) 268s [[1]] 268s NULL 268s 268s [[2]] 268s [[2]][[1]] 268s NULL 268s 268s [[2]][[2]] 268s [[2]][[2]][[1]] 268s NULL 268s 268s 268s [[2]][[3]] 268s [[2]][[3]][[1]] 268s NULL 268s 268s [[2]][[3]][[2]] 268s [[2]][[3]][[2]][[1]] 268s [1] "#comment" 268s 268s 268s [[2]][[3]][[3]] 268s [[2]][[3]][[3]][[1]] 268s NULL 268s 268s 268s [[2]][[3]][[4]] 268s [[2]][[3]][[4]][[1]] 268s NULL 268s 268s 268s 268s [[2]][[4]] 268s [[2]][[4]][[1]] 268s NULL 268s 268s 268s 268s > 268s > # "`while`" 268s > unitizer:::comm_extract( 268s + unitizer:::parse_with_comments( 268s + text = "while(x > 5 # a comment\n) { hello; goodbye } #yay" 268s + ) ) 268s [[1]] 268s NULL 268s 268s [[2]] 268s [[2]][[1]] 268s NULL 268s 268s [[2]][[2]] 268s [[2]][[2]][[1]] 268s NULL 268s 268s 268s [[2]][[3]] 268s [[2]][[3]][[1]] 268s [1] "# a comment" 268s 268s [[2]][[3]][[2]] 268s [[2]][[3]][[2]][[1]] 268s NULL 268s 268s 268s [[2]][[3]][[3]] 268s [[2]][[3]][[3]][[1]] 268s NULL 268s 268s 268s [[2]][[3]][[4]] 268s [[2]][[3]][[4]][[1]] 268s NULL 268s 268s 268s 268s [[2]][[4]] 268s [[2]][[4]][[1]] 268s NULL 268s 268s [[2]][[4]][[2]] 268s [[2]][[4]][[2]][[1]] 268s NULL 268s 268s 268s [[2]][[4]][[3]] 268s [[2]][[4]][[3]][[1]] 268s NULL 268s 268s 268s [[2]][[4]][[4]] 268s [[2]][[4]][[4]][[1]] 268s NULL 268s 268s 268s 268s 268s > 268s > txt2 <- "library(functools)\n fun <- function(a=1, bravo, card=25, ..., xar=list(\"aurochs\", 1), z) {}\n\n # Need to add tests:\n # - with complex objects? (did I mean in the definition? Or the call??)\n (NULL)\n # These should be identical to match.call()\n\n body(fun) <- parse(text=\"{print(match_call()); print(match.call())}\")\n\n calls <- c(\n 'fun(54, \"hello\", \"wowo\", \"blergh\", 8, 9)',\n 'fun(54, \"hello\", \"wowo\", \"blergh\", a=8, z=9)',\n 'fun(54, \"hello\", z=\"wowo\", \"blergh\", 8, 9)',\n 'fun(54, \"hello\", z=\"wowo\", x=\"blergh\", 8, 9)',\n 'fun(54, c=\"hello\", z=\"wowo\", xar=3, 8, 9)'\n )\n invisible(lapply(calls, function(x){cat(\"-- New Call --\", x, sep=\"\n\"); eval(parse(text=x))}))\n " 268s > test.comp <- unitizer:::comm_extract(unitizer:::parse_with_comments(text = txt2)) 268s > 268s > # "A more complex test" 268s > lapply(test.comp[4:5], `[[`, 1) 268s [[1]] 268s [1] "# Need to add tests:" 268s [2] "# - with complex objects? (did I mean in the definition? Or the call??)" 268s 268s [[2]] 268s [1] "# These should be identical to match.call()" 268s 268s > 268s > # "Added SYMBOL_PACKAGE token" 268s > unitizer:::comm_extract( 268s + unitizer:::parse_with_comments( 268s + text = "# a comment before\nunitizer:::browse() #a comment after" 268s + ) ) 268s [[1]] 268s NULL 268s 268s [[2]] 268s [[2]][[1]] 268s [1] "# a comment before" "#a comment after" 268s 268s 268s > # "Added SYMBOL_PACKAGE token v2" 268s > unitizer:::comm_extract( 268s + unitizer:::parse_with_comments( 268s + text = "# a comment before\nunitizer::browse() #a comment after" 268s + ) ) 268s [[1]] 268s NULL 268s 268s [[2]] 268s [[2]][[1]] 268s [1] "# a comment before" "#a comment after" 268s 268s 268s > # LBB used to break stuff 268s > txt3 <- "# This is an early comment\n hello <- 25\n # multi\n hello[[1]] # and another!" 268s > # "LBB test" 268s > unitizer:::comm_extract(unitizer:::parse_with_comments(text = txt3)) 268s [[1]] 268s NULL 268s 268s [[2]] 268s [[2]][[1]] 268s [1] "# This is an early comment" 268s 268s [[2]][[2]] 268s [[2]][[2]][[1]] 268s NULL 268s 268s 268s [[2]][[3]] 268s [[2]][[3]][[1]] 268s NULL 268s 268s 268s [[2]][[4]] 268s [[2]][[4]][[1]] 268s NULL 268s 268s 268s 268s [[3]] 268s [[3]][[1]] 268s [1] "# multi" "# and another!" 268s 268s [[3]][[2]] 268s [[3]][[2]][[1]] 268s NULL 268s 268s 268s [[3]][[3]] 268s [[3]][[3]][[1]] 268s NULL 268s 268s 268s [[3]][[4]] 268s [[3]][[4]][[1]] 268s NULL 268s 268s 268s 268s > 268s > # - "Weird missing comment on `res` works" ------------------------------------- 268s > 268s > txt3 <- "# Calls to `library` and assignments are not normally considered tests, so\n# you will not be prompted to review them\n\nlibrary(utzflm)\nx <- 1:100\ny <- x ^ 2\nres <- fastlm(x, y)\n\nres # first reviewable expression\nget_slope(res)\nget_rsq(res)\n\nfastlm(x, head(y)) # This should cause an error; press Y to add to store" 268s > expr <- unitizer:::parse_with_comments(text = txt3) 268s > my.unitizer <- new("unitizer", id = 1, zero.env = new.env()) 268s > capture.output(my.unitizer <- my.unitizer + expr) 269s character(0) 269s > 269s > lapply(unitizer:::as.list(my.unitizer@items.new), slot, "comment") 269s [[1]] 269s [1] "# Calls to `library` and assignments are not normally considered tests, so" 269s [2] "# you will not be prompted to review them" 269s 269s [[2]] 269s character(0) 269s 269s [[3]] 269s character(0) 269s 269s [[4]] 269s character(0) 269s 269s [[5]] 269s [1] "# first reviewable expression" 269s 269s [[6]] 269s character(0) 269s 269s [[7]] 269s character(0) 269s 269s [[8]] 269s [1] "# This should cause an error; press Y to add to store" 269s 269s > 269s > # - "exprlist excission with negative par ids" --------------------------------- 269s > 269s > txt <- "# For random tests\n\nunitizer_sect(\"blah\", {\n identity(1);\n})\n" 269s > prs.dat <- unitizer:::parse_dat_get(text = txt)$dat 269s > # set negative ids to be top level parents 269s > prs.dat <- transform(prs.dat, parent = ifelse(parent < 0, 0L, 269s + parent)) 269s > prs.dat <- normalize_id(prs.dat) 269s > ancestry <- with(prs.dat, unitizer:::ancestry_descend(id, parent, 269s + 0L)) 269s > x <- unitizer:::prsdat_fix_exprlist(prs.dat, ancestry) 269s > unname(as.matrix(x[, 5:6])) 269s [,1] [,2] 269s [1,] 1 0 269s [2,] 21 0 269s [3,] 2 4 269s [4,] 4 21 269s [5,] 3 21 269s [6,] 5 7 269s [7,] 7 21 269s [8,] 6 21 269s [9,] 19 21 269s [10,] 8 19 269s [11,] 15 19 269s [12,] 9 11 269s [13,] 11 15 269s [14,] 10 15 269s [15,] 12 13 269s [16,] 13 15 269s [17,] 14 15 269s [18,] 18 19 269s [19,] 20 21 269s > 269s > # - "empty symbols handled okay" ----------------------------------------------- 269s > 269s > # the empty second argument to `[` caused problems before 269s > txt <- "mtcars[1:10,]\n" 269s > # shouldn't cause error 269s > unitizer:::parse_with_comments(text = txt) 269s expression(mtcars[1:10,]) 269s > 269s > # - "uncommenting works" ------------------------------------------------------- 269s > 269s > unitizer:::uncomment(expr[[1]]) 269s library(utzflm) 269s > 269s > # "don't blow away function arg names" 269s > unitizer:::uncomment(quote(function(a, b) NULL)) 269s function(a, b) NULL 269s > # 269s > # Recover comments and uncomment 269s > txt <- ".alike( # FALSE, match.call disabled\n quote(fun(b=fun2(x, y), 1, 3)), # first sub.call\n quote(fun(NULL, fun2(a, b), 1)), # second sub.call\n alike_settings(lang.mode=1))" 269s > exp <- unitizer:::parse_with_comments(text = txt) 269s > candc <- unitizer:::comm_and_call_extract(exp) 269s > 269s > candc$call[[1L]] 269s .alike(quote(fun(b = fun2(x, y), 1, 3)), quote(fun(NULL, fun2(a, 269s b), 1)), alike_settings(lang.mode = 1)) 269s > 269s > candc$comments 269s [1] "# FALSE, match.call disabled" "# first sub.call" 269s [3] "# second sub.call" 269s > 269s > # - "failing parses produce proper errors" ------------------------------------- 269s > 269s > txt <- "this is a + syntax error that cannot be parsed" 269s > try(capture.output(unitizer:::parse_tests(text = txt), type = "message")) 269s Error in value[[3L]](cond) : 269s Unable to parse test file; see previous messages 269s > f <- tempfile() 269s > on.exit(unlink(f)) 269s > cat(txt, "\n", sep = "", file = f) 269s > try(capture.output(unitizer:::parse_tests(f), type = "message")) 269s Error in value[[3L]](cond) : 269s Unable to parse test file; see previous messages 269s > # try in normal mode (just fall back to normal parse) 269s > try(unitizer:::parse_tests(text = txt, comments = FALSE)) 269s Error in parse(text = text, keep.source = FALSE) : 269s :1:6: unexpected symbol 269s 1: this is 269s ^ 269s > 269s > any( 269s + grepl( 269s + "unexpected symbol", 269s + capture.output(try(unitizer:::parse_tests(f, comments = FALSE)), type='message'), 269s + ) ) 269s [1] TRUE 269s > 269s > # - "NULL, constants, and new tokens" ------------------------------------------ 269s > 269s > # These were added with 3.6.3? Previously, it seems that the equal assign did 269s > # not generate a master expression to wrap all the pieces, which means these 269s > # tests just don't work because all the eq_assign at the top level end up with 269s > # the same parent and the parser gets confused. 269s > 269s > txt <- c("a = 2", "# ho how", "b = 3", "", "b + a # oh here", 269s + "", "b + # oh there", "a # bear", "", "NULL") 269s > if(getRversion() >= "3.6.3") { 269s + identical( 269s + unitizer:::comm_extract(unitizer:::parse_with_comments(text = txt)), 269s + rds('parse-eq') 269s + ) 269s + } else TRUE 269s [1] TRUE 269s > 269s > with.const <- unitizer:::parse_with_comments(text = "3 # comment on const") 269s > unitizer:::symb_mark_rem(with.const[[1]]) 269s [1] 3 269s > 269s > 269s PASS 269s Begin testing t-prompt.R 269s 269s R version 4.3.2 (2023-10-31) -- "Eye Holes" 269s Copyright (C) 2023 The R Foundation for Statistical Computing 269s Platform: aarch64-unknown-linux-gnu (64-bit) 269s 269s R is free software and comes with ABSOLUTELY NO WARRANTY. 269s You are welcome to redistribute it under certain conditions. 269s Type 'license()' or 'licence()' for distribution details. 269s 269s R is a collaborative project with many contributors. 269s Type 'contributors()' for more information and 269s 'citation()' on how to cite R or R packages in publications. 269s 269s Type 'demo()' for some demos, 'help()' for on-line help, or 269s 'help.start()' for an HTML browser interface to help. 269s Type 'q()' to quit R. 269s 269s > source(file.path("_helper", "init.R")) 269s > 269s > # - "read_line works" ---------------------------------------------------------- 269s > 269s > # read through prompt vals 269s > 269s > unitizer:::read_line_set_vals(letters[1:3]) 269s > u.ns <- asNamespace("unitizer") 269s > unitizer:::read_line() 269s a 269s [1] "a" 269s > identical(u.ns$.global$prompt.vals, letters[2:3]) 269s [1] TRUE 269s > unitizer:::read_line() 269s b 269s [1] "b" 269s > u.ns$.global$prompt.vals 269s [1] "c" 269s > unitizer:::read_line() 269s c 269s [1] "c" 269s > u.ns$.global$prompt.vals 269s character(0) 269s > 269s > try(unitizer:::read_line()) 269s Error : Internal Error: ran out of predefined readline input; contact maintainer. 269s > 269s > # - "simple prompts" ----------------------------------------------------------- 269s > 269s > unitizer:::read_line_set_vals(c("y", "Y", "n", "N")) 269s > try(unitizer:::simple_prompt(1:5)) 269s Error in unitizer:::simple_prompt(1:5) : 269s Argument `message` must be character 269s > try(unitizer:::simple_prompt("hello", attempts = 1:5)) 269s Error in unitizer:::simple_prompt("hello", attempts = 1:5) : 269s Argument `attempts` must be numeric(1L), not NA, and one or greater 269s > try(unitizer:::simple_prompt("hello", values = NA_character_)) 269s Error in unitizer:::simple_prompt("hello", values = NA_character_) : 269s Argument `values` must be character with no NAs 269s > try(unitizer:::simple_prompt("hello", case.sensitive = 1)) 269s Error in unitizer:::simple_prompt("hello", case.sensitive = 1) : 269s Argument `case.sensitive` must be TRUE or FALSE 269s > 269s > unitizer:::simple_prompt("hello") 269s | hello 269s 269s unitizer> y 269s [1] "Y" 269s > unitizer:::simple_prompt("hello")# 269s | hello 269s 269s unitizer> Y 269s [1] "Y" 269s > unitizer:::simple_prompt("hello") 269s | hello 269s 269s unitizer> n 269s [1] "N" 269s > unitizer:::read_line_set_vals(c("y", "y", "n")) 269s > try(unitizer:::simple_prompt("hello", attempts = 1L, case.sensitive = TRUE)) 269s | hello 269s 269s unitizer> y 269s | Invalid input, please select one of: Y, N 269s 269s Error in unitizer:::simple_prompt("hello", attempts = 1L, case.sensitive = TRUE) : 269s Gave up trying to collect user input after 1 attempts. 269s > try(unitizer:::simple_prompt("hello", attempts = 1L, case.sensitive = TRUE), 269s + silent = TRUE) 269s | hello 269s 269s unitizer> y 269s | Invalid input, please select one of: Y, N 269s 269s > try(unitizer:::simple_prompt("hello", attempts = 1L, case.sensitive = TRUE)) 269s | hello 269s 269s unitizer> n 269s | Invalid input, please select one of: Y, N 269s 269s Error in unitizer:::simple_prompt("hello", attempts = 1L, case.sensitive = TRUE) : 269s Gave up trying to collect user input after 1 attempts. 269s > 269s > # - "faux prompt" -------------------------------------------------------------- 269s > 269s > unitizer:::read_line_set_vals(c("1 +", "1")) 269s > unitizer:::faux_prompt(prompt = "> ", continue = "+ ")[[1L]] 269s > 1 + 269s + 1 269s 1 + 1 269s > unitizer:::read_line_set_vals(c("(})")) 269s > try(unitizer:::faux_prompt(prompt = "> ", continue = "+ ")) 269s > (}) 269s Error in "(})" : :1:2: unexpected '}' 269s 1: (} 269s ^ 269s > 269s > ## Test the new readLines based read_line 269s > ## This test will not work in interactive mode, requiring input 269s > unitizer:::read_line_set_vals(c("1 +", "1")) 269s > unitizer:::faux_prompt() 269s > 1 + 269s + 1 269s expression(1 + 1) 269s > 269s > ## This one embeds a CTRL+C to test interrupt, but we can't test this without 269s > ## read_line_setvals 269s > unitizer:::read_line_set_vals(c("1 +", "\x03", "2 + ", "1")) 269s > unitizer:::faux_prompt() 269s > 1 + 269s +  269s 269s > 2 + 269s + 1 269s expression(2 + 1) 269s > 269s > unitizer:::read_line_set_vals(c("\x03", "2 + ", "1")) 269s > unitizer:::faux_prompt() 269s >  269s 269s 269s | Type "Q" at the prompt to quit unitizer. 269s 269s > 2 + 269s + 1 269s expression(2 + 1) 269s > 269s > ## Test that changing language doesn't affect partial parsing 269s > lang <- Sys.getenv("LANGUAGE", unset=NA) 269s > Sys.setenv("LANGUAGE"="fr") 269s > unitizer:::read_line_set_vals(c("1 +", "1")) 269s > unitizer:::faux_prompt(prompt = "> ", continue = "+ ") 269s > 1 + 269s + 1 269s expression(1 + 1) 269s > if(is.na(lang)) Sys.unsetenv("LANGUAGE") else Sys.setenv("LANGUAGE"=lang) 269s > 269s > # - "unitizer prompt" ---------------------------------------------------------- 269s > 269s > # Some of this needs to be done outside of testthat due to sinking 269s > suppressWarnings(glob <- unitizer:::unitizerGlobal$new()) 269s > unitizer:::read_line_set_vals(c("1 +", "1", "H", "Y")) 269s > unitizer:::unitizer_prompt( 269s + "hello", valid.opts = c(Y = "[Y]es", N = "[N]o"), global = glob 269s + ) 269s unitizer> 1 + 269s + 1 269s [1] 2 269s unitizer> H 269s 269s | No help available. 269s | 269s | hello ([Y]es, [N]o, [Q]uit, [H]elp)? 269s 269s unitizer> Y 269s 269s [1] "Y" 269s > 269s > unitizer:::read_line_set_vals(c("1 +", "1", "H", "Q")) 269s > unitizer:::unitizer_prompt("hello", 269s + valid.opts = c(Y = "[Y]es", N = "[N]o"), help = "This is all the help you get", 269s + global = glob) 269s unitizer> 1 + 269s + 1 269s [1] 2 269s unitizer> H 269s 269s | This is all the help you get 269s | 269s | hello ([Y]es, [N]o, [Q]uit, [H]elp)? 269s 269s unitizer> Q 269s 269s [1] "Q" 269s > 269s > unitizer:::read_line_set_vals(c("hell())", "Q")) 269s > txt3 <- unitizer:::capture_output(unitizer:::unitizer_prompt("hello", 269s + valid.opts = c(Y = "[Y]es", N = "[N]o"), global = glob)) 269s > txt3$message 269s [1] "Error in \"hell())\": :1:7: unexpected ')'" 269s [2] "1: hell())" 269s [3] " ^" 269s > 269s > # and multiline stuff (#242) 269s > unitizer:::read_line_set_vals(c("{\n 1 + 1\n 2 + 1\n}", "N")) 269s > unitizer:::unitizer_prompt( 269s + "hello", valid.opts = c(Y = "[Y]es", N = "[N]o"), global = glob 269s + ) 269s unitizer> { 269s 1 + 1 269s 2 + 1 269s } 269s [1] 3 269s unitizer> N 269s 269s [1] "N" 269s > 269s > try( 269s + unitizer:::unitizer_prompt( 269s + "hello", valid.opts = c(Y = "[Y]es", N = "[N]o"), 269s + browse.env = "not an env", global = glob 269s + ) ) 269s Error in unitizer:::unitizer_prompt("hello", valid.opts = c(Y = "[Y]es", : 269s Argument `browse.env` must be an environment 269s > 269s > unitizer:::read_line_set_vals(character()) 269s > try( 269s + unitizer:::unitizer_prompt( 269s + "hello", valid.opts = c(Y = "[Y]es", N = "[N]o"), global = glob 269s + ) ) 269s Error : Internal Error: ran out of predefined readline input; contact maintainer. 269s > unitizer:::read_line_set_vals("1L") 269s > try( 269s + unitizer:::unitizer_prompt( 269s + "hello", 269s + valid.opts = c(Y = "[Y]es", N = "[N]o"), 269s + exit.condition = unitizer:::exit_fun, 269s + valid.vals = 2:3, global = glob 269s + ) ) 269s unitizer> 1L 269s | Type a number in `2:3` at the prompt 269s [1] 1 269s Error : Internal Error: ran out of predefined readline input; contact maintainer. 269s > unitizer:::read_line_set_vals("2L") 269s > unitizer:::unitizer_prompt("hello", valid.opts = c(Y = "[Y]es", 269s + N = "[N]o"), exit.condition = unitizer:::exit_fun, valid.vals = 2:3, 269s + global = glob) 269s unitizer> 2L 269s [1] 2 269s > 269s > 269s PASS 269s Begin testing t-random.R 269s 269s R version 4.3.2 (2023-10-31) -- "Eye Holes" 269s Copyright (C) 2023 The R Foundation for Statistical Computing 269s Platform: aarch64-unknown-linux-gnu (64-bit) 269s 269s R is free software and comes with ABSOLUTELY NO WARRANTY. 269s You are welcome to redistribute it under certain conditions. 269s Type 'license()' or 'licence()' for distribution details. 269s 269s R is a collaborative project with many contributors. 269s Type 'contributors()' for more information and 269s 'citation()' on how to cite R or R packages in publications. 269s 269s Type 'demo()' for some demos, 'help()' for on-line help, or 269s 'help.start()' for an HTML browser interface to help. 269s Type 'q()' to quit R. 269s 270s > source(file.path("_helper", "init.R")) 270s > 270s > # - "random seed" -------------------------------------------------------------- 270s > 270s > dir <- file.path(TMP.DIR, "randdir") 270s > dir.create(dir) 270s > file <- file.path(dir, "randtest.R") 270s > cat("sample(1:100)\n", file = file) 270s > set.seed(1) 270s > coi(unitize(file, auto.accept = "new")) 271s Warning in history_capt(history, interactive.mode) : 271s Unable to capture history in non-interactive mode. 271s | Auto-accepting changes... 271s | unitizer updated. 271s 271s > # changing seed should have no effect on result 271s > set.seed(23) 271s > coi(res <- unitize(file)) 271s Warning in history_capt(history, interactive.mode) : 271s Unable to capture history in non-interactive mode. 271s | 1/1 test passed; nothing to review. 271s 271s > # expect_equal(as.character(res$status), "Passed") 271s > as.character(res$status) 271s [1] "Passed" 271s > 271s > 271s PASS 271s Begin testing t-rename.R 271s 271s R version 4.3.2 (2023-10-31) -- "Eye Holes" 271s Copyright (C) 2023 The R Foundation for Statistical Computing 271s Platform: aarch64-unknown-linux-gnu (64-bit) 271s 271s R is free software and comes with ABSOLUTELY NO WARRANTY. 271s You are welcome to redistribute it under certain conditions. 271s Type 'license()' or 'licence()' for distribution details. 271s 271s R is a collaborative project with many contributors. 271s Type 'contributors()' for more information and 271s 'citation()' on how to cite R or R packages in publications. 271s 271s Type 'demo()' for some demos, 'help()' for on-line help, or 271s 'help.start()' for an HTML browser interface to help. 271s Type 'q()' to quit R. 271s 271s > source(file.path("_helper", "init.R")) 271s > 271s > # - "Rename Works" ------------------------------------------------------------- 271s > 271s > x <- readRDS("_helper/unitizers/trivial.unitizer/data.rds") 271s > x.edit <- editCalls(x, quote(x), quote(y), interactive.only = FALSE) 271s Warning in .local(x, lang.old, lang.new, ...) : 271s This is an experimental function; make sure you backup any unitizers before you edit them 271s > x.edit@items.ref.calls.deparse 271s [1] "TRUE" "y <- 1 + 1" "y + 2" "y <- y" "y * y" 271s [6] "y/y + 2" 271s > !identical(x@items.ref.calls.deparse, x.edit@items.ref.calls.deparse) 271s [1] TRUE 271s > identical( 271s + x.edit@items.ref.calls.deparse, 271s + gsub("\\bx\\b", "y", x@items.ref.calls.deparse) 271s + ) 271s [1] TRUE 271s > 271s > # warn 271s > unitizer:::read_line_set_vals("Y") 271s > x.edit2 <- editCalls(x, quote(x), quote(y), interactive.mode = TRUE) 271s Warning in .local(x, lang.old, lang.new, ...) : 271s This is an experimental function; make sure you backup any unitizers before you edit them 271s | Do you wish to proceed ([Y]es/[N]o)? 271s 271s unitizer> Y 271s > # message 271s > unitizer:::read_line_set_vals("N") 271s > x.edit3 <- editCalls(x, quote(x), quote(y), interactive.mode = TRUE) 271s Warning in .local(x, lang.old, lang.new, ...) : 271s This is an experimental function; make sure you backup any unitizers before you edit them 271s | Do you wish to proceed ([Y]es/[N]o)? 271s 271s unitizer> N 271s Exiting without edits 271s > identical(x.edit3, x) 271s [1] TRUE 271s > 271s > unitizer:::read_line_set_vals(NULL) 271s > x.edit@items.ref.calls.deparse 271s [1] "TRUE" "y <- 1 + 1" "y + 2" "y <- y" "y * y" 271s [6] "y/y + 2" 271s > 271s PASS 271s Begin testing t-repairenvs.R 271s 271s R version 4.3.2 (2023-10-31) -- "Eye Holes" 271s Copyright (C) 2023 The R Foundation for Statistical Computing 271s Platform: aarch64-unknown-linux-gnu (64-bit) 271s 271s R is free software and comes with ABSOLUTELY NO WARRANTY. 271s You are welcome to redistribute it under certain conditions. 271s Type 'license()' or 'licence()' for distribution details. 271s 271s R is a collaborative project with many contributors. 271s Type 'contributors()' for more information and 271s 'citation()' on how to cite R or R packages in publications. 271s 271s Type 'demo()' for some demos, 'help()' for on-line help, or 271s 'help.start()' for an HTML browser interface to help. 271s Type 'q()' to quit R. 271s 271s > source(file.path("_helper", "init.R")) 272s > 272s > exps <- expression(1 + 1, a <- 54, b <- 38, a + b, e <- 5 * a, 272s + a^2, f <- e * a, matrix(rep(f, 20))) 272s > my.unitizer <- new("unitizer", id = 1, zero.env = new.env()) 272s > # add ref.exps as new items 272s > coi(my.unitizer <- my.unitizer + exps) 272s > my.unitizer2 <- new("unitizer", id = 2, zero.env = new.env()) 272s > # now convert them to reference items 272s > coi(my.unitizer2 <- my.unitizer2 + my.unitizer@items.new) 272s > # - "messed up env ancestry repair works" -------------------------------------- 272s > 272s > # Purposefully mess up the environments 272s > parent.env(my.unitizer2@items.ref[[2]]@env) <- baseenv() 272s > x <- unitizer:::healEnvs(my.unitizer2@items.ref, my.unitizer2) 272s Error in parent.env(env) : the empty environment has no parent 272s Error in run_ls(env = x@env, stop.env = base.env, all.names = TRUE, store.env = ref.env.store) : 272s Specified `stop.env` does not appear to be in parent environments. 272s Warning in repairEnvs(items.final) : 272s Detected corrupted environment history; we will attempt to repair, but keep in mind that even when repaired the test environments may be missleading. For example, the objects other than `.new` or `.ref` when reviewing tests at the `unitzer` prompt may not be those you expect or those reported by `ls`. To fully restore environments re-unitize with `unitize(..., force.update=TRUE)`. If errors persist after an attempt to repair, please contact maintainer. 272s > old.opt <- options(unitizer.max.env.depth = 20) 272s > res <- unitizer:::healEnvs(my.unitizer2@items.ref, my.unitizer2) 272s Error in try(while (!identical(env, stop.env)) { : 272s Logic error: not finding `stop.env` after 20 iterations; contact package maintainer if this is an error. 272s Error in run_ls(env = x@env, stop.env = base.env, all.names = TRUE, store.env = ref.env.store) : 272s Specified `stop.env` does not appear to be in parent environments. 272s Warning in repairEnvs(items.final) : 272s Detected corrupted environment history; we will attempt to repair, but keep in mind that even when repaired the test environments may be missleading. For example, the objects other than `.new` or `.ref` when reviewing tests at the `unitzer` prompt may not be those you expect or those reported by `ls`. To fully restore environments re-unitize with `unitize(..., force.update=TRUE)`. If errors persist after an attempt to repair, please contact maintainer. 272s > is(res, "unitizerItems") 272s [1] TRUE 272s > ref.anc <- unitizer:::env_ancestry(x@base.env) 272s > itm.anc <- unitizer:::env_ancestry(x[[1L]]@env) 272s > # Items should belong to base env for reference 272s > identical(rev(ref.anc), head(rev(itm.anc), length(ref.anc))) 272s [1] TRUE 272s > options(old.opt) 272s > 272s > # - "re-assigning to ignored environments handled properly" -------------------- 272s > 272s > # now `a + b` could try to re-assign to `a <- 54`, but that is same env as 272s > # `a + b` b/c it is ignored 272s > items.picked <- my.unitizer@items.new[-3L] 272s > # expect_error(items.heal <- unitizer:::healEnvs(items.picked, 272s > # my.unitizer), NA) 272s > # no error 272s > items.heal <- unitizer:::healEnvs(items.picked, my.unitizer) 272s > 272s > # - "full repair process works" ------------------------------------------------ 272s > 272s > # copy files and then try messing up environment for the object 272s > file_test("-d", file.path("_helper")) 272s [1] TRUE 272s > store <- file.path("_helper", "unitizers", "trivial.unitizer") 272s > store.new <- file.path(TMP.DIR, store) 272s > dir.create(store.new, recursive = TRUE) 272s > cpy.files <- c( 272s + list.files(store, full.names = TRUE), 272s + file.path("helper", "unitizers", "trivial.R") 272s + ) 272s > file.copy(cpy.files, file.path(TMP.DIR, cpy.files), overwrite = TRUE) 272s [1] TRUE FALSE 272s > 272s > untz <- unitizer:::load_unitizers( 272s + list(store.new), NA_character_, 272s + par.frame = .GlobalEnv, interactive.mode = TRUE, mode = "unitize", 272s + show.progress=0L, transcript=FALSE 272s + ) 272s Warning in unitizer:::load_unitizers(list(store.new), NA_character_, par.frame = .GlobalEnv, : 272s Upgraded test file does not match original test file ('trivial.R' vs 'NA'). 272s Warning in .Object$initialize(...) : 272s Instantiated global object without global namespace registry; you should only see this warning you are using `repair_environments`. 272s > # Break env chain, store, and reload 272s > untz[[1L]]@items.ref.calls.deparse[[5L]] 272s [1] "y * x" 272s > parent.env(untz[[1L]]@items.ref[[5L]]@env) <- baseenv() 272s > # warning 272s > unitizer:::store_unitizer(untz[[1L]]) 272s | unitizer updated. 272s 272s > untz.rep <- repair_environments(store.new) 272s Warning in .Object$initialize(...) : 272s Instantiated global object without global namespace registry; you should only see this warning you are using `repair_environments`. 272s Warning in repairEnvs(x@items.ref) : 272s Detected corrupted environment history; we will attempt to repair, but keep in mind that even when repaired the test environments may be missleading. For example, the objects other than `.new` or `.ref` when reviewing tests at the `unitzer` prompt may not be those you expect or those reported by `ls`. To fully restore environments re-unitize with `unitize(..., force.update=TRUE)`. If errors persist after an attempt to repair, please contact maintainer. 272s | unitizer updated. 272s 272s > # this should not give warnings 272s > unitizer:::healEnvs(untz.rep@items.ref, untz.rep) 272s An object of class "unitizerItems" 272s Slot "base.env": 272s 272s 272s Slot ".items": 272s [[1]] 272s ~~~ Reference Test ~~~ 272s TRUE 272s * value: logi[1] 272s * output: 9 chars 272s 272s Access components with `$`, e.g. `.REF$value`; see `help("$", "unitizer")` 272s 272s [[2]] 272s ~~~ Reference Test ~~~ 272s x <- 1 + 1 272s * value: unitizerDummy 272s 272s Access components with `$`, e.g. `.REF$value`; see `help("$", "unitizer")` 272s 272s [[3]] 272s ~~~ Reference Test ~~~ 272s x + 2 272s * value: num[1] 272s * output: 6 chars 272s 272s Access components with `$`, e.g. `.REF$value`; see `help("$", "unitizer")` 272s 272s [[4]] 272s ~~~ Reference Test ~~~ 272s y <- x 272s * value: unitizerDummy 272s 272s Access components with `$`, e.g. `.REF$value`; see `help("$", "unitizer")` 272s 272s [[5]] 272s ~~~ Reference Test ~~~ 272s y * x 272s * value: num[1] 272s * output: 6 chars 272s 272s Access components with `$`, e.g. `.REF$value`; see `help("$", "unitizer")` 272s 272s [[6]] 272s ~~~ Reference Test ~~~ 272s y/x + 2 272s * value: num[1] 272s * output: 6 chars 272s 272s Access components with `$`, e.g. `.REF$value`; see `help("$", "unitizer")` 272s 272s 272s Slot ".pointer": 272s [1] 0 272s 272s Slot ".seek.fwd": 272s [1] TRUE 272s 272s > 272s > 272s PASS 272s Begin testing t-search.R 272s 272s R version 4.3.2 (2023-10-31) -- "Eye Holes" 272s Copyright (C) 2023 The R Foundation for Statistical Computing 272s Platform: aarch64-unknown-linux-gnu (64-bit) 272s 272s R is free software and comes with ABSOLUTELY NO WARRANTY. 272s You are welcome to redistribute it under certain conditions. 272s Type 'license()' or 'licence()' for distribution details. 272s 272s R is a collaborative project with many contributors. 272s Type 'contributors()' for more information and 272s 'citation()' on how to cite R or R packages in publications. 272s 272s Type 'demo()' for some demos, 'help()' for on-line help, or 272s 'help.start()' for an HTML browser interface to help. 272s Type 'q()' to quit R. 272s 272s > source(file.path("_helper", "init.R")) 273s > source(file.path("_helper", "pkgs.R")) 273s Install Packages 276s Setup Demos 276s > 276s > unitizer.dummy.list <- list(A = 1, B = 2, C = 3) 276s > unitizer.dummy.list.2 <- list(A = 13, B = 24, C = 35) 276s > # can't unload `unitizer`, ruins `covr` 276s > try(detach("package:unitizer"), silent = TRUE) 276s > try(detach("package:unitizerdummypkg1", unload = TRUE), silent = TRUE) 276s > try(detach("package:unitizerdummypkg2", unload = TRUE), silent = TRUE) 276s > while ("unitizer.dummy.list" %in% search()) try(detach("unitizer.dummy.list")) 276s > state.set <- setNames(rep(2L, length(unitizer:::.unitizer.global.settings.names)), 276s + unitizer:::.unitizer.global.settings.names) 276s > library(unitizer) 276s > library(unitizerdummypkg1, lib.loc = TMP.LIB) 276s > library(unitizerdummypkg2, lib.loc = TMP.LIB) 276s > 276s > # - "Detecting packages" ------------------------------------------------------- 276s > 276s > unitizer:::is.loaded_package("package:unitizer") 276s [1] TRUE 276s > unitizer:::is.loaded_package("unitizer") # FALSE 276s [1] FALSE 276s > unitizer:::is.loaded_package("package:stats") 276s [1] TRUE 276s > try(unitizer:::is.loaded_package(1)) 276s Error in unitizer:::is.loaded_package(1) : 276s Argument `pkg.name` must be character 1L 276s > try(unitizer:::is.loaded_package(letters)) 276s Error in unitizer:::is.loaded_package(letters) : 276s Argument `pkg.name` must be character 1L 276s > unitizer:::is.loaded_package("Autoloads") # FALSE 276s [1] FALSE 276s > is.list(pkg.dat <- unitizer:::get_package_data()) 276s [1] TRUE 276s > all( 276s + vapply( 276s + pkg.dat, function(x) is.list(x) && identical(names(x), 276s + c("names", "lib.loc", "version")), logical(1L) 276s + ) ) 276s [1] TRUE 276s > 276s > # - "Path Compression" --------------------------------------------------------- 276s > 276s > search.init.full <- unitizer:::search_as_envs() 276s > search.init <- search.init.full$search.path 276s > 276s > head(unitizer:::compress_search_data(search.init.full), 3L) 276s [1] ".GlobalEnv" "package:unitizerdummypkg2 (v0.1)" 276s [3] "package:unitizerdummypkg1 (v0.1)" 276s > 276s > # - "Moving Objects on Search Path Works" -------------------------------------- 276s > 276s > if (length(search.init) < 6L) stop("Unexpetedly short search path") 276s > untz.glob <- unitizer:::unitizerGlobal$new(enable.which = state.set, 276s + set.global = TRUE) 276s > 276s > try(unitizer:::move_on_path(5L, 2L, untz.glob)) 276s Error in unitizer:::move_on_path(5L, 2L, untz.glob) : 276s old.pos > new.pos is not TRUE 276s > try(unitizer:::move_on_path(1L, 2L, untz.glob)) 276s Error in unitizer:::move_on_path(1L, 2L, untz.glob) : 276s new.pos > 1L is not TRUE 276s > unitizer:::move_on_path(2L, 5L, untz.glob) 276s > # can't compare actual environments as they change when detached and 276s > # re-attached 276s > 276s > all.equal( 276s + names(unitizer:::search_as_envs()$search.path), 276s + names(search.init[c(1L, 5L, 2L:4L, 6L:length(search.init))]) 276s + ) 276s [1] TRUE 276s > # Now let's undo the previous move, by pushing second pack back to 276s > # original position 276s > for (i in rep(5L, 3L)) unitizer:::move_on_path(2L, 5L, untz.glob) 276s > unitizer:::search_dat_equal(unitizer:::search_as_envs(), search.init.full) 276s [1] TRUE 276s > untz.glob$release() 276s > 276s > # - "Search Path Journaling Works" --------------------------------------------- 276s > 276s > try(detach("package:unitizer"), silent = TRUE) 276s > try(detach("package:unitizerdummypkg1", unload = TRUE), silent = TRUE) 276s > try(detach("package:unitizerdummypkg2", unload = TRUE), silent = TRUE) 276s > library(unitizer) 276s > # Initialize a global tracking object. Doing it funny here because we don't 276s > # want to run the search_path_trim command yet, and that would happen if we 276s > # did a normal init 276s > # will be modified later 276s > search.ref <- NULL 276s > search.init <- unitizer:::search_as_envs() 276s > untz.glob <- unitizer:::unitizerGlobal$new(enable.which = state.set, 276s + set.global = TRUE) 276s > 276s > stat.tpl <- new("unitizerGlobalStatus", search.path = 2L, working.directory = 2L, 276s + options = 2L, random.seed = 2L, namespaces = 2L) 276s > # these need to be done outside of `test_that` b/c `test_that` sets the 276s > # rlang_trace_top_env option 276s > st.0 <- untz.glob$indices.last 276s > st.1 <- untz.glob$state() 276s > 276s > # Note, these are intended to be run without the shimming in place 276s > identical(untz.glob$status, stat.tpl) 276s [1] TRUE 276s > 276s > # state should only be recorded if it changes 276s > st.0 276s An object of class "unitizerGlobalIndices" 276s Slot "search.path": 276s [1] 1 276s 276s Slot "options": 276s [1] 1 276s 276s Slot "working.directory": 276s [1] 1 276s 276s Slot "random.seed": 276s [1] 1 276s 276s Slot "namespaces": 276s [1] 1 276s 276s > identical(st.0, st.1) 276s [1] TRUE 276s > # Add a package 276s > library("unitizerdummypkg1", lib.loc = TMP.LIB) 276s > st.2 <- untz.glob$state() 276s > # have two recorded states 276s > st.2@search.path 276s [1] 2 276s > # should have one more item 276s > diff(sapply(untz.glob$tracking@search.path, function(x) length(x$search.path))) 276s [1] 1 276s > environmentName(untz.glob$tracking@search.path[[2L]]$search.path[[2L]]) 276s [1] "package:unitizerdummypkg1" 276s > sp.tmp <- untz.glob$tracking@search.path 276s > # note we compare attribute separately because subsetting drops them 276s > identical(sp.tmp[[1L]]$search.path, sp.tmp[[2L]]$search.path[-2L]) 276s [1] TRUE 276s > 276s > identical( 276s + sp.tmp[[1L]]$ns.dat, 276s + sp.tmp[[2L]]$ns.dat[names(sp.tmp[[2L]]$ns.dat) != "unitizerdummypkg1"] 276s + ) 276s [1] TRUE 276s > # Add another package at a different position 276s > library("unitizerdummypkg2", pos = 4L, lib.loc = TMP.LIB) 276s > st.3 <- untz.glob$state() 276s > diff(sapply(untz.glob$tracking@search.path, function(x) length(x$search.path))) 276s [1] 1 1 276s > environmentName( 276s + untz.glob$tracking@search.path[[st.3@search.path]]$search.path[[4L]] 276s + ) 276s [1] "package:unitizerdummypkg2" 276s > # Attach a list 276s > attach(unitizer.dummy.list) 276s > search.ref <- untz.glob$state() 276s > environmentName( 276s + untz.glob$tracking@search.path[[search.ref@search.path]]$search.path[[2L]] 276s + ) 276s [1] "unitizer.dummy.list" 276s > identical( 276s + as.list( 276s + untz.glob$tracking@search.path[[search.ref@search.path]]$search.path[[2L]] 276s + ), 276s + unitizer.dummy.list 276s + ) 276s [1] TRUE 276s > # And one more, but modified 276s > unitizer.dummy.list.2 <- list(A = 13, B = 24, C = 35) 276s > attach(unitizer.dummy.list.2, pos = 4L, name = "unitizer.dummy.list") 276s The following objects are masked _by_ unitizer.dummy.list (pos = 2): 276s 276s A, B, C 276s 276s > st.4 <- untz.glob$state() 276s > curr.sp.ind <- untz.glob$indices.last@search.path 276s > environmentName(untz.glob$tracking@search.path[[curr.sp.ind]]$search.path[[4L]]) 276s [1] "unitizer.dummy.list" 276s > # Make sure search path is lining up 276s > all.equal( 276s + names(untz.glob$tracking@search.path[[curr.sp.ind]]$search.path), search() 276s + ) 276s [1] TRUE 276s > identical( 276s + as.list(untz.glob$tracking@search.path[[curr.sp.ind]]$search.path[[4L]]), 276s + unitizer.dummy.list.2 276s + ) 276s [1] TRUE 276s > identical( 276s + as.list(untz.glob$tracking@search.path[[curr.sp.ind]]$search.path[[2L]]), 276s + unitizer.dummy.list 276s + ) 276s [1] TRUE 276s > # should still point to same environment 276s > identical( 276s + untz.glob$tracking@search.path[[curr.sp.ind - 1L]]$search.path[[2L]], 276s + untz.glob$tracking@search.path[[curr.sp.ind]]$search.path[[2L]] 276s + ) 276s [1] TRUE 276s > # state shouldn't have changed 276s > identical(untz.glob$state(), st.4) 276s [1] TRUE 276s > 276s > # detach some stuff 276s > # this is the first list 276s > detach(2L) 276s > untz.glob$state() 276s An object of class "unitizerGlobalIndices" 276s Slot "search.path": 276s [1] 6 276s 276s Slot "options": 276s [1] 1 276s 276s Slot "working.directory": 276s [1] 1 276s 276s Slot "random.seed": 276s [1] 1 276s 276s Slot "namespaces": 276s [1] 3 276s 276s > curr.sp.ind <- untz.glob$indices.last@search.path 276s > identical( 276s + untz.glob$tracking@search.path[[curr.sp.ind]]$search.path, 276s + untz.glob$tracking@search.path[[curr.sp.ind - 1L]]$search.path[-2L] 276s + ) 276s [1] TRUE 276s > detach("package:unitizerdummypkg2") 276s > untz.glob$state() 276s An object of class "unitizerGlobalIndices" 276s Slot "search.path": 276s [1] 7 276s 276s Slot "options": 276s [1] 1 276s 276s Slot "working.directory": 276s [1] 1 276s 276s Slot "random.seed": 276s [1] 1 276s 276s Slot "namespaces": 276s [1] 3 276s 276s > curr.sp.ind <- untz.glob$indices.last@search.path 276s > identical( 276s + untz.glob$tracking@search.path[[curr.sp.ind]]$search.path, 276s + untz.glob$tracking@search.path[[curr.sp.ind - 1L]]$search.path[-5L] 276s + ) 276s [1] TRUE 276s > 276s > # - "Resetting search path" ---------------------------------------------------- 276s > 276s > identical( 276s + as.list(as.environment("unitizer.dummy.list")), unitizer.dummy.list.2 276s + ) 276s [1] TRUE 276s > # set to just after we added the original dummy list 276s > untz.glob$reset(search.ref) 276s An object of class "unitizerGlobalIndices" 276s Slot "search.path": 276s [1] 4 276s 276s Slot "options": 276s [1] 1 276s 276s Slot "working.directory": 276s [1] 1 276s 276s Slot "random.seed": 276s [1] 1 276s 276s Slot "namespaces": 276s [1] 3 276s 276s > identical(as.list(as.environment("unitizer.dummy.list")), unitizer.dummy.list) 276s [1] TRUE 276s > # Confirm we actually set to expected path 276s > # NOTE: not sure if with updates this can work 276s > all.equal( 276s + names(unitizer:::search_as_envs()$search.path), 276s + names(untz.glob$tracking@search.path[[search.ref@search.path]]$search.path) 276s + ) 276s [1] TRUE 276s > # Reset to very beginning 276s > untz.glob$resetFull() 276s An object of class "unitizerGlobalIndices" 276s Slot "search.path": 276s [1] 1 276s 276s Slot "options": 276s [1] 1 276s 276s Slot "working.directory": 276s [1] 1 276s 276s Slot "random.seed": 276s [1] 1 276s 276s Slot "namespaces": 276s [1] 1 276s 276s > untz.glob$release() 276s > # compare with all.equal to make sure we use S4 method 276s > unitizer:::search_dat_equal(unitizer:::search_as_envs(), search.init) 276s [1] TRUE 276s > 276s > # - "Search Path Trim / Restore" ----------------------------------------------- 276s > 276s > search.init <- unitizer:::search_as_envs() 276s > untz.glob <- unitizer:::unitizerGlobal$new(enable.which = state.set, 276s + set.global = TRUE) 276s > library(unitizerdummypkg1, lib.loc = TMP.LIB) 276s > library(unitizerdummypkg2, lib.loc = TMP.LIB) 276s > unitizer:::search_path_trim(global = untz.glob) 276s > untz.glob$state() 276s An object of class "unitizerGlobalIndices" 276s Slot "search.path": 276s [1] 2 276s 276s Slot "options": 276s [1] 1 276s 276s Slot "working.directory": 276s [1] 1 276s 276s Slot "random.seed": 276s [1] 1 276s 276s Slot "namespaces": 276s [1] 2 276s 276s > sp.keep <- unitizer:::keep_sp_default() 276s > identical( 276s + search(), 276s + sp.keep[match(names(search.init$search.path), sp.keep, nomatch = 0L)] 276s + ) 276s [1] TRUE 276s > untz.glob$resetFull() 276s An object of class "unitizerGlobalIndices" 276s Slot "search.path": 276s [1] 1 276s 276s Slot "options": 276s [1] 1 276s 276s Slot "working.directory": 276s [1] 1 276s 276s Slot "random.seed": 276s [1] 1 276s 276s Slot "namespaces": 276s [1] 1 276s 276s > untz.glob$release() 276s > unitizer:::search_dat_equal(unitizer:::search_as_envs(), search.init) 276s [1] TRUE 276s > try(detach("package:unitizerdummypkg1", unload = TRUE), silent = TRUE) 276s > try(detach("package:unitizerdummypkg2", unload = TRUE), silent = TRUE) 276s > while ("unitizer.dummy.list" %in% search()) try(detach("unitizer.dummy.list")) 276s > 276s > # - "Loaded Namespaces don't cause issues" ------------------------------------- 276s > 276s > # had a problem earlier trying to re-attach namespaces 276s > loadNamespace("unitizerdummypkg1", lib.loc = TMP.LIB) 276s 276s > untz.glob <- unitizer:::unitizerGlobal$new(enable.which = state.set, 276s + set.global = TRUE) 276s > unitizer:::search_path_trim(global = untz.glob) 276s > unitizer:::namespace_trim(global = untz.glob) 276s > untz.glob$state() 276s An object of class "unitizerGlobalIndices" 276s Slot "search.path": 276s [1] 2 276s 276s Slot "options": 276s [1] 1 276s 276s Slot "working.directory": 276s [1] 1 276s 276s Slot "random.seed": 276s [1] 1 276s 276s Slot "namespaces": 276s [1] 2 276s 276s > loadNamespace("unitizerdummypkg2", lib.loc = TMP.LIB) 276s 276s > untz.glob$state() 276s An object of class "unitizerGlobalIndices" 276s Slot "search.path": 276s [1] 3 276s 276s Slot "options": 276s [1] 1 276s 276s Slot "working.directory": 276s [1] 1 276s 276s Slot "random.seed": 276s [1] 1 276s 276s Slot "namespaces": 276s [1] 3 276s 276s > "unitizerdummypkg1" %in% loadedNamespaces() # FALSE 276s [1] FALSE 276s > "unitizerdummypkg2" %in% loadedNamespaces() 276s [1] TRUE 276s > untz.glob$resetFull() 276s An object of class "unitizerGlobalIndices" 276s Slot "search.path": 276s [1] 1 276s 276s Slot "options": 276s [1] 1 276s 276s Slot "working.directory": 276s [1] 1 276s 276s Slot "random.seed": 276s [1] 1 276s 276s Slot "namespaces": 276s [1] 1 276s 276s > untz.glob$release() 276s > "unitizerdummypkg1" %in% loadedNamespaces() 276s [1] TRUE 276s > "unitizerdummypkg2" %in% loadedNamespaces() # FALSE 276s [1] FALSE 276s > unloadNamespace("unitizerdummypkg1") 276s > 276s > # - "Prevent Namespace Unload Works" ------------------------------------------- 276s > 276s > old.opt <- options(unitizer.namespace.keep = "unitizerdummypkg1") 276s > loadNamespace("unitizerdummypkg1", lib.loc = TMP.LIB) 276s 276s > glb <- unitizer:::unitizerGlobal$new(set.global = TRUE) 276s > glb$status@options <- 2L 276s > unitizer:::unload_namespaces("unitizerdummypkg1", global = glb) 276s NULL 276s > glb$ns.opt.conflict@conflict 276s [1] TRUE 276s > glb$ns.opt.conflict@namespaces 276s [1] "unitizerdummypkg1" 276s > unloadNamespace("unitizerdummypkg1") 276s > options(old.opt) 276s > glb$release() 276s > 276s > # - "Generate unique names" ---------------------------------------------------- 276s > 276s > unitizer:::unitizerUniqueNames(list(search.path = c(goodbye = "0", 276s + hello = "1", goodbye = "2", goodbye = "3"))) 276s [1] "goodbye" "hello" "goodbye.1" "goodbye.2" 276s > 276s > # - "Fake Package Re-attach" --------------------------------------------------- 276s > 276s > # Make sure that aspects of search path management other than search path 276s > # survive a failure caused by bad search path env (#252, #253). 276s > 276s > owd <- getwd() 276s > test.f <- paste0(tempfile(), ".R") 276s > writeLines(" 276s + f <- tempfile() 276s + dir.create(f) 276s + setwd(f) 276s + # Package assumed non-existing; R could disallow this in the future 276s + # which could change the test. 276s + attach(list(x=42), name='package:adfaadcxuqyojfnkfadsf') 276s + 1 + 1", test.f) 276s > out <- unitizer:::capture_output( 276s + try(unitize(test.f, state='recommended', interactive.mode=FALSE)) 276s + ) 277s > any(grepl("mismatch between actual search path and tracked", out$message)) 277s [1] TRUE 277s > identical(owd, getwd()) # confirm working directory restored 277s [1] TRUE 277s > 277s > 277s PASS 277s Begin testing t-section.R 277s 277s R version 4.3.2 (2023-10-31) -- "Eye Holes" 277s Copyright (C) 2023 The R Foundation for Statistical Computing 277s Platform: aarch64-unknown-linux-gnu (64-bit) 277s 277s R is free software and comes with ABSOLUTELY NO WARRANTY. 277s You are welcome to redistribute it under certain conditions. 277s Type 'license()' or 'licence()' for distribution details. 277s 277s R is a collaborative project with many contributors. 277s Type 'contributors()' for more information and 277s 'citation()' on how to cite R or R packages in publications. 277s 277s Type 'demo()' for some demos, 'help()' for on-line help, or 277s 'help.start()' for an HTML browser interface to help. 277s Type 'q()' to quit R. 277s 277s > source(file.path("_helper", "init.R")) 277s > 277s > expr.1 <- expression(1 + 1, b <- 5, matrix(integer(), nrow = b, 277s + ncol = b)) 277s > expr.2 <- { 277s + 1 + 1 277s + b <- 5 277s + matrix(integer(), nrow = b, ncol = b) 277s + } 277s > expr.3 <- quote(expression(1 + 1, b <- 5, matrix(integer(), nrow = b, 277s + ncol = b))) 277s > expr.4 <- quote({ 277s + 1 + 1 277s + b <- 5 277s + matrix(integer(), nrow = b, ncol = b) 277s + }) 277s > # - "simple tests" ------------------------------------------------------------- 277s > 277s > try(unitizer_sect(1:3)) 277s Error in unitizer_sect(1:3) : 277s Argument `title` must be a 1 length character vector. 277s > try(unitizer_sect(letters)) 277s Error in unitizer_sect(letters) : 277s Argument `title` must be a 1 length character vector. 277s > try(unitizer_sect("mytest", expr.1, 1:3)) 277s Error in unitizer_sect("mytest", expr.1, 1:3) : 277s Argument `details` must be character 277s > # note the following two produce error messages, but it's not actually an error, 277s > # it's just that there are multiple errors and `expect_error` only suppresses 277s > # the last one, not the preceding ones. 277s > try(unitizer_sect("mytest", expr.1, letters, letters)) 277s Error in unitizer_sect("mytest", expr.1, letters, letters) : 277s Argument `compare` must be "testFuns" or a function 277s > try(unitizer_sect("mytest", expr.1, letters, identity)) 277s Error in unitizer_sect("mytest", expr.1, letters, identity) : 277s Argument `compare`, if a function, must accept two arguments and require no more than two (does not have at least two arguments) 277s > try(unitizer_sect("mytest", expr.2)) 277s Error in unitizer_sect("mytest", expr.2) : 277s Argument `expr` must be an expression, or an unevaluated call that evaluates to an expression or `{`. 277s > try(unitizer_sect("mytest", matrix(1:9, nrow = 3))) 277s Error in unitizer_sect("mytest", matrix(1:9, nrow = 3)) : 277s Argument `expr` must be an expression, or an unevaluated call that evaluates to an expression or `{`. 277s > is(sect.1 <- unitizer_sect("mytest", expr.1), "unitizerSectionExpression") 277s [1] TRUE 277s > identical(unitizer:::as.expression(sect.1), expr.1) 277s [1] TRUE 277s > 277s > is(sect.2 <- unitizer_sect("mytest", { 277s + 1 + 1 277s + b <- 5 277s + matrix(integer(), nrow = b, ncol = b) 277s + }), "unitizerSectionExpression") 277s [1] TRUE 277s > identical(sect.1, sect.2) 277s [1] TRUE 277s > is(sect.3 <- unitizer_sect("mytest", expr.3), "unitizerSectionExpression") 277s [1] TRUE 277s > identical(sect.1, sect.3) 277s [1] TRUE 277s > is(sect.4 <- unitizer_sect("mytest", expr.4), "unitizerSectionExpression") 277s [1] TRUE 277s > identical(sect.1, sect.4) 277s [1] TRUE 277s > is(sect.5 <- unitizer_sect("mytest", expression(1 + 1, 277s + b <- 5, matrix(integer(), nrow = b, ncol = b))), "unitizerSectionExpression") 277s [1] TRUE 277s > identical(sect.1, sect.5) 277s [1] TRUE 277s > is(sect.1 <- unitizer_sect("mytest", expr.1, compare = identical), 277s + "unitizerSectionExpression") 277s [1] TRUE 277s > unitizer_sect("hello") # warn 277s Warning in unitizer_sect("hello") : `unitizer_sect` "hello" is empty. 277s NULL 277s > 277s > # - "Custom Comparison Functions" ---------------------------------------------- 277s > 277s > # Run expressions with different comparison functions 277s > set.seed(1) 277s > expr.1 <- expression(50 + runif(1)/10^10, message("Hello There", 277s + runif(1)), cat("Hello there", runif(1)), stop("Yo", runif(1))) 277s > expr.2 <- expression(50 + runif(1)/10^10, message("Hello There", 277s + runif(1)), cat("Hello there", runif(1)), stop("Yo", runif(1))) 277s > expr.3 <- expression(unitizer_sect("change comp funs", compare = identical, 277s + { 277s + 50 + runif(1)/10^10 277s + message("Hello There", runif(1)) 277s + cat("Hello there", runif(1)) 277s + stop("Yo", runif(1)) 277s + })) 277s > expr.4 <- expression( 277s + unitizer_sect( 277s + "change comp funs", 277s + compare = testFuns( 277s + value = identical, output = all.equal, message = all.equal, 277s + conditions = function(x, y) TRUE), 277s + { 277s + 50 + runif(1)/10^10 277s + message("Hello There", runif(1)) 277s + cat("Hello there", runif(1)) 277s + stop("Yo", runif(1)) 277s + })) 277s > my.unitizer <- new("unitizer", id = 1, zero.env = new.env()) 277s > coi(my.unitizer <- my.unitizer + expr.1) 277s > my.unitizer2 <- new("unitizer", id = 2, zero.env = new.env()) 277s > # make previous items into reference items 277s > coi(my.unitizer2 <- my.unitizer2 + my.unitizer@items.new) 277s > # now add back items to compare 277s > coi(my.unitizer2 <- my.unitizer2 + expr.2) 277s > my.unitizer3 <- new("unitizer", id = 3, zero.env = new.env()) 277s > # make previous items into reference items 277s > coi(my.unitizer3 <- my.unitizer3 + my.unitizer@items.new) 277s > # now add back items to compare 277s > coi(my.unitizer3 <- my.unitizer3 + expr.3) 277s > my.unitizer4 <- new("unitizer", id = 4, zero.env = new.env()) 277s > # make previous items into reference items 277s > coi(my.unitizer4 <- my.unitizer4 + my.unitizer@items.new) 277s > # now add back items to compare 277s > coi(my.unitizer4 <- my.unitizer4 + expr.4) 277s > 277s > my.unitizer2@tests.result 277s value conditions output message aborted 277s [1,] TRUE TRUE TRUE TRUE TRUE 277s [2,] TRUE FALSE TRUE TRUE TRUE 277s [3,] TRUE TRUE TRUE TRUE TRUE 277s [4,] TRUE FALSE TRUE TRUE TRUE 277s > my.unitizer3@tests.result 277s value conditions output message aborted 277s [1,] FALSE TRUE TRUE TRUE TRUE 277s [2,] TRUE FALSE TRUE TRUE TRUE 277s [3,] TRUE TRUE TRUE TRUE TRUE 277s [4,] TRUE FALSE TRUE TRUE TRUE 277s > my.unitizer4@tests.result 277s value conditions output message aborted 277s [1,] FALSE TRUE TRUE TRUE TRUE 277s [2,] TRUE TRUE TRUE FALSE TRUE 277s [3,] TRUE TRUE FALSE TRUE TRUE 277s [4,] TRUE TRUE TRUE FALSE TRUE 277s > 277s > 277s PASS 277s Begin testing t-shim.R 277s 277s R version 4.3.2 (2023-10-31) -- "Eye Holes" 277s Copyright (C) 2023 The R Foundation for Statistical Computing 277s Platform: aarch64-unknown-linux-gnu (64-bit) 277s 277s R is free software and comes with ABSOLUTELY NO WARRANTY. 277s You are welcome to redistribute it under certain conditions. 277s Type 'license()' or 'licence()' for distribution details. 277s 277s R is a collaborative project with many contributors. 277s Type 'contributors()' for more information and 277s 'citation()' on how to cite R or R packages in publications. 277s 277s Type 'demo()' for some demos, 'help()' for on-line help, or 277s 'help.start()' for an HTML browser interface to help. 277s Type 'q()' to quit R. 277s 278s > source(file.path("aammrtf", "mock.R")) 278s > source(file.path("_helper", "init.R")) 278s > source(file.path("_helper", "pkgs.R")) 278s Install Packages 281s Setup Demos 281s > 281s > old.state <- tracingState(TRUE) 281s > 281s > # - "trace_at_end" ------------------------------------------------------------- 281s > 281s > if (is(unitizer:::trace_test_fun, "functionWithTrace")) 281s + untrace("trace_test_fun", where = asNamespace("unitizer")) 281s > unitizer:::trace_at_end("trace_test_fun", quote(if (!inherits(.res, 281s + "try-error")) cat(sprintf("x: %d\n", .res$value))), print = FALSE, 281s + where = asNamespace("unitizer")) 281s Tracing function "trace_test_fun" in package "namespace:unitizer" 281s > coi(unitizer:::trace_test_fun()) 281s > tracingState(FALSE) 281s [1] TRUE 281s > identical(capture.output(unitizer:::trace_test_fun()), character()) 281s [1] TRUE 281s > tracingState(TRUE) 281s [1] FALSE 281s > 281s > err <- try(unitizer:::trace_test_fun(stop("hello")), silent = TRUE) 281s > cond <- attr(err, "condition") 281s > conditionMessage(cond) 281s [1] "hello" 281s > conditionCall(cond) 281s unitizer:::trace_test_fun(stop("hello")) 281s > # return/missing etc. corner cases 281s > f <- function(x, y, z = 5) { 281s + if (missing(x)) { 281s + return(TRUE) 281s + } 281s + else if (z > 5) { 281s + stop("OMG, z > 5") 281s + } 281s + else if (identical(substitute(y), "hey")) { 281s + "substitute!" 281s + } 281s + else FALSE 281s + } 281s > unitizer:::trace_at_end("f", quote(cat("hello\n")), FALSE, environment()) 281s > res <- f() 281s hello 281s > res 281s [1] TRUE 281s > res2 <- f(1) 281s hello 281s > res2 # FALSE 281s [1] FALSE 281s > err <- try(f(1, z = 6), silent = TRUE) 281s hello 281s > is(err, "try-error") 281s [1] TRUE 281s > attr(err, "condition") 281s 5> 281s > res3 <- f(1, y = "hey") 281s hello 281s > res3 281s [1] "substitute!" 281s > 281s > # - "Parent Env Stays on Top" -------------------------------------------------- 281s > 281s > try(detach("package:unitizerdummypkg1", unload = TRUE), silent = TRUE) 281s > while ("unitizer.dummy.list" %in% search()) try(detach("unitizer.dummy.list")) 281s > unitizer.dummy.list <- list(z = 23, x = 1, y = "hello") 281s > my.env <- new.env() 281s > state.set <- c(search.path = 2L) 281s > # make sure to unset this at end 281s > untz.glob <- unitizer:::unitizerGlobal$new(par.env = my.env, 281s + enable.which = state.set, set.global = TRUE) 281s > untz.glob$shimFuns() 281s [1] TRUE 281s > sp <- search() 281s > curr2 <- sp[[2L]] 281s > 281s > 281s > identical(environmentName(parent.env(my.env)), curr2) 281s [1] TRUE 281s > library("unitizerdummypkg1", lib.loc = TMP.LIB) 281s > identical(environmentName(parent.env(my.env)), "package:unitizerdummypkg1") 281s [1] TRUE 281s > attach(unitizer.dummy.list) 281s > identical(environmentName(parent.env(my.env)), "unitizer.dummy.list") 281s [1] TRUE 281s > detach("unitizer.dummy.list") 281s > identical(environmentName(parent.env(my.env)), "package:unitizerdummypkg1") 281s [1] TRUE 281s > detach("package:unitizerdummypkg1", unload = TRUE) 281s > identical(environmentName(parent.env(my.env)), curr2) 281s [1] TRUE 281s > untz.glob$checkShims() 281s [1] TRUE 281s > 281s > # - "Parent env tracking with search path manip" ------------------------------- 281s > 281s > untz.glob$state() 282s An object of class "unitizerGlobalIndices" 282s Slot "search.path": 282s [1] 1 282s 282s Slot "options": 282s [1] 0 282s 282s Slot "working.directory": 282s [1] 0 282s 282s Slot "random.seed": 282s [1] 0 282s 282s Slot "namespaces": 282s [1] 0 282s 282s > keep.more <- c(getOption("unitizer.search.path.keep.base")) 282s > unitizer:::search_path_trim(keep.more, global = untz.glob) 282s > untz.glob$state() 282s An object of class "unitizerGlobalIndices" 282s Slot "search.path": 282s [1] 1 282s 282s Slot "options": 282s [1] 0 282s 282s Slot "working.directory": 282s [1] 0 282s 282s Slot "random.seed": 282s [1] 0 282s 282s Slot "namespaces": 282s [1] 0 282s 282s > identical(environmentName(parent.env(my.env)), search()[[2L]]) 282s [1] TRUE 282s > untz.glob$resetFull() 282s An object of class "unitizerGlobalIndices" 282s Slot "search.path": 282s [1] 1 282s 282s Slot "options": 282s [1] 1 282s 282s Slot "working.directory": 282s [1] 1 282s 282s Slot "random.seed": 282s [1] 1 282s 282s Slot "namespaces": 282s [1] 1 282s 282s > identical(environmentName(parent.env(my.env)), curr2) 282s [1] TRUE 282s > 282s > # - "Disable Unshims, etc." ---------------------------------------------------- 282s > 282s > untz.glob$unshimFuns() 282s [1] TRUE 282s > !any(vapply(list(library, detach, attach), inherits, logical(1L), 282s + "functionWithTrace")) 282s [1] TRUE 282s > untz.glob$release() 282s > 282s > # - "Checks, errors, etc." ----------------------------------------------------- 282s > 282s > # make sure to unset this at end 282s > untz.glob <- unitizer:::unitizerGlobal$new(par.env = my.env, 282s + enable.which = state.set, set.global = TRUE) 282s > tracingState(FALSE) 282s [1] TRUE 282s > untz.glob$shimFuns() # warning 282s Warning in untz.glob$shimFuns() : 282s Unable to shim required functions to run with `par.env=NULL` because tracing state is FALSE. Setting `par.env=.GlobalEnv`. 282s [1] FALSE 282s > parent.env(my.env) 282s 282s > tracingState(TRUE) 282s [1] FALSE 282s > untz.glob$release() 282s > untz.glob <- unitizer:::unitizerGlobal$new(par.env = my.env, 282s + set.global = TRUE) 282s > trace("library", quote(cat("I am traced\n")), where = .BaseNamespaceEnv) 282s Tracing function "library" in package "namespace:base" 282s [1] "library" 282s > lib.trace <- library 282s > untz.glob$shimFuns() # warning 282s Warning in untz.glob$shimFuns() : 282s Unable to shim required functions to run with `par.env=NULL` because they are already traced. Setting `par.env=.GlobalEnv`. 282s [1] FALSE 282s > parent.env(my.env) 282s 282s > inherits(attach, "functionWithTrace") # FALSE 282s [1] FALSE 282s > inherits(detach, "functionWithTrace") # FALSE 282s [1] FALSE 282s > inherits(library, "functionWithTrace") 282s [1] TRUE 282s > identical(lib.trace, library) 282s [1] TRUE 282s > untrace("library", where = .BaseNamespaceEnv) 282s Untracing function "library" in package "namespace:base" 282s > untz.glob$release() 282s > untz.glob <- unitizer:::unitizerGlobal$new(par.env = my.env, 282s + set.global = TRUE) 282s > untz.glob$shimFuns() 282s [1] TRUE 282s > trace("attach", quote(cat("I am traced\n")), where = .BaseNamespaceEnv) 282s Tracing function "attach" in package "namespace:base" 282s [1] "attach" 282s > attach.trace <- attach 282s > untz.glob$checkShims() # warning 282s Warning in untz.glob$checkShims() : 282s Traced functions unexpectedly changed, disabling clean parent env 282s Warning in unshimFuns() : 282s `attach` was not untraced because they were modified by something other than unitizer. 282s `FALSE`, `TRUE`, and `FALSE` were not untraced for unknown reasons; please report to maintainer. 282s 282s you should consider manually untracing the function, or restarting your R session to restore function to original value. 282s [1] FALSE 282s > parent.env(my.env) 282s 282s > inherits(detach, "functionWithTrace") # FALSE 282s [1] FALSE 282s > inherits(library, "functionWithTrace") # FALSE 282s [1] FALSE 282s > inherits(attach, "functionWithTrace") 282s [1] TRUE 282s > identical(attach.trace, attach) 282s [1] TRUE 282s > untrace("attach", where = .BaseNamespaceEnv) 282s Untracing function "attach" in package "namespace:base" 282s > untz.glob$release() 282s > untz.glob <- unitizer:::unitizerGlobal$new(par.env = my.env, 282s + set.global = TRUE) 282s > untz.glob$shimFuns() 282s [1] TRUE 282s > tracingState(FALSE) 282s [1] TRUE 282s > untz.glob$checkShims() # warning 282s Warning in untz.glob$checkShims() : 282s Tracing state off, so disabling clean parent env 282s [1] FALSE 282s > parent.env(my.env) 282s 282s > tracingState(TRUE) 282s [1] FALSE 282s > inherits(detach, "functionWithTrace") # FALSE 282s [1] FALSE 282s > inherits(library, "functionWithTrace") # FALSE 282s [1] FALSE 282s > inherits(attach, "functionWithTrace") # FALSE 282s [1] FALSE 282s > # try tracing some stuff that shouldn't be 282s > untz.glob$shimFuns("baljevzxhjLsdc") # Warning 282s Warning in untz.glob$shimFuns("baljevzxhjLsdc") : 282s Unable to shim required functions to run with `par.env=NULL` because some cannot be found. Setting `par.env=.GlobalEnv`. 282s [1] FALSE 282s > # test unexpected message or behavior from `trace_at_end` 282s > try(untz.glob$shimFun("sum")) 282s Error in untz.glob$shimFun("sum") : Internal Error: missing shim data 282s > 282s > mock(unitizer:::trace_at_end, quote(stop("trace_at_end fail"))) 282s > any( 282s + grepl( 282s + "trace_at_end fail", 282s + capture.output( 282s + trace.fail <- untz.glob$shimFun("library"), type = "message" 282s + ), 282s + fixed = TRUE 282s + ) 282s + ) 282s [1] TRUE 282s > unmock(unitizer:::trace_at_end) 282s > 282s > trace.fail # FALSE 282s [1] FALSE 282s > mock(unitizer:::trace_at_end, quote(message("random message"))) 282s > untz.glob$shimFun("library") 282s random message 282s Warning in untz.glob$shimFun("library") : 282s Function `library` was not traced even though tracing attempt did not produce errors. 282s [1] FALSE 282s > unmock(unitizer:::trace_at_end) 282s > 282s > mock(unitizer:::trace_at_end, quote(TRUE)) 282s > dont.trace <- untz.glob$shimFun("library") # Warning "not traced" 282s Warning in untz.glob$shimFun("library") : 282s Function `library` was not traced even though tracing attempt did not produce errors. 282s > unmock(unitizer:::trace_at_end) 282s > 282s > dont.trace # FALSE 282s [1] FALSE 282s > untz.glob$release() 282s > # untrace condition 282s > untz.glob <- unitizer:::unitizerGlobal$new(par.env = my.env, set.global = TRUE) 282s > untz.glob$shimFuns() 282s [1] TRUE 282s > 282s > mock( 282s + unitizer:::untrace_utz, 282s + quote({ 282s + message("untrace dummy") 282s + base::untrace(what = what, signature = signature, where = where) 282s + }) 282s + ) 282s > untz.glob$unshimFuns() # message untrace dummy 282s untrace dummy 282s untrace dummy 282s untrace dummy 282s [1] TRUE 282s > unmock(unitizer:::untrace_utz) 282s > untz.glob$release() 282s > 282s > try(detach("package:unitizerdummypkg1", unload = TRUE), silent = TRUE) 282s > 282s > while ("unitizer.dummy.list" %in% search()) try(detach("unitizer.dummy.list")) 282s > 282s > # - "find_returns" ------------------------------------------------------------- 282s > 282s > fun <- function() { 282s + if (TRUE) 282s + return(1) 282s + else { 282s + { 282s + 2 + 2 282s + identity(c(1, 2, return(3), { 282s + list(1, 2, 5) 282s + return(return(4)) 282s + })) 282s + return(5) 282s + } 282s + return(6) 282s + } 282s + if (TRUE) 282s + return(7) 282s + else return(8) 282s + return(9) 282s + return(10) 282s + } 282s > ret.loc <- unitizer:::find_returns(fun) 282s > ret.loc 282s [[1]] 282s [1] 2 3 282s 282s [[2]] 282s [1] 2 4 2 3 2 4 282s 282s [[3]] 282s [1] 2 4 2 3 2 5 3 282s 282s [[4]] 282s [1] 2 4 2 4 282s 282s [[5]] 282s [1] 2 4 3 282s 282s [[6]] 282s [1] 3 3 282s 282s [[7]] 282s [1] 3 4 282s 282s [[8]] 282s [1] 4 282s 282s [[9]] 282s [1] 5 282s 282s > 282s > # Validate visually that this worked 282s > 282s > all(vapply(unitizer:::get_returns(fun, ret.loc), function(x) x[[1L]] == 282s + quote(return), logical(1L))) 282s [1] TRUE 282s > 282s > 282s PASS 282s Begin testing t-state.R 282s 282s R version 4.3.2 (2023-10-31) -- "Eye Holes" 282s Copyright (C) 2023 The R Foundation for Statistical Computing 282s Platform: aarch64-unknown-linux-gnu (64-bit) 282s 282s R is free software and comes with ABSOLUTELY NO WARRANTY. 282s You are welcome to redistribute it under certain conditions. 282s Type 'license()' or 'licence()' for distribution details. 282s 282s R is a collaborative project with many contributors. 282s Type 'contributors()' for more information and 282s 'citation()' on how to cite R or R packages in publications. 282s 282s Type 'demo()' for some demos, 'help()' for on-line help, or 282s 'help.start()' for an HTML browser interface to help. 282s Type 'q()' to quit R. 282s 282s > source(file.path("_helper", "init.R")) 282s > 282s > options(unitizer.color = FALSE, width = 80L) 282s > 282s > # - "Random Seed" -------------------------------------------------------------- 282s > 282s > old.seed <- if (!exists(".Random.seed")) NULL else .Random.seed 282s > seed.dat <- getOption("unitizer.seed") 282s > 282s > suppressWarnings( 282s + untz.glob <- 282s + unitizer:::unitizerGlobal$new(enable.which = setNames(2L, "random.seed")) 282s + ) 282s > do.call(set.seed, seed.dat) 282s > new.seed <- .Random.seed 282s > state <- untz.glob$state() 282s > invisible(runif(10)) # see if we can reset state after this 282s > untz.glob$reset(state) 282s An object of class "unitizerGlobalIndices" 282s Slot "search.path": 282s [1] 0 282s 282s Slot "options": 282s [1] 0 282s 282s Slot "working.directory": 282s [1] 0 282s 282s Slot "random.seed": 282s [1] 2 282s 282s Slot "namespaces": 282s [1] 0 282s 282s > identical(.Random.seed, new.seed) 282s [1] TRUE 282s > untz.glob$resetFull() 282s An object of class "unitizerGlobalIndices" 282s Slot "search.path": 282s [1] 1 282s 282s Slot "options": 282s [1] 1 282s 282s Slot "working.directory": 282s [1] 1 282s 282s Slot "random.seed": 282s [1] 1 282s 282s Slot "namespaces": 282s [1] 1 282s 282s > 282s > if (is.null(old.seed)) { 282s + !isTRUE(exists(".Random.seed")) 282s + } else identical(old.seed, .Random.seed) 282s [1] TRUE 282s > 282s > # - "State Show" --------------------------------------------------------------- 282s > 282s > show(unitizer:::unitizerStatePristine()) 282s Settings Values 282s 1 par.env 282s 2 search.path 2 282s 3 options 2 282s 4 working.directory 2 282s 5 random.seed 2 282s 6 namespaces 2 282s ----- 282s 0: off 282s 1: track starting with initial state 282s 2: track starting with clean state 282s : use special unitizer environment as 'par.env' 282s See `?unitizerState` for more details. 282s > 282s > # - "all.equal.unitizerDummy" -------------------------------------------------- 282s > 282s > dummy <- new("unitizerDummy") 282s > blah <- "hello" 282s > ref.txt <- "`.REF` value was not recorded, but `.NEW` value was; they are likely different" 282s > identical(all.equal(dummy, blah), ref.txt) 282s [1] TRUE 282s > all.equal(dummy, dummy) 282s [1] TRUE 282s > identical( 282s + all.equal(blah, dummy), 282s + "`.NEW` value was not recorded, but `.REF` value was; they are likely different" 282s + ) 282s [1] TRUE 282s > # testing S4 / S3 methods, first works, second doesn't since we can't 282s > # have an S3 generic with dispatch on 2nd arg 282s > 282s > identical( 282s + evalq(all.equal(new("unitizerDummy"), "hello"), getNamespace("stats")), 282s + ref.txt 282s + ) 282s [1] TRUE 282s > evalq(all.equal("hello", new("unitizerDummy")), getNamespace("stats")) 282s [1] "Modes: character, S4" 282s [2] "Attributes: < target is NULL, current is list >" 282s [3] "target is character, current is unitizerDummy" 282s > 282s > # - "All Equal States" --------------------------------------------------------- 282s > 282s > # Doesn't seem like we're comparing these to anything? Maybe should look into 282s > # doing so? 282s > 282s > state.A <- new("unitizerGlobalState", search.path = letters[1:3], 282s + options = list(a = 5:7, b = new("unitizerDummy"), c = "hello"), 282s + working.directory = "a/b/c") 282s > state.B <- new("unitizerGlobalState", search.path = letters[1:3], 282s + options = list(a = 5:7, b = new("unitizerDummy"), d = "goodbye", 282s + c = new("unitizerDummy")), working.directory = new("unitizerDummy"), 282s + random.seed = 1:3) 282s > state.C <- new("unitizerGlobalState", search.path = letters, 282s + options = list(a = list(5, 6, 7), c = LETTERS), working.directory = new("unitizerDummy"), 282s + random.seed = 1:3) 282s > # just compare to A 282s > state.D <- new("unitizerGlobalState", search.path = letters[1:3], 282s + options = list(a = list(1, 2, 3), b = new("unitizerDummy"), 282s + c = "hello"), working.directory = "a/b/c") 282s > state.E <- new("unitizerGlobalState", options = setNames(as.list(1:20), 282s + head(letters, 20))) 282s > state.F <- new("unitizerGlobalState", options = setNames(as.list(1:20), 282s + tail(letters, 20))) 282s > # This one is supposed to return something non-character or TRUE when used 282s > # with the provided all.equal 282s > state.G <- new("unitizerGlobalState", options = list(a = structure(TRUE, 282s + class = "unitizer_glob_state_test"), b = 0)) 282s > state.H <- new("unitizerGlobalState", options = list(a = structure(FALSE, 282s + class = "unitizer_glob_state_test"), b = 2)) 282s > 282s > # - "as.state" ----------------------------------------------------------------- 282s > 282s > identical( 282s + unitizer:::as.state("recommended"), 282s + unitizer:::as.state(unitizer:::unitizerStateSuggested()) 282s + ) 282s [1] TRUE 282s > identical( 282s + unitizer:::as.state("suggested"), 282s + unitizer:::as.state(unitizer:::unitizerStateSuggested()) 282s + ) 282s [1] TRUE 282s > identical( 282s + unitizer:::as.state("pristine"), 282s + unitizer:::as.state(unitizer:::unitizerStatePristine()) 282s + ) 282s [1] TRUE 282s > 282s > # unitizerStateProcessed should produce the default object (which currently 282s > # is "off") 282s > 282s > all.equal( 282s + unitizer:::as.state(.GlobalEnv), 282s + unitizer:::as.state(unitizer:::unitizerStateSuggested(par.env = .GlobalEnv)) 282s + ) 282s [1] TRUE 282s > all.equal( 282s + unitizer:::as.state(in_pkg("stats")), 282s + unitizer:::as.state( 282s + unitizer:::unitizerStateSuggested(par.env = getNamespace("stats")) 282s + ) ) 282s [1] TRUE 282s > 282s > stats.lib <- file.path(system.file(package = "stats"), "R") 282s > all.equal( 282s + unitizer:::as.state(in_pkg(), test.files = stats.lib), 282s + unitizer:::as.state( 282s + unitizer:::unitizerStateSuggested(par.env = getNamespace("stats")) 282s + ) ) 282s [1] TRUE 282s > try(unitizer:::as.state(200)) 282s Error in as.state_raw(x) : 282s Argument `x` must be character(1L) %in% c("pristine", "recommended", "suggested" 282s , "basic", "off", "safe"), NULL, an environment, or must inherit from S4 classes 282s `unitizerStateRaw`, `unitizerStateProcessed` or `unitizerInPkg` in order to be 282s interpreted as a unitizer state object. 282s > state <- unitizer:::unitizerStateOff() 282s > # bypass validity method 282s > state@options <- 2L 282s > try(validObject(state)) 282s Error in validObject(state) : 282s invalid class "unitizerStateOff" object: Argument `state` is an invalid state: 'options' is set to 2, but 'search.path' and 'namespaces' are not 282s > # state raw conversions 282s > identical( 282s + unitizer:::as.state(unitizer:::unitizerStateRaw()), 282s + unitizer:::unitizerStateProcessed() 282s + ) 282s [1] TRUE 282s > identical( 282s + unitizer:::as.state(unitizer:::unitizerStateRaw(par.env = "stats")), 282s + unitizer:::unitizerStateProcessed(par.env = getNamespace("stats")) 282s + ) 282s [1] TRUE 282s > state@options <- 0L 282s > state.proc <- unitizer:::as.unitizerStateProcessed(state) 282s > state.raw <- unitizer:::as.unitizerStateRaw(state.proc) 282s > is(state.raw, "unitizerStateRaw") 282s [1] TRUE 282s > all.equal( 282s + lapply(slotNames(state), slot, object = state.proc), 282s + lapply(slotNames(state.raw), slot, object = state.raw) 282s + ) 282s [1] TRUE 282s > try(unitizer:::as.state(unitizer:::unitizerStateRaw(par.env = in_pkg()))) 282s Error in in_pkg_to_env(x.raw@par.env, test.files) : 282s Unable to detect package to use namespace of as parent environment; see `? 282s unitizerState` for how to specify a package namespace explicitly as a parent 282s environment. 282s Error in unitizer:::as.state(unitizer:::unitizerStateRaw(par.env = in_pkg())) : 282s Unable to convert `par.env` value to a namespace environment 282s > 282s > identical( 282s + unitizer:::as.state(unitizer:::unitizerStateRaw(par.env = in_pkg("stats"))), 282s + unitizer:::unitizerStateProcessed(par.env = getNamespace("stats")) 282s + ) 282s [1] TRUE 282s > try( 282s + unitizer:::as.state( 282s + unitizer:::unitizerStateRaw(par.env = in_pkg("asdfalkdfasd")) 282s + ) ) 282s Error in loadNamespace(name) : there is no package called 'asdfalkdfasd' 282s Error in in_pkg_to_env(x.raw@par.env, test.files) : 282s Unable to load "asdfalkdfasd" namespace to use as parent environment; see 282s `?unitizerState` for instructions on how to specify a package namespace as a 282s parent environment for tests. 282s Error in unitizer:::as.state(unitizer:::unitizerStateRaw(par.env = in_pkg("asdfalkdfasd"))) : 282s Unable to convert `par.env` value to a namespace environment 282s > try( 282s + unitizer:::as.state( 282s + unitizer:::unitizerStateRaw(par.env = in_pkg("")), test.files = getwd() 282s + ) ) 282s Error in in_pkg("") : Argument `package` may not be an empty string 282s > # impossible states 282s > state.obj <- unitizer:::unitizerStateRaw() 282s > state.obj@options <- 2L 282s > try(unitizer:::as.state(state.obj)) 282s Error in unitizer:::as.state(state.obj) : 282s Options state tracking (2) must be less than namespace state tracking (0). 282s > state.obj@namespaces <- 2L 282s > state.obj@search.path <- 1L 282s > try(unitizer:::as.state(state.obj)) 282s Error in unitizer:::as.state(state.obj) : 282s Namespace state tracking (2) must be less than or equal to search path state 282s tracking (1). 282s > 282s > # - "as.state_raw" ------------------------------------------------------------- 282s > 282s > old.opt.loc <- options(unitizer.state = .GlobalEnv) 282s > try(unitizer:::as.state_raw(.GlobalEnv)) 282s Error in unitizer:::as.state_raw(.GlobalEnv) : 282s Value for `getOption('unitizer.state')` is incompatible with using an environment or an 'unitizerInPkg' object as the value for the `state` argument because it also is an environment or a 'unitizerInPkg' object; you must change the option or the `state` argument to be compatible. 282s > options(unitizer.state = 42L) 282s > try(unitizer:::as.state_raw(.GlobalEnv)) 282s Error in unitizer:::as.state_raw(.GlobalEnv) : 282s `getOption('unitizer.state')` must be character(1L) %in% c("pristine", "recom- 282s mended", "suggested", "basic", "off", "safe"), NULL, an environment, or must 282s inherit from S4 classes `unitizerStateRaw`, `unitizerStateProcessed` or ` 282s unitizerInPkg` in order to be interpreted as a unitizer state object. 282s > state.raw <- unitizer:::as.unitizerStateRaw(unitizer:::unitizerStateOff()) 282s > state.proc <- unitizer:::as.unitizerStateProcessed(state.raw) 282s > my.env <- new.env() 282s > options(unitizer.state = state.raw) 282s > state.raw@par.env <- my.env 282s > all.equal(unitizer:::as.state_raw(my.env), state.raw) 282s [1] TRUE 282s > options(unitizer.state = state.proc) 282s > my.env <- new.env() 282s > state.proc@par.env <- my.env 282s > all.equal( 282s + unitizer:::as.state_raw(my.env), 282s + unitizer:::as.unitizerStateRaw(state.proc) 282s + ) 282s [1] TRUE 282s > options(old.opt.loc) 282s > 282s > # - "state" -------------------------------------------------------------------- 282s > 282s > # all these assume we set the options to be in recommended mode 282s > 282s > all.equal(state("stats"), unitizer:::unitizerStateSuggested(par.env = "stats")) 282s [1] TRUE 282s > 282s > all.equal( 282s + state(in_pkg("stats")), 282s + unitizer:::unitizerStateSuggested(par.env = in_pkg("stats")) 282s + ) 282s [1] TRUE 282s > all.equal( 282s + state(in_pkg()), unitizer:::unitizerStateSuggested(par.env = in_pkg()) 282s + ) 282s [1] TRUE 282s > all.equal( 282s + state(search.path = 1), unitizer:::unitizerStateSuggested(search.path = 1L) 282s + ) 282s [1] TRUE 282s > s1 <- unitizer:::unitizerStateSuggested(par.env = .GlobalEnv) 282s > for (i in setdiff(slotNames(s1), "par.env")) slot(s1, i) <- 0L 282s > s2 <- unitizer:::unitizerStateOff() 282s > all.equal(s1, s2) 282s [1] TRUE 282s > # invalid state 282s > try(state(search.path = 3)) 282s Error in state(search.path = 3) : 282s Argument `search.path` must be integer(1L) in 0:2 282s > try(state(options = 2, namespaces = 1)) 282s Error in state(options = 2, namespaces = 1) : 282s Unable to create valid `unitizerStateRaw` object: Argument `state` is an invalid state: 'options' is set to 2, but 'search.path' and 'namespaces' are not 282s > try(state(namespaces = 2, search.path = 1)) 282s Error in state(namespaces = 2, search.path = 1) : 282s Unable to create valid `unitizerStateRaw` object: Argument `state` is an invalid state: 'namespaces' is set to 2, but 'search.path' is not 282s > state.inv <- unitizer:::unitizerStateProcessed() 282s > state.inv@options <- 2L 282s > try(unitizer:::as.state(state.inv)) 282s Error in unitizer:::as.state(state.inv) : 282s Options state tracking (2) must be less than namespace state tracking (0). 282s > state.inv@namespaces <- 2L 282s > try(unitizer:::as.state(state.inv)) 282s Error in unitizer:::as.state(state.inv) : 282s Namespace state tracking (2) must be less than or equal to search path state 282s tracking (0). 282s > # captured 282s > any(grepl("", capture.output(show(state(in_pkg()))))) 282s [1] TRUE 282s > any(grepl("", capture.output(show(state(in_pkg("stats")))))) 282s [1] TRUE 282s > any(grepl("namespace:stats", capture.output(show(state(asNamespace("stats")))))) 282s [1] TRUE 282s > 282s > # - "in_pkg" ------------------------------------------------------------------- 282s > 282s > try(in_pkg("")) 282s Error in in_pkg("") : Argument `package` may not be an empty string 282s > identical(as.character(in_pkg()), "") 282s [1] TRUE 282s > identical(as.character(in_pkg("stats")), "") 282s [1] TRUE 282s > identical(capture.output(show(in_pkg())), "") 282s [1] TRUE 282s > try(unitizer:::in_pkg_to_env(in_pkg(), "/")) 282s Error in unitizer:::in_pkg_to_env(in_pkg(), "/") : 282s Unable to detect package to use namespace of as parent environment; see `? 282s unitizerState` for how to specify a package namespace explicitly as a parent 282s environment. 282s > 282s > # - "merge states" ------------------------------------------------------------- 282s > 282s > trk.new <- new("unitizerGlobalTrackingStore", search.path = list(1, 282s + 2, 3), options = list("a", "b")) 282s > trk.ref <- new("unitizerGlobalTrackingStore", search.path = list(4, 282s + 5, 6), options = list("c", "d")) 282s > items <- new("unitizerItems") 282s > items <- items + new("unitizerItem", call = quote(1 + 1), glob.indices = new("unitizerGlobalIndices", 282s + search.path = 1L, options = 2L)) 282s > items <- items + new("unitizerItem", call = quote(2 + 1), glob.indices = new("unitizerGlobalIndices", 282s + search.path = 2L, options = 1L)) 282s > items <- items + new("unitizerItem", call = quote(1 * 1), reference = TRUE, 282s + glob.indices = new("unitizerGlobalIndices", search.path = 1L, 282s + options = 1L)) 282s > items <- items + new("unitizerItem", call = quote(2 * 1), reference = TRUE, 282s + glob.indices = new("unitizerGlobalIndices", search.path = 3L, 282s + options = 2L)) 282s > res <- unitizer:::mergeStates(items, trk.new, trk.ref) 282s > 282s > sapply(res$items, function(x) as.integer(slot(x, "glob.indices"))) 282s [,1] [,2] [,3] [,4] 282s search.path 1 2 4 5 282s options 2 1 3 4 282s working.directory 0 0 0 0 282s random.seed 0 0 0 0 282s namespaces 0 0 0 0 282s > s.n.to.check <- c("search.path", "options", "working.directory", 282s + "random.seed", "namespaces") 282s > sapply(s.n.to.check, slot, object = res$states) 282s $search.path 282s $search.path[[1]] 282s [1] 1 282s 282s $search.path[[2]] 282s [1] 2 282s 282s $search.path[[3]] 282s [1] 3 282s 282s $search.path[[4]] 282s [1] 4 282s 282s $search.path[[5]] 282s [1] 6 282s 282s 282s $options 282s $options[[1]] 282s [1] "a" 282s 282s $options[[2]] 282s [1] "b" 282s 282s $options[[3]] 282s [1] "c" 282s 282s $options[[4]] 282s [1] "d" 282s 282s 282s $working.directory 282s list() 282s 282s $random.seed 282s list() 282s 282s $namespaces 282s list() 282s 282s > # No reference items 282s > items.no.ref <- items[1:2] 282s > identical( 282s + unitizer:::mergeStates(items.no.ref, trk.new, trk.ref), 282s + list(items = items.no.ref, states = trk.new) 282s + ) 282s [1] TRUE 282s > # No new items; note that we only remap the used states to the new state 282s > # which is why we need all the .mod objects 282s > 282s > items.no.new <- items[3:4] 282s > items.no.new.mod <- items.no.new 282s > items.no.new.mod[[2L]]@glob.indices@search.path <- 2L 282s > trk.ref.mod <- trk.ref 282s > trk.ref.mod@search.path[[2L]] <- NULL 282s > 282s > identical( 282s + unitizer:::mergeStates( 282s + items.no.new, new("unitizerGlobalTrackingStore"),trk.ref 282s + ), 282s + list(items = items.no.new.mod, states = trk.ref.mod) 282s + ) 282s [1] TRUE 282s > 282s > 283s PASS 283s Begin testing t-text.R 283s 283s R version 4.3.2 (2023-10-31) -- "Eye Holes" 283s Copyright (C) 2023 The R Foundation for Statistical Computing 283s Platform: aarch64-unknown-linux-gnu (64-bit) 283s 283s R is free software and comes with ABSOLUTELY NO WARRANTY. 283s You are welcome to redistribute it under certain conditions. 283s Type 'license()' or 'licence()' for distribution details. 283s 283s R is a collaborative project with many contributors. 283s Type 'contributors()' for more information and 283s 'citation()' on how to cite R or R packages in publications. 283s 283s Type 'demo()' for some demos, 'help()' for on-line help, or 283s 'help.start()' for an HTML browser interface to help. 283s Type 'q()' to quit R. 283s 283s > source(file.path("_helper", "init.R")) 283s > 283s > # - "cap_first" ---------------------------------------------------------------- 283s > 283s > set.seed(1, "Mersenne-Twister") 283s > words <- replicate(2, paste0(sample(letters, 5), collapse = "")) 283s > WORDS <- toupper(words) 283s > 283s > unitizer:::cap_first(c("", letters[1:2], letters[25:26], words, WORDS)) 283s [1] "" "A" "B" "Y" "Z" "Gjnue" "Xzpob" "GJNUE" "XZPOB" 283s > 283s > unitizer:::decap_first(c("", letters[1:2], letters[25:26], words, WORDS)) 283s [1] "" "a" "b" "y" "z" "gjnue" "xzpob" "gJNUE" "xZPOB" 283s > 283s > # - "header" ------------------------------------------------------------------- 283s > 283s > try(unitizer:::header("hello world", letters)) 283s Error in unitizer:::header("hello world", letters) : 283s Argument `level` must be 1 length integer-like and in 1:3 283s > try(unitizer:::header(letters, 1)) 283s Error in unitizer:::header(letters, 1) : 283s Argument `x` must be a one length character vector 283s > 283s > # - "word_wrap" ---------------------------------------------------------------- 283s > 283s > lorem1 <- "Today, with Kiernan on the stand offering confirmation, Howard walked the jury through the enormous amount of data pulled from Ulbricht's computer. Defense lawyers haven't had a chance yet to respond to this evidence—that will likely come tomorrow. The mountain they have to climb looks higher than ever, though. Last week, Ulbricht's lawyer outlined a defense in which Ulbricht walked away from the marketplace he created and was \"lured back.\" But what will explain the dozens of folders of data on this laptop, with data from the upper echelons of Silk Road management—mixed with the most intimate details of Ulbricht's personal life?" 283s > lorem2 <- "/Volumes/FIXED/folder1/folder2/folder.2345/folderabac/file.text.batch" 283s > lorem3 <- "\"untz.state.test\", \"add.smooth\", \"bitmapType\", \"browser\", \"browserNLdisabled\", \"CBoundsCheck\", \"check.bounds\", \"citation.bibtex.max\", \"continue\", \"contrasts\"" 283s > range(nchar(head(unitizer:::word_wrap(lorem1, 25L), -1L))) 283s [1] 18 25 283s > t.rn <- range(nchar(head(unitizer:::word_wrap(lorem1, 25L, 3L), 283s + -1L))) 283s > # for some reason can't get test to produce same thing in windows when 283s > # running all tests vs. single one at the prompt; the > 20 is a cop-out that 283s > # should catch both the expected case (23) and what actually happens when 283s > # you run the tests on windows 283s > # expect_true(min(t.rn) > 20 && max(t.rn) <= 25) 283s > min(t.rn) > 20 && max(t.rn) <= 25 283s [1] TRUE 283s > 283s > unitizer:::word_wrap(substr(lorem1, 1, 147), 45L, 3L) 283s [1] "Today, with Kiernan on the stand offering co-" 283s [2] "nfirmation, Howard walked the jury through " 283s [3] "the enormous amount of data pulled from Ulb-" 283s [4] "richt's computer." 283s > unitizer:::word_wrap(substr(lorem1, 1, 147), 45L, 3L, FALSE) 283s [1] "Today, with Kiernan on the stand offering con" 283s [2] "firmation, Howard walked the jury through the" 283s [3] "enormous amount of data pulled from Ulbricht'" 283s [4] "s computer." 283s > unitizer:::word_wrap(lorem2, 15L, 3L) 283s [1] "/Volumes/FIXED/" "folder1/fol-" "der2/folder.23-" "45/folderabac/" 283s [5] "file.text.batch" 283s > unitizer:::word_wrap(lorem2, 15L, 8L) 283s [1] "/Volumes/FIXED/" "folder1/" "folder2/folder." "2345/fol-" 283s [5] "derabac/file." "text.batch" 283s > 283s > unitizer:::word_wrap(lorem3, 76L, 8L) 283s [1] "\"untz.state.test\", \"add.smooth\", \"bitmapType\", \"browser\", \"browserNLdisab-" 283s [2] "led\", \"CBoundsCheck\", \"check.bounds\", \"citation.bibtex.max\", \"continue\", " 283s [3] "\"contrasts\"" 283s > unitizer:::word_wrap("hello sunset \nthere moonrise", width = 12L) 283s [1] "hello sunset" "there " "moonrise" 283s > 283s > x1 <- c("this is supposed to be a particularly long string\nthat allows us to test the behavior of bullets once we start seeing\nsome wrapping kicking in which was a problem once upon a time") 283s > 283s > unitizer:::word_wrap(x1, unlist = FALSE, width = 80L) 283s [[1]] 283s [1] "this is supposed to be a particularly long string" 283s [2] "that allows us to test the behavior of bullets once we start seeing" 283s [3] "some wrapping kicking in which was a problem once upon a time" 283s 283s > com <- "# this is supposed to be a relatively long comment that will get re-flowed" 283s > old.opt <- options(crayon.enabled = FALSE) 283s > unitizer:::word_comment(com, width = 30L) 283s [1] "# this is supposed to be a " "#relatively long comment that " 283s [3] "#will get re-flowed" 283s > unitizer:::word_wrap(c("\nhello\nthere", "\nhow")) 283s [1] "" "hello" "there" "" "how" 283s > # too narrow 283s > no.wrap <- "hello I won't be wrapped" 283s > unitizer:::word_wrap(no.wrap, width = 3) # warning 283s Warning in unitizer:::word_wrap(no.wrap, width = 3) : 283s Display width too narrow to properly wrap text; setting to 80L 283s [1] "hello I won't be wrapped" 283s > options(old.opt) 283s > 283s > # - "bullets" ------------------------------------------------------------------ 283s > 283s > x <- c("there was once a time when the fantastic unicorns could fly", 283s + "bugs bunny ate carrots and drank milk while hunting ducks") 283s > xx <- unitizer:::UL(x) 283s > 283s > as.character(xx, width = 30L) 283s [1] "- there was once a time when " " the fantastic unicorns could" 283s [3] " fly" "- bugs bunny ate carrots and " 283s [5] " drank milk while hunting " " ducks" 283s > print(xx, width = 80L) 283s - there was once a time when the fantastic unicorns could fly 283s - bugs bunny ate carrots and drank milk while hunting ducks 283s > yy <- unitizer:::OL(x) 283s > as.character(yy, width = 30L) 283s [1] "1. there was once a time when " " the fantastic unicorns " 283s [3] " could fly" "2. bugs bunny ate carrots and " 283s [5] " drank milk while hunting " " ducks" 283s > # hopefully always C locale collation in tests? 283s > sort(as.character(unitizer:::OL(rep(letters, 2), style = "LETTERS"))) 283s [1] " A. a" " B. b" " C. c" " D. d" " E. e" " F. f" " G. g" " H. h" " I. i" 283s [10] " J. j" " K. k" " L. l" " M. m" " N. n" " O. o" " P. p" " Q. q" " R. r" 283s [19] " S. s" " T. t" " U. u" " V. v" " W. w" " X. x" " Y. y" " Z. z" "AA. a" 283s [28] "AB. b" "AC. c" "AD. d" "AE. e" "AF. f" "AG. g" "AH. h" "AI. i" "AJ. j" 283s [37] "AK. k" "AL. l" "AM. m" "AN. n" "AO. o" "AP. p" "AQ. q" "AR. r" "AS. s" 283s [46] "AT. t" "AU. u" "AV. v" "AW. w" "AX. x" "AY. y" "AZ. z" 283s > xl <- as.list(x) 283s > y <- unitizer:::UL(c(xl, list(unitizer:::OL(c(xl, list(unitizer:::UL(x))))), 283s + "yowza it is raining toads today!")) 283s > as.character(y, width = 30) 283s [1] "- there was once a time when " " the fantastic unicorns could" 283s [3] " fly" "- bugs bunny ate carrots and " 283s [5] " drank milk while hunting " " ducks" 283s [7] " 1. there was once a time " " when the fantastic " 283s [9] " unicorns could fly" " 2. bugs bunny ate carrots " 283s [11] " and drank milk while " " hunting ducks" 283s [13] " - there was once a time " " when the fantastic " 283s [15] " unicorns could fly" " - bugs bunny ate carrots " 283s [17] " and drank milk while " " hunting ducks" 283s [19] "- yowza it is raining toads " " today!" 283s > try(unitizer:::as.character.bullet(hello, 1:10)) 283s Error in unitizer:::as.character.bullet(hello, 1:10) : 283s Argument `width` must be a one length positive numeric. 283s > # Extra args to word_wrap 283s > try(as.character(unitizer:::OL(c("hello", "there")), unlist = TRUE)) 283s Error in as.character.bullet(unitizer:::OL(c("hello", "there")), unlist = TRUE) : 283s You may not specify `unlist` as part of `...` as that argument is used internally 283s > as.character(unitizer:::OL("asdfasdfqwerjhdfkasdfasdfasd"), width = 20L) 283s [1] "1. asdfasdfqwerjhdf-" " kasdfasdfasd" 283s > as.character(unitizer:::OL("asdfasdfqwerjhdfkasdfasdfasd"), width = 20L, 283s + hyphens = FALSE) 283s [1] "1. asdfasdfqwerjhdfk" " asdfasdfasd" 283s > 283s > # - "substr_const" ------------------------------------------------------------- 283s > 283s > unitizer:::substr_cons(c("ab", "abcde", "abce"), 4L) 283s [1] "ab " "abcd" "abc " 283s > unitizer:::substr_cons(c("ab", "abcde", "abce"), 4L, justify = "right") 283s [1] " ab" "abcd" " abc" 283s > unitizer:::substr_cons(c("NEW", "PASS", "FAIL", "DELETED", "Error"), 4L) 283s [1] "NEW " "PASS" "FAIL" "DEL " "Err " 283s > 283s > # - "str_reduce_unique" -------------------------------------------------------- 283s > 283s > str1 <- c("abcdef", "abcdefgh", "abcql") 283s > res1 <- c("def", "defgh", "ql") 283s > unitizer:::str_reduce_unique(str1) 283s [1] "def" "defgh" "ql" 283s > unitizer:::str_reduce_unique(str1, from = "right") 283s [1] "abcdef" "abcdefgh" "abcql" 283s > str2 <- vapply(strsplit(str1, ""), function(x) paste0(rev(x), 283s + collapse = ""), "") 283s > res2 <- vapply(strsplit(res1, ""), function(x) paste0(rev(x), 283s + collapse = ""), "") 283s > all.equal(unitizer:::str_reduce_unique(str2, from = "right"), res2) 283s [1] TRUE 283s > unitizer:::str_reduce_unique("aaa") 283s [1] "" 283s > identical(unitizer:::str_reduce_unique(rep("aaa", 5L)), rep("", 5L)) 283s [1] TRUE 283s > 283s > # - "strtrunc" ----------------------------------------------------------------- 283s > 283s > str1 <- c(paste0(letters, collapse = ""), paste0(LETTERS, collapse = "")) 283s > unitizer:::strtrunc(str1, 10L) 283s [1] "abcdefg..." "ABCDEFG..." 283s > unitizer:::strtrunc(str1, 10L, from = "left") 283s [1] "...tuvwxyz" "...TUVWXYZ" 283s > unitizer:::strtrunc(c("abc", "cab"), 3L) 283s [1] "abc" "cab" 283s > try(unitizer:::strtrunc(c("abc", "cab"), 2L)) 283s Error in unitizer:::strtrunc(c("abc", "cab"), 2L) : 283s `nchar.max` too small, make bigger or make `ctd` shorter. 283s > 283s > # - "oneline" ------------------------------------------------------------------ 283s > 283s > dep <- c("res <- data %>% group_by(ID) %>% summarise(date2 = nth(date, ", 283s + " 2), time2 = nth(time, 2), first_date = first(date), last_date = last(date), ", 283s + " first_time = first(time), last_time = last(time))") 283s > unitizer:::one_line(dep) 283s [1] "res <- data %>% group_by(ID) %>% summarise(date2 = nth(date, 2), time2 = nth(time, 2), first_date = first(date), last_date = last(date), first_time = first(time), last_time = last(time))" 283s > unitizer:::one_line(dep, 50) 283s [1] "res <- data %>% group_by(ID) %>% summarise(date..." 283s > 283s > # - "let_comb_fun" ------------------------------------------------------------- 283s > 283s > (unitizer:::make_let_combn_fun(letters))(12) 283s [1] "a." "b." "c." "d." "e." "f." "g." "h." "i." "j." "k." "l." 283s > 283s > # - "cc" ----------------------------------------------------------------------- 283s > 283s > unitizer:::cc("a", "b") 283s [1] "ab" 283s > unitizer:::cc(c("a", "b"), "c") 283s [1] "abc" 283s > unitizer:::cc(c("a", "b"), "c", c = " ") 283s [1] "a b c" 283s > 283s > # - "screen_out" --------------------------------------------------------------- 283s > 283s > string <- "once upon a time in a fairy land very far away lived a green dragon" 283s > unitizer:::screen_out(string, max.len = c(3L, 2L), width = 13L) 283s once upon a 283s time in a 283s ... truncated 4 lines 283s > 283s > # - "text_wrap" ---------------------------------------------------------------- 283s > 283s > try(unitizer:::text_wrap(list(1, 2, 3), 5)) 283s Error in unitizer:::text_wrap(list(1, 2, 3), 5) : 283s Arguments `x` and `width` must be character and integer like (all values >= 1) respectively 283s > try(unitizer:::text_wrap(letters, 1:3)) 283s Error in unitizer:::text_wrap(letters, 1:3) : 283s Argument `x` must be a multiple in length of argument `width` 283s > 283s > # - "capture_output" ----------------------------------------------------------- 283s > 283s > capt <- unitizer:::capture_output({ 283s + cat("hello") 283s + cat("goodbye", file = stderr()) 283s + }) 283s > capt 283s - Output ----------------------------------------------------------------------- 283s 283s hello 283s - Message ---------------------------------------------------------------------- 283s 283s goodbye 283s > sum(grepl("Output|Message", capture.output(print(capt)))) 283s [1] 2 283s > 283s > # - "meta_word_cat" ------------------------------------------------------------ 283s > 283s > unitizer:::meta_word_cat("hello") 283s | hello 283s 283s > capture.output(unitizer:::meta_word_cat("hello", trail.nl = FALSE)) 283s [1] "| hello" 283s > # Newline issues 283s > unitizer:::meta_word_cat("hello\n", sep = "") 283s | hello 283s 283s > unitizer:::meta_word_cat("hello", "there") 283s | hello 283s | there 283s 283s > unitizer:::meta_word_cat("hello", "there", sep = " ") 283s | hello there 283s 283s > 283s > # - "meta_word_msg" ------------------------------------------------------------ 283s > 283s > unitizer:::meta_word_msg("hello") 283s | hello 283s 283s > txt <- "hello there how are you this wraps" 283s > unitizer:::meta_word_msg(txt, width = 20) 283s | hello there how 283s | are you this wraps 283s 283s > # legacy fun 283s > unitizer:::word_msg("hello") 283s hello 283s > 283s > # - "desc" --------------------------------------------------------------------- 283s > 283s > obj1 <- list(a = iris, b = lm(dist ~ speed, cars), 1:10, matrix(letters, 283s + 2)) 283s > desc(obj1, 80) 283s [1] "list(a=data.frame[150,5], b=lm[12], int[10], chr mat[2,13])" 283s > desc(obj1, 40) 283s [1] "list[4]" 283s > desc(iris, 80) 283s [1] "data.frame[150,5]" 283s > desc(iris, 200) 283s [1] "data.frame(Sepal.Length=num[150], Sepal.Width=num[150], Petal.Length=num[150], Petal.Width=num[150], Species=fct[150])" 283s > desc(list(NULL, 1L)) 283s [1] "list(NULL, int[1])" 283s > desc(NULL) 283s [1] "NULL" 283s > unitizer:::desc(NULL) 283s [1] "NULL" 283s > unitizer:::desc(lm(y ~ x, data.frame(y = 1:10, x = runif(10)))) 283s [1] "lm[12]" 283s > unitizer:::desc(new("unitizerItem", call = quote(1 + 1), env = new.env())) 283s [1] "unitizerItem" 283s > unitizer:::desc(array(1:27, dim = rep(3, 3))) 283s [1] "array[3,3,3]" 283s > unitizer:::desc(data.frame(a = letters[1:10], b = 1:10, stringsAsFactors = TRUE)) 283s [1] "data.frame(a=fct[10], b=int[10])" 283s > 283s > # - "char_to_eng" -------------------------------------------------------------- 283s > 283s > unitizer:::char_to_eng(character(), "", "") 284s [1] "" 284s > unitizer:::char_to_eng(letters[1:4], "", "") 284s [1] "a, b, c, and d" 284s > unitizer:::char_to_eng(letters[1:2], "", "") 284s [1] "a, and b" 284s > unitizer:::char_to_eng(letters[1], "", "") 284s [1] "a" 284s > unitizer:::char_to_eng(letters[1]) 284s [1] "a was" 284s > unitizer:::char_to_eng(letters[1:2]) 284s [1] "a, and b were" 284s > 284s > 284s PASS 284s Begin testing t-translate.R 284s 284s R version 4.3.2 (2023-10-31) -- "Eye Holes" 284s Copyright (C) 2023 The R Foundation for Statistical Computing 284s Platform: aarch64-unknown-linux-gnu (64-bit) 284s 284s R is free software and comes with ABSOLUTELY NO WARRANTY. 284s You are welcome to redistribute it under certain conditions. 284s Type 'license()' or 'licence()' for distribution details. 284s 284s R is a collaborative project with many contributors. 284s Type 'contributors()' for more information and 284s 'citation()' on how to cite R or R packages in publications. 284s 284s Type 'demo()' for some demos, 'help()' for on-line help, or 284s 'help.start()' for an HTML browser interface to help. 284s Type 'q()' to quit R. 284s 284s > source(file.path("_helper", "init.R")) 284s > source(file.path("aammrtf", "ref.R")); make_ref_obj_funs("refobjs") 284s > 284s > test.file.dir <- file.path("_helper", "ref-objs", "translate") 284s > test.file <- file.path(test.file.dir, "testthat", "test-translate2.R") 284s > test.file.min <- file.path(test.file.dir, "testthat2", "test-translate-min.R") 284s > target.dir.base <- file.path(TMP.DIR, basename(tempfile())) 284s > target.dir <- file.path(target.dir.base, "helper", "translate", "unitizer") 284s > 284s > # - "Prompt to create dir" ----------------------------------------------------- 284s > 284s > try( 284s + testthat_translate_file( 284s + test.file, target.dir, prompt = "always", interactive.mode = FALSE 284s + ) ) 284s Error in testthat_transcribe_file(file.name, target.dir, keep.testthat.call, : 284s Unable to proceed without creating target directory 284s > # translations have to be outside of `testthat`; second translation should fail 284s > # except we allow manual input 284s > 284s > # - "translate a file" --------------------------------------------------------- 284s > 284s > unitizer:::capture_output({ 284s + unitizer:::read_line_set_vals(c("Y")) 284s + res1 <- testthat_translate_file(test.file, target.dir, prompt = "always", 284s + interactive.mode = TRUE) 284s + res1.txt <- readLines(res1) 284s + unitizer:::read_line_set_vals(c("Y")) 284s + res2 <- testthat_translate_file(test.file, target.dir, prompt = "overwrite", 284s + interactive.mode = TRUE) 284s + res2.txt <- readLines(res2) 284s + unitizer:::read_line_set_vals(NULL) 284s + }) 285s > dummy <- new("unitizerDummy") 285s > 285s > all.equal(res1.txt, rds("translate_res1")) 285s [1] TRUE 285s > all.equal(res1.txt, res2.txt) 285s [1] TRUE 285s > 285s > # Can't do this twice in a row without prompting in non-interactive mode 285s > # note test above does work because we use interactive mode to accept prompt 285s > 285s > any( 286s + grepl( 286s + "already exists", 286s + capture.output( 286s + try( 286s + testthat_translate_file( 286s + test.file, target.dir, prompt = "always", interactive.mode = FALSE 286s + ) ), 286s + type='message' 286s + ) ) ) 286s [1] TRUE 286s > untz <- get_unitizer(file.path(target.dir, "translate2.unitizer")) 286s > all.equal(untz@items.ref.calls.deparse, rds("translate_res2")) 286s [1] TRUE 286s > 286s > lapply(unitizer:::as.list(untz@items.ref), function(x) x@data@value[[1L]]) 286s [[1]] 286s 286s 286s [[2]] 286s [1] 1 2 3 4 5 6 7 8 9 10 286s 286s [[3]] 286s NULL 286s 286s [[4]] 286s NULL 286s 286s [[5]] 286s NULL 286s 286s [[6]] 286s NULL 286s 286s [[7]] 286s [1] "yoyo" 286s 286s [[8]] 286s NULL 286s 286s > unlink(target.dir, recursive = TRUE) 286s > 286s > target.dir.base <- file.path(TMP.DIR, basename(tempfile())) 286s > target.dir <- file.path(target.dir.base, "_helper", "translate", "unitizer") 286s > 286s > test.dir <- file.path("_helper", "ref-objs", "translate", "testthat") 286s > 286s > # - "translate a dir" ---------------------------------------------------------- 286s > 286s > unitizer:::capture_output(res2 <- testthat_translate_dir(test.dir, target.dir)) 286s > all.equal(lapply(res2, readLines), rds("translate_res3")) 286s [1] TRUE 286s > untz <- get_unitizer(file.path(target.dir, "translate2.unitizer")) 286s > all.equal(untz@items.ref.calls.deparse, rds("translate_res4")) 286s [1] TRUE 286s > 286s > # Note not the same as when we did just the single file because the helper 286s > # file is loaded so `fun0` and `fun1` are actually defined 286s > lapply(unitizer:::as.list(untz@items.ref), function(x) x@data@value[[1L]]) 286s [[1]] 286s 286s 286s [[2]] 286s [1] 1 2 3 4 5 6 7 8 9 10 286s 286s [[3]] 286s [1] 42 286s 286s [[4]] 286s [1] 24 286s 286s [[5]] 286s [1] 24 286s 286s [[6]] 286s NULL 286s 286s [[7]] 286s [1] "yoyo" 286s 286s [[8]] 286s NULL 286s 286s > 286s > # Can't do it again since there are files there 286s > any( 286s + grepl( 286s + "safety feature to ensure files are not accidentally overwritten", 286s + capture.output( 286s + try(testthat_translate_dir(test.dir, target.dir)), type='message' 286s + ) ) ) 286s [1] TRUE 286s > 286s > # - minimal -------------------------------------------------------------------- 286s > 286s > # to test parameters 286s > 286s > writeLines( 286s + readLines( 286s + testthat_translate_file( 286s + test.file.min, target.dir, prompt = "never", interactive.mode = TRUE, 286s + unitize = FALSE 286s + ) ) ) 286s # Minimal translation 286s # test_that("simple tests", { 286s # expect_equal(fun0(a), 1:10) 286s # }) 286s unitizer_sect("simple tests", { 286s # expect_equal(fun0(a), 1:10) 286s fun0(a) 286s }) 286s > writeLines( 286s + readLines( 286s + testthat_translate_file( 286s + test.file.min, target.dir, prompt = "never", interactive.mode = TRUE, 286s + use.sects = FALSE, unitize = FALSE 286s + ) ) ) 286s # Minimal translation 286s # test_that("simple tests", { 286s # expect_equal(fun0(a), 1:10) 286s # }) 286s # - "simple tests" ------------------------------------------------------------- 286s 286s 286s # expect_equal(fun0(a), 1:10) 286s fun0(a) 286s > writeLines( 286s + readLines( 286s + testthat_translate_file( 286s + test.file.min, target.dir, prompt = "never", interactive.mode = TRUE, 286s + use.sects = FALSE, keep.testthat.call = FALSE, unitize = FALSE 286s + ) ) ) 286s # Minimal translation 286s # - "simple tests" ------------------------------------------------------------- 286s 286s 286s fun0(a) 286s > 286s > 286s > 286s PASS 286s Begin testing t-upgrade.R 286s 286s R version 4.3.2 (2023-10-31) -- "Eye Holes" 286s Copyright (C) 2023 The R Foundation for Statistical Computing 286s Platform: aarch64-unknown-linux-gnu (64-bit) 286s 286s R is free software and comes with ABSOLUTELY NO WARRANTY. 286s You are welcome to redistribute it under certain conditions. 286s Type 'license()' or 'licence()' for distribution details. 286s 286s R is a collaborative project with many contributors. 286s Type 'contributors()' for more information and 286s 'citation()' on how to cite R or R packages in publications. 286s 286s Type 'demo()' for some demos, 'help()' for on-line help, or 286s 'help.start()' for an HTML browser interface to help. 286s Type 'q()' to quit R. 286s 286s > source(file.path("_helper", "init.R")) 286s > blat_vers <- function(x) sub("'\\d+(?:\\.\\d+)*'", "''", x) 286s > 286s > # - "Upgrade works" ------------------------------------------------------------ 286s > 286s > # this is also now tested as part of load 286s > unitizer <- 286s + get_unitizer(file.path("_helper", "unitizers", "trivial.unitizer.0.4.2")) 286s > try(validObject(unitizer, complete = TRUE)) 286s Error in validObject(object[[x]], complete = TRUE) : 286s invalid class "unitizerItem" object: 1: slots in class definition but not in object: "call.dep", "section.id", "section.name", "glob.indices", "state" 286s invalid class "unitizerItem" object: 2: In slot "data" of class "unitizerItemData": invalid object for slot "value" in class "unitizerItemData": got class "logical", should be or extend class "list" 286s > as.character(unitizer@version) 286s [1] "0.4.2" 286s > unitizer.up <- unitizer:::upgrade_internal(unitizer) # warning 286s Warning in addSlot(object, "cons", NULL) : 286s Slot `cons` does not exist in current version of `unitizer` so not added to object. 286s Warning in addSlot(object, "jump.to.test", 0L) : 286s Slot `jump.to.test` does not exist in current version of `unitizer` so not added to object. 286s > validObject(unitizer.up) 286s [1] TRUE 286s > identical(unitizer.up@version, as.character(packageVersion("unitizer"))) 286s [1] TRUE 286s > 286s > # - Upgrade Warnings in Unitize ------------------------------------------------ 286s > 286s > tdir <- tempfile() 286s > dir.create(tdir) 286s > dir.create(file.path(tdir, "trivial.unitizer")) 286s > file.copy(file.path("_helper", "unitizers", "trivial.R"), tdir) 286s [1] TRUE 286s > file.copy( 286s + file.path("_helper", "unitizers", "trivial.unitizer.0.4.2", "data.rds"), 286s + file.path(tdir, "trivial.unitizer") 286s + ) 286s [1] TRUE 286s > odir <- setwd(tdir) 286s > unitizer:::read_line_set_vals('N') 286s > out <- unitizer:::capture_output( 286s + try(unitize(file.path(tdir, "trivial.R"), interactive.mode=TRUE)) 286s + ) 287s > out[] <- lapply(out, blat_vers) 287s > out 287s - Output ----------------------------------------------------------------------- 287s 287s 287s | 287s | The following unitizer will be upgraded to version '': 287s | 287s | - trivial.unitizer (at '') 287s 287s unitizer> N 287s 287s - Message ---------------------------------------------------------------------- 287s 287s Warning in check_call_stack() : 287s It appears you are running unitizer inside an error handling function such as 287s `withCallingHanlders`, `tryCatch`, or `withRestarts`. This is strongly dis- 287s couraged as it may cause unpredictable behavior from unitizer in the event tests 287s produce conditions / errors. We strongly recommend you re-run your tests 287s outside of such handling functions. 287s Warning in addSlot(object, "cons", NULL) : 287s Slot `cons` does not exist in current version of `unitizer` so not added to object. 287s Warning in addSlot(object, "jump.to.test", 0L) : 287s Slot `jump.to.test` does not exist in current version of `unitizer` so not added to object. 287s Warning in load_unitizers(store.ids[active], test.files[active], par.frame = util.frame, : 287s Upgraded test file does not match original test file ('NA' vs 'trivial.R'). 287s | unitizer upgrades are IRREVERSIBLE and not backwards compatible. 287s | Proceed? 287s 287s Error in unitize_core(test.file.inf, list(store.id.inf), state = state, : 287s Cannot proceed without upgrading unitizers. 287s > 287s > unitizer:::read_line_set_vals(c('Y','Q')) 287s > out <- unitizer:::capture_output( 287s + unitize(file.path(tdir, "trivial.R"), interactive.mode=TRUE) 287s + ) 287s > out[] <- lapply(out, blat_vers) 287s > out 287s - Output ----------------------------------------------------------------------- 287s 287s 287s | 287s | The following unitizer will be upgraded to version '': 287s | 287s | - trivial.unitizer (at '') 287s 287s unitizer> Y 287s 287s +------------------------------------------------------------------------------+ 287s | unitizer for: trivial.R | 287s +------------------------------------------------------------------------------+ 287s 287s Pass Fail New 287s 1 - 3 287s ........................... 287s 1 - 3 287s 287s - New -------------------------------------------------------------------------- 287s 287s | The 3 tests in this section are new. Add tests to store ([Y]es, [N]o, [P]rev, 287s | [B]rowse, [R]erun, [Q]uit, [H]elp)? 287s 287s > x <- 1 + 1 287s > x + 2 287s [1] 4 287s 287s unitizer> Q 287s 287s | unitizer unchanged. 287s 287s - Message ---------------------------------------------------------------------- 287s 287s Warning in addSlot(object, "cons", NULL) : 287s Slot `cons` does not exist in current version of `unitizer` so not added to object. 287s Warning in addSlot(object, "jump.to.test", 0L) : 287s Slot `jump.to.test` does not exist in current version of `unitizer` so not added to object. 287s Warning in load_unitizers(store.ids[active], test.files[active], par.frame = util.frame, : 287s Upgraded test file does not match original test file ('NA' vs 'trivial.R'). 287s | unitizer upgrades are IRREVERSIBLE and not backwards compatible. 287s | Proceed? 287s 287s | No changes recorded. 287s > unitizer:::read_line_set_vals(NULL) 287s > setwd(odir) 287s > unlink(tdir, recursive=TRUE) 287s > 287s > # - Upgrade Multiple Unitizers Unitize ----------------------------------------- 287s > 287s > tdir <- tempfile() 287s > dir.create(tdir) 287s > dir.create(file.path(tdir, "trivial1.unitizer")) 287s > dir.create(file.path(tdir, "trivial2.unitizer")) 287s > file.copy( 287s + file.path("_helper", "unitizers", "trivial.R"), 287s + file.path(tdir, c("trivial1.R", "trivial2.R")) 287s + ) 287s [1] TRUE TRUE 287s > file.copy( 287s + file.path("_helper", "unitizers", "trivial.unitizer.0.4.2", "data.rds"), 287s + file.path(tdir, "trivial1.unitizer") 287s + ) 287s [1] TRUE 287s > file.copy( 287s + file.path("_helper", "unitizers", "trivial.unitizer.0.4.2", "data.rds"), 287s + file.path(tdir, "trivial2.unitizer") 287s + ) 287s [1] TRUE 287s > odir <- setwd(tdir) 287s > unitizer:::read_line_set_vals(c('Y','Q')) 287s > out <- unitizer:::capture_output( 287s + unitize_dir(tdir, interactive.mode=TRUE) 287s + ) 288s > out[] <- lapply(out, blat_vers) 288s > out 288s - Output ----------------------------------------------------------------------- 288s 288s 288s | 288s | The following unitizers will be upgraded to version '': 288s | 288s | - trivial1.unitizer (at '') 288s | - trivial2.unitizer (at '') 288s 288s unitizer> Y 288s 288s | Summary of files in common directory '.': 288s | 288s | Pass Fail New 288s | *1. trivial1.R 1 - 3 288s | *2. trivial2.R 1 - 3 288s | .............................. 288s | 2 - 6 288s | Legend: 288s | * `unitizer` requires review 288s 288s | Type number of unitizer to review, 'A' to review all that require review 288s 288s unitizer> Q 288s 288s - Message ---------------------------------------------------------------------- 288s 288s Warning in addSlot(object, "cons", NULL) : 288s Slot `cons` does not exist in current version of `unitizer` so not added to object. 288s Warning in addSlot(object, "jump.to.test", 0L) : 288s Slot `jump.to.test` does not exist in current version of `unitizer` so not added to object. 288s Warning in addSlot(object, "cons", NULL) : 288s Slot `cons` does not exist in current version of `unitizer` so not added to object. 288s Warning in addSlot(object, "jump.to.test", 0L) : 288s Slot `jump.to.test` does not exist in current version of `unitizer` so not added to object. 288s Warning in load_unitizers(store.ids[active], test.files[active], par.frame = util.frame, : 288s Upgraded test file does not match original test file ('NA' vs 'trivial1.R'). 288s Warning in load_unitizers(store.ids[active], test.files[active], par.frame = util.frame, : 288s Upgraded test file does not match original test file ('NA' vs 'trivial2.R'). 288s | unitizer upgrades are IRREVERSIBLE and not backwards compatible. 288s | Proceed? 288s 288s > unitizer:::read_line_set_vals(NULL) 288s > setwd(odir) 288s > unlink(tdir, recursive=TRUE) 288s > 288s > # - "Rename" ------------------------------------------------------------------- 288s > 288s > setClass("untzUpgrTest", slots = c(a = "character")) 288s > x <- new("untzUpgrTest", a = letters) 288s > validObject(x) 288s [1] TRUE 288s > setClass("untzUpgrTest", slots = c(b = "character")) 288s > try(validObject(x)) 288s Error in validObject(x) : 288s invalid class "untzUpgrTest" object: slots in class definition but not in object: "b" 288s > try(capture.output(unitizer:::renameSlot(x, "c", "b"), type = "message")) 288s Error in unitizer:::renameSlot(x, "c", "b") : 288s Old slot `c` doesn't exist in object 288s > x.rename <- unitizer:::renameSlot(x, "a", "b") 288s > validObject(x.rename) 288s [1] TRUE 288s > 288s > # - "Later but valid version" -------------------------------------------------- 288s > 288s > test.file <- file.path(TMP.DIR, "tests.R") 288s > cat("1 + 1", file = test.file) 288s > unitizer:::capture_output(unitize(test.file, auto.accept = "new")) 288s > version <- unlist(strsplit(as.character(packageVersion("unitizer")), 288s + ".", fixed = TRUE)) 288s > version[1] <- as.character(as.numeric(version[1]) + 1) 288s > version.new <- paste0(version, collapse = ".") 288s > unitizer.rds <- readRDS(file.path(TMP.DIR, "tests.unitizer", "data.rds")) 288s > unitizer.rds@version <- version.new 288s > # this should work 288s > !nchar(unitizer:::unitizer_valid(unitizer.rds)) 288s [1] TRUE 288s > # now lets cause an error 288s > unitizer.rds@eval.time <- runif(5) 288s > grepl("NB: ", unitizer:::unitizer_valid(unitizer.rds)) 288s [1] TRUE 288s > 288s > # - "Failing Test w/ Upgrade" -------------------------------------------------- 288s > 288s > # Unitizer will fail, but also requires an upgrade. This ensures the failure is 288s > # shown despite the need for an upgrade. 288s > tdir <- tempfile() 288s > dir.create(tdir) 288s > dir.create(file.path(tdir, "fail-and-upgrade.unitizer")) 288s > file.copy(file.path("_helper", "unitizers", "fail-and-upgrade.R"), tdir) 288s [1] TRUE 288s > file.copy( 288s + file.path("_helper", "unitizers", "fail-and-upgrade.unitizer", "data.rds"), 288s + file.path(tdir, "fail-and-upgrade.unitizer") 288s + ) 288s [1] TRUE 288s > odir <- setwd(tdir) 288s > try(unitize(file.path("fail-and-upgrade.R"))) 288s 288s Warning in check_call_stack() : 288s It appears you are running unitizer inside an error handling function such as 288s `withCallingHanlders`, `tryCatch`, or `withRestarts`. This is strongly dis- 288s couraged as it may cause unpredictable behavior from unitizer in the event tests 288s produce conditions / errors. We strongly recommend you re-run your tests 288s outside of such handling functions. 288s Warning in history_capt(history, interactive.mode) : 288s Unable to capture history in non-interactive mode. 288s +------------------------------------------------------------------------------+ 288s | unitizer for: fail-and-upgrade.R | 288s +------------------------------------------------------------------------------+ 288s 288s Pass Fail 288s - 1 288s ...................... 288s - 1 288s 288s - Failed ----------------------------------------------------------------------- 288s 288s | The following test failed because the new evaluation does not match the 288s | reference value from the store. Overwrite with new result ([Y]es, [N]o, 288s | [P]rev, [B]rowse, [R]erun, [Q]uit, [H]elp)? 288s 288s # fails with newer versions of unitizer so we can make sure upgrade shows error 288s # and doesn't just gag at the upgrade prompt 288s 288s > packageVersion("unitizer") < "1.4.15" 288s [1] FALSE 288s 288s | Value mismatch: 288s 288s < .ref > .new 288s @@ 1 @@ @@ 1 @@ 288s < [1] TRUE > [1] FALSE 288s 288s | State mismatch; see `.DIFF$state` for details. 288s 288s | User input required to proceed, but we are in non-interactive mode. 288s 288s | unitizer unchanged. 288s 288s | * Fail: packageVersion("unitizer") < "1.4.15" 288s | in 'fail-and-upgrade.R' 288s 288s | Newly evaluated tests do not match unitizer (Fail: 1); see above for more 288s | info, or run in interactive mode. 288s 288s Error in unitize_core(test.file.inf, list(store.id.inf), state = state, : 288s Cannot proceed in non-interactive mode. 288s > 288s > # Confirm upgrade needed 288s > capture.output(unitizer:::read_line_set_vals(c('Y', 'Q'))) 288s character(0) 288s > out <- unitizer:::capture_output( 288s + unitize(file.path("fail-and-upgrade.R"), interactive.mode=TRUE) 288s + ) 288s > out[] <- lapply(out, blat_vers) 288s > out 288s - Output ----------------------------------------------------------------------- 288s 288s 288s | 288s | The following unitizer will be upgraded to version '': 288s | 288s | - fail-and-upgrade.unitizer (at '') 288s 288s unitizer> Y 288s 288s +------------------------------------------------------------------------------+ 288s | unitizer for: fail-and-upgrade.R | 288s +------------------------------------------------------------------------------+ 288s 288s Pass Fail 288s - 1 288s ...................... 288s - 1 288s 288s - Failed ----------------------------------------------------------------------- 288s 288s | The following test failed because the new evaluation does not match the 288s | reference value from the store. Overwrite with new result ([Y]es, [N]o, 288s | [P]rev, [B]rowse, [R]erun, [Q]uit, [H]elp)? 288s 288s # fails with newer versions of unitizer so we can make sure upgrade shows error 288s # and doesn't just gag at the upgrade prompt 288s 288s > packageVersion("unitizer") < "1.4.15" 288s [1] FALSE 288s 288s | Value mismatch: 288s 288s < .ref > .new 288s @@ 1 @@ @@ 1 @@ 288s < [1] TRUE > [1] FALSE 288s 288s | State mismatch; see `.DIFF$state` for details. 288s 288s unitizer> Q 288s 288s | unitizer unchanged. 288s 288s - Message ---------------------------------------------------------------------- 288s 288s | unitizer upgrades are IRREVERSIBLE and not backwards compatible. 288s | Proceed? 288s 288s | No changes recorded. 288s > 288s > unitizer:::read_line_set_vals(NULL) 288s > setwd(odir) 288s > unlink(tdir, recursive=TRUE) 288s > 288s > 288s PASS 288s Begin testing t-utz1.R 288s 288s R version 4.3.2 (2023-10-31) -- "Eye Holes" 288s Copyright (C) 2023 The R Foundation for Statistical Computing 288s Platform: aarch64-unknown-linux-gnu (64-bit) 288s 288s R is free software and comes with ABSOLUTELY NO WARRANTY. 288s You are welcome to redistribute it under certain conditions. 288s Type 'license()' or 'licence()' for distribution details. 288s 288s R is a collaborative project with many contributors. 288s Type 'contributors()' for more information and 288s 'citation()' on how to cite R or R packages in publications. 288s 288s Type 'demo()' for some demos, 'help()' for on-line help, or 288s 'help.start()' for an HTML browser interface to help. 288s Type 'q()' to quit R. 288s 289s > # - "No Attach Test" ----------------------------------------------------------- 289s > 289s > f <- paste0(tempfile(), ".R") 289s > writeLines("1 + 1", f) 289s > try(unitizer::unitize(f)) 289s 289s Error in unitize_core(test.file.inf, list(store.id.inf), state = state, : 289s `unitizer` package must be attached to the search path, e.g. with `library(unitizer)` 289s > unlink(f) 289s > 289s > # - "Usual Setup" -------------------------------------------------------------- 289s > 289s > source(file.path("_helper", "init.R")) 289s > source(file.path("aammrtf", "ref.R")); make_ref_obj_funs("refobjs") 289s > source(file.path("_helper", "pkgs.R")) 289s Install Packages 292s Setup Demos 292s > 292s > # - "custom history file" ------------------------------------------------------ 292s > 292s > # Random history file 292s > unitizer:::read_line_set_vals(c("1 + 1", "Y", "Y", "Y", "Y", "N")) 292s > hist.file <- tempfile() 292s > invisible( 292s + unitizer:::capture_output( 292s + unitize(FLM.TEST.FILE, interactive.mode = TRUE, history = hist.file) 292s + ) ) 293s > hist.dat <- readLines(hist.file) 293s > unlink(hist.file) 293s > 293s > # History only works in interactive mode 293s > if (interactive()) { 293s + identical(hist.dat, c("## (original history will be restored on exit)", 293s + "library(utzflm, lib.loc = getOption(\"unitizer.tmp.lib.loc\"))", 293s + "dat <- data.frame(x = 1:100, y = (1:100)^2)", "res <- fastlm(dat$x, dat$y)", 293s + "res", "1 + 1", "get_slope(res)", "get_rsq(res)", "fastlm(1:100, 1:10)")) 293s + } else { 293s + identical(hist.dat, character()) 293s + } 293s [1] TRUE 293s > # - "bad history" -------------------------------------------------------------- 293s > 293s > bad.hist <- try(unitize(FLM.TEST.FILE, history = list()), silent = TRUE) 293s 293s > inherits(bad.hist, "try-error") 293s [1] TRUE 293s > conditionMessage(attr(bad.hist, "condition")) 293s [1] "Argument `history` must be the name of a file that can be opened in \"at\" mode, or \"\", or NULL" 293s > 293s > # - "bad seed" ----------------------------------------------------------------- 293s > 293s > # gsub needed b/c of inconsistent error calls in 3.3.2 and 3.4 293s > old.opt <- options(unitizer.seed = "bad.seed") 293s > txtopt1 <- unitizer:::capture_output(try(unitize(FLM.TEST.FILE))) 293s > options(unitizer.seed = list("bad.seed")) 293s > txtopt2 <- unitizer:::capture_output(try(unitize(FLM.TEST.FILE))) 293s > # set.seed gained an argument c.a. R3.6 that caused error mismatch 293s > txtopt2$message[grepl("\\(function \\(seed", txtopt2$message, 293s + ignore.case = TRUE)] <- "" 293s > options(old.opt) 293s > 293s > 293s > unitizer:::clean_eval_exp(txtopt1) 293s - Output ----------------------------------------------------------------------- 293s 293s 293s - Message ---------------------------------------------------------------------- 293s 293s Error in do.call(set.seed, seed.dat) : second argument must be a list 293s Error in as.state(state, test.files) : 293s Internal Error: failed processing raw state object, contact maintainer. (Unable to set random seed; make sure `getOption('unitizer.seed')` is a list of possible arguments to `set.seed`, or set `seed` slot to be less than 2L.) 293s Error in unitize_core(test.file.inf, list(store.id.inf), state = state, : 293s Argument `state` could not be evaluated. 293s > # supplied seed not valid int 293s > # unexpectedly exited; not clear why all stderr is not being captured by 293s > # capture_output... 293s > txtopt2 293s - Output ----------------------------------------------------------------------- 293s 293s 293s - Message ---------------------------------------------------------------------- 293s 293s 293s NAs introduced by coercion 293s 293s supplied seed is not a valid integer 293s Error in as.state(state, test.files) : 293s Internal Error: failed processing raw state object, contact maintainer. (Unable to set random seed; make sure `getOption('unitizer.seed')` is a list of possible arguments to `set.seed`, or set `seed` slot to be less than 2L.) 293s Error in unitize_core(test.file.inf, list(store.id.inf), state = state, : 293s Argument `state` could not be evaluated. 293s > 293s > # - "create dir" --------------------------------------------------------------- 293s > 293s > # Unitizers in different directories that don't exist; also test using a 293s > # function to generate those directories 293s > get_store_id <- function(x) { 293s + file <- basename(x) 293s + dir <- dirname(dirname(x)) 293s + file.path(dir, "unitizer2", sub("(.*)\\.R", "\\1.unitizer", 293s + file)) 293s + } 293s > unitizer:::read_line_set_vals(c("N")) 293s > txt1 <- unitizer:::capture_output( 293s + untz1 <- try(unitize_dir(FLM.TEST.DIR, get_store_id, interactive.mode = TRUE)) 293s + ) 293s > unitizer:::read_line_set_vals(c("Y", "Q")) 293s > txt2 <- unitizer:::capture_output(untz2 <- unitize_dir(FLM.TEST.DIR, 293s + get_store_id, interactive.mode = TRUE)) 293s > 293s > inherits(untz1, "try-error") 293s [1] TRUE 293s > inherits(untz2, "unitizer_results") 293s [1] TRUE 293s > 293s > # Some of the text must be ablated 293s > rem_txt <- function(x) { 293s + crd <- grep("Create directory\\?", x) 293s + if (!length(crd)) 293s + stop("Logic Error: this must be a create directory test") 293s + x[-(2L:(crd[[1L]] - 1L))] 293s + } 293s > txt1$output <- rem_txt(txt1$output) 293s > txt2$output <- rem_txt(txt2$output) 293s > 293s > # must create the following directory 293s > # cannot proceed w/o creating directories 293s > 293s > txt1 293s - Output ----------------------------------------------------------------------- 293s 293s 293s | Create directory? 293s 293s unitizer> N 293s 293s - Message ---------------------------------------------------------------------- 293s 293s Warning in check_call_stack() : 293s It appears you are running unitizer inside an error handling function such as 293s `withCallingHanlders`, `tryCatch`, or `withRestarts`. This is strongly dis- 293s couraged as it may cause unpredictable behavior from unitizer in the event tests 293s produce conditions / errors. We strongly recommend you re-run your tests 293s outside of such handling functions. 293s Error in unitize_core(test.files = test.files, store.ids = store.ids, : 293s Cannot proceed without creating directories. 293s > txt2 293s - Output ----------------------------------------------------------------------- 293s 293s 293s | Create directory? 293s 293s unitizer> Y 293s 293s | Summary of files in common directory 'unitizer': 293s | 293s | Pass Fail New 293s | *1. fastlm1.R - - 4 293s | *2. fastlm2.R - - 1 293s | *3. unitizer.fastlm.R - - 3 293s | ..................................... 293s | - - 8 293s | Legend: 293s | * `unitizer` requires review 293s 293s | Type number of unitizer to review, 'A' to review all that require review 293s 293s unitizer> Q 293s 293s - Message ---------------------------------------------------------------------- 293s 293s 293s > 293s > # - print / dir ---------------------------------------------------------------- 293s > 293s > # quit from all at once 293s > unitizer:::read_line_set_vals(c("A", "QQ", "Q")) 293s > unitize_dir(FLM.TEST.DIR, interactive.mode = TRUE) 293s 294s | Summary of files in common directory 'unitizer': 294s | 294s | Pass Fail New 294s | *1. fastlm1.R - - 4 294s | *2. fastlm2.R - - 1 294s | *3. unitizer.fastlm.R - - 3 294s | ..................................... 294s | - - 8 294s | Legend: 294s | * `unitizer` requires review 294s 294s | Type number of unitizer to review, 'A' to review all that require review 294s 294s unitizer> A 294s 294s +------------------------------------------------------------------------------+ 294s | unitizer for: unitizer/fastlm1.R | 294s +------------------------------------------------------------------------------+ 294s 294s Pass Fail New 294s - - 4 294s ........................... 294s - - 4 294s 294s - New -------------------------------------------------------------------------- 294s 294s | The 4 tests in this section are new. Add tests to store ([Y]es, [N]o, [P]rev, 294s | [B]rowse, [R]erun, [QQ]uit All, [Q]uit, [H]elp)? 294s 294s # Assignments and calls to `library` are not considered tests by 294s # `unitizer` so you will not need to review them 294s 294s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 294s > dat <- data.frame(x = 1:100, y = (1:100)^2) 294s > res <- fastlm(dat$x, dat$y) 294s 294s # The `unitizer>` prompt is like the standard R prompt. You may 294s # enter expressions such as `lm(y ~ x, dat)$coefficients`, or 294s # `str(res)`. 294s # 294s # Once you are done reviewing, you need to tell `unitizer` you 294s # accept the test by typing 'Y' at the prompt. Enter 'H' for help. 294s 294s > res 294s intercept slope rsq 294s -1717.000 101.000 0.939 294s attr(,"class") 294s [1] "fastlm" 294s 294s unitizer> QQ 294s 294s | No changes recorded. 294s | unitizer unchanged. 294s 294s | Summary of files in common directory 'unitizer': 294s | 294s | Pass Fail New 294s | *1. fastlm1.R - - 4 294s | *2. fastlm2.R - - 1 294s | *3. unitizer.fastlm.R - - 3 294s | ..................................... 294s | - - 8 294s | Legend: 294s | * `unitizer` requires review 294s 294s | Type number of unitizer to review, 'A' to review all that require review 294s 294s unitizer> Q 294s 294s > 294s > # Now test `unitize_dir`; we are testing all different combination of whether 294s > # a unitizer is accepted and updated 294s > # Review all 294s > # Accept all 294s > # Quit 294s > # Quit 294s > # Re-evalute 294s > # Review remaining 294s > # Accept all 294s > # Quit from review 294s > # Quit completely 294s > 294s > unitizer:::read_line_set_vals(c("A", "Y", "Y", "Y", "Y", "Y", 294s + "Q", "Q", "R", "A", "Y", "Y", "Q", "Q")) 294s > untz3a <- unitize_dir(FLM.TEST.DIR, interactive.mode = TRUE) 294s 294s | Summary of files in common directory 'unitizer': 294s | 294s | Pass Fail New 294s | *1. fastlm1.R - - 4 294s | *2. fastlm2.R - - 1 294s | *3. unitizer.fastlm.R - - 3 294s | ..................................... 294s | - - 8 294s | Legend: 294s | * `unitizer` requires review 294s 294s | Type number of unitizer to review, 'A' to review all that require review 294s 294s unitizer> A 294s 294s +------------------------------------------------------------------------------+ 294s | unitizer for: unitizer/fastlm1.R | 294s +------------------------------------------------------------------------------+ 294s 294s Pass Fail New 294s - - 4 294s ........................... 294s - - 4 294s 294s - New -------------------------------------------------------------------------- 294s 294s | The 4 tests in this section are new. Add tests to store ([Y]es, [N]o, [P]rev, 294s | [B]rowse, [R]erun, [QQ]uit All, [Q]uit, [H]elp)? 294s 294s # Assignments and calls to `library` are not considered tests by 294s # `unitizer` so you will not need to review them 294s 294s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 294s > dat <- data.frame(x = 1:100, y = (1:100)^2) 294s > res <- fastlm(dat$x, dat$y) 294s 294s # The `unitizer>` prompt is like the standard R prompt. You may 294s # enter expressions such as `lm(y ~ x, dat)$coefficients`, or 294s # `str(res)`. 294s # 294s # Once you are done reviewing, you need to tell `unitizer` you 294s # accept the test by typing 'Y' at the prompt. Enter 'H' for help. 294s 294s > res 294s intercept slope rsq 294s -1717.000 101.000 0.939 294s attr(,"class") 294s [1] "fastlm" 294s 294s unitizer> Y 294s 294s # There are three more tests to review; accept them with 'Y' 294s 294s > get_slope(res) 294s [1] 101 294s 294s unitizer> Y 294s 294s > get_rsq(res) 294s [1] 0.939 294s 294s unitizer> Y 294s 294s # This last test is expected to cause an error; press 'Y' to 294s # accept it so future checks can confirm the same error persists 294s 294s > fastlm(1:100, 1:10) 294s Error in fastlm(1:100, 1:10) : 294s Arguments `x` and `y` must be the same length. 294s 294s unitizer> Y 294s 294s = Finalize Unitizer ============================================================ 294s 294s | You will IRREVERSIBLY modify 'unitizer/fastlm1.unitizer' by: 294s | - Adding 4 out of 4 new tests 294s 294s | Update unitizer ([Y]es, [N]o, [P]rev, [B]rowse, [R]erun, [QQ]uit All)? 294s 294s unitizer> Y 294s 294s | unitizer updated. 294s 294s +------------------------------------------------------------------------------+ 294s | unitizer for: unitizer/fastlm2.R | 294s +------------------------------------------------------------------------------+ 294s 294s Pass Fail New 294s - - 1 294s ........................... 294s - - 1 294s 294s - New -------------------------------------------------------------------------- 294s 294s | The following test is new. Add test to store ([Y]es, [N]o, [P]rev, [B]rowse, 294s | [R]erun, [QQ]uit All, [Q]uit, [H]elp)? 294s 294s # For internal tests only; not for demo 294s 294s > x <- 1:10 294s > y <- 1:10^3 294s > res <- summary(lm(y ~ x, data.frame(x = x, y = y))) 294s > intercept <- res$coefficients[1, 1] 294s > slope <- res$coefficients[2, 1] 294s > rsq <- res$r.squared 294s > structure(c(intercept = intercept, slope = slope, rsq = rsq), 294s + class = "fastlm") 294s intercept slope rsq 294s 4.95e+02 1.00e+00 9.90e-05 294s attr(,"class") 294s [1] "fastlm" 294s 294s unitizer> Q 294s 294s | No changes recorded. 294s | unitizer unchanged. 294s 294s +------------------------------------------------------------------------------+ 294s | unitizer for: unitizer/unitizer.fastlm.R | 294s +------------------------------------------------------------------------------+ 294s 294s Pass Fail New 294s - - 3 294s ........................... 294s - - 3 294s 294s - New -------------------------------------------------------------------------- 294s 294s | The 3 tests in this section are new. Add tests to store ([Y]es, [N]o, [P]rev, 294s | [B]rowse, [R]erun, [QQ]uit All, [Q]uit, [H]elp)? 294s 294s # Extra test file for internal tests; not for DEMO 294s 294s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 294s > x <- 1:10 294s > y <- x^3 294s > res <- fastlm(x, y) 294s > get_slope(res) 294s [1] 105 294s 294s unitizer> Q 294s 294s | No changes recorded. 294s | unitizer unchanged. 294s 294s | Summary of files in common directory 'unitizer': 294s | 294s | Pass Fail New 294s | $1. fastlm1.R ? ? ? 294s | *2. fastlm2.R - - 1 294s | *3. unitizer.fastlm.R - - 3 294s | ..................................... 294s | ? ? ? 294s | Legend: 294s | * `unitizer` requires review 294s | $ `unitizer` has been modified and needs to be re-run to recompute summary 294s 294s | Type number of unitizer to review, 'A' to review all that require review, 'R' 294s | to re-run all updated 294s 294s unitizer> R 294s 294s | Summary of files in common directory 'unitizer': 294s | 294s | Pass Fail New 294s | 1. fastlm1.R 4 - - 294s | *2. fastlm2.R - - 1 294s | *3. unitizer.fastlm.R - - 3 294s | ..................................... 294s | 4 - 4 294s | Legend: 294s | * `unitizer` requires review 294s 294s | Type number of unitizer to review, 'A' to review all that require review 294s 294s unitizer> A 294s 294s +------------------------------------------------------------------------------+ 294s | unitizer for: unitizer/fastlm2.R | 294s +------------------------------------------------------------------------------+ 294s 294s Pass Fail New 294s - - 1 294s ........................... 294s - - 1 294s 294s - New -------------------------------------------------------------------------- 294s 294s | The following test is new. Add test to store ([Y]es, [N]o, [P]rev, [B]rowse, 294s | [R]erun, [QQ]uit All, [Q]uit, [H]elp)? 294s 294s # For internal tests only; not for demo 294s 294s > x <- 1:10 294s > y <- 1:10^3 294s > res <- summary(lm(y ~ x, data.frame(x = x, y = y))) 294s > intercept <- res$coefficients[1, 1] 294s > slope <- res$coefficients[2, 1] 294s > rsq <- res$r.squared 294s > structure(c(intercept = intercept, slope = slope, rsq = rsq), 294s + class = "fastlm") 294s intercept slope rsq 294s 4.95e+02 1.00e+00 9.90e-05 294s attr(,"class") 294s [1] "fastlm" 294s 294s unitizer> Y 294s 294s = Finalize Unitizer ============================================================ 294s 294s | You will IRREVERSIBLY modify 'unitizer/fastlm2.unitizer' by: 294s | - Adding 1 out of 1 new tests 294s 294s | Update unitizer ([Y]es, [N]o, [P]rev, [B]rowse, [R]erun, [QQ]uit All)? 294s 294s unitizer> Y 294s 294s | unitizer updated. 294s 294s +------------------------------------------------------------------------------+ 294s | unitizer for: unitizer/unitizer.fastlm.R | 294s +------------------------------------------------------------------------------+ 294s 294s Pass Fail New 294s - - 3 294s ........................... 294s - - 3 294s 294s - New -------------------------------------------------------------------------- 294s 294s | The 3 tests in this section are new. Add tests to store ([Y]es, [N]o, [P]rev, 294s | [B]rowse, [R]erun, [QQ]uit All, [Q]uit, [H]elp)? 294s 294s # Extra test file for internal tests; not for DEMO 294s 294s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 294s > x <- 1:10 294s > y <- x^3 294s > res <- fastlm(x, y) 294s > get_slope(res) 294s [1] 105 294s 294s unitizer> Q 294s 294s | No changes recorded. 294s | unitizer unchanged. 294s 294s | Summary of files in common directory 'unitizer': 294s | 294s | Pass Fail New 294s | 1. fastlm1.R 4 - - 294s | $2. fastlm2.R ? ? ? 294s | *3. unitizer.fastlm.R - - 3 294s | ..................................... 294s | ? ? ? 294s | Legend: 294s | * `unitizer` requires review 294s | $ `unitizer` has been modified and needs to be re-run to recompute summary 294s 294s | Type number of unitizer to review, 'A' to review all that require review, 'R' 294s | to re-run all updated 294s 294s unitizer> Q 294s 294s > untz3a.get.all <- vapply(get_unitizer(untz3a), class, character(1L)) 294s > identical(untz3a.get.all, c("unitizer", "unitizer", "logical")) 294s [1] TRUE 294s > print(untz3a) 294s Summary of tests (accept/total): 294s 294s id test.file New Passed Totals 294s 1 fastlm1.R 0/0 4/4 4/4 $ 294s 2 fastlm2.R 1/1 0/0 1/1 294s 3 unitizer.fastlm.R 0/3 0/0 0/3 * 294s ----------------------------------------------------- 294s 0 Totals 1/4 4/4 5/8 294s 294s * unitizer was not saved 294s $ unitizer was saved in prior evaluation 294s 294s Test files in common directory 'tests/unitizer' 294s > untz3a.first <- untz3a[[1L]] 294s > print(untz3a.first) 294s Test File: tests/unitizer/fastlm1.R 294s Store ID: tests/unitizer/fastlm1.unitizer 294s 294s id call ignored status user reviewed 294s 1 1 library(utzflm, lib.loc = g... * Passed Y FALSE 294s 2 2 dat <- data.frame(x = 1:100... * Passed Y FALSE 294s 3 3 res <- fastlm(dat$x, dat$y) * Passed Y FALSE 294s 4 4 res Passed Y FALSE 294s 5 5 get_slope(res) Passed Y FALSE 294s 6 6 get_rsq(res) Passed Y FALSE 294s 7 7 fastlm(1:100, 1:10) Passed Y FALSE 294s 294s You chose NOT to save these changes to the unitizer store 294s > 294s > identical(class(untz3a), "unitizer_results") 294s [1] TRUE 294s > identical( 294s + lapply(untz3a, class), 294s + replicate(3L, c("unitizer_result", "data.frame"), simplify = FALSE) 294s + ) 294s [1] TRUE 294s > 294s > untz3a.cpy <- untz3a 294s > # need to drop temp file attributes for tests 294s > for (i in seq_along(untz3a.cpy)) { 294s + attr(untz3a.cpy[[i]], "test.file") <- basename(attr(untz3a.cpy[[i]], 294s + "test.file")) 294s + attr(untz3a.cpy[[i]], "store.id") <- basename(attr(untz3a.cpy[[i]], 294s + "store.id")) 294s + } 294s > all.equal(untz3a.cpy, rds("unitize_res1")) 294s [1] TRUE 294s > 294s > # dummy class for errors 294s > untz3a.first.bad <- untz3a.first 294s > setClass("uhtsdfoqiuerhzb", slots=c(a='integer')) 294s > attr(untz3a.first.bad, "store.id") <- new("uhtsdfoqiuerhzb") 294s > print(untz3a.first.bad) 294s Test File: tests/unitizer/fastlm1.R 294s Store ID: 294s 294s id call ignored status user reviewed 294s 1 1 library(utzflm, lib.loc = g... * Passed Y FALSE 294s 2 2 dat <- data.frame(x = 1:100... * Passed Y FALSE 294s 3 3 res <- fastlm(dat$x, dat$y) * Passed Y FALSE 294s 4 4 res Passed Y FALSE 294s 5 5 get_slope(res) Passed Y FALSE 294s 6 6 get_rsq(res) Passed Y FALSE 294s 7 7 fastlm(1:100, 1:10) Passed Y FALSE 294s 294s You chose NOT to save these changes to the unitizer store 294s > 294s > # this is a bit contrived as it isn't possible to directly create an empty 294s > # unitize dir result 294s > untz3a.empty <- untz3a[0] 294s > class(untz3a.empty) <- class(untz3a) 294s > print(untz3a.empty) 294s | No unitizers 294s 294s > 294s > # Now accept the last remaining tests 294s > # unlink(list.files(test.dir, pattern="\\.unitizer$", full.names=TRUE), 294s > # recursive=TRUE) 294s > # Invalid input 294s > # Review third unitizer 294s > # Accept all 294s > # Re-eval and exit (again, not clear this is right thing to do) 294s > unitizer:::read_line_set_vals(c("3000", "3", "Y", "Y", "Y", "Y", 294s + "R")) 294s > untz3b <- unitize_dir(FLM.TEST.DIR, interactive.mode = TRUE) 294s 295s | Summary of files in common directory 'unitizer': 295s | 295s | Pass Fail New 295s | 1. fastlm1.R 4 - - 295s | 2. fastlm2.R 1 - - 295s | *3. unitizer.fastlm.R - - 3 295s | ..................................... 295s | 5 - 3 295s | Legend: 295s | * `unitizer` requires review 295s 295s | Type number of unitizer to review, 'A' to review all that require review 295s 295s unitizer> 3000 295s | Type a number in `1:3` at the prompt 295s [1] 3000 295s unitizer> 3 295s +------------------------------------------------------------------------------+ 295s | unitizer for: unitizer/unitizer.fastlm.R | 295s +------------------------------------------------------------------------------+ 295s 295s Pass Fail New 295s - - 3 295s ........................... 295s - - 3 295s 295s - New -------------------------------------------------------------------------- 295s 295s | The 3 tests in this section are new. Add tests to store ([Y]es, [N]o, [P]rev, 295s | [B]rowse, [R]erun, [Q]uit, [H]elp)? 295s 295s # Extra test file for internal tests; not for DEMO 295s 295s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 295s > x <- 1:10 295s > y <- x^3 295s > res <- fastlm(x, y) 295s > get_slope(res) 295s [1] 105 295s 295s unitizer> Y 295s 295s > get_rsq(res) 295s [1] 0.862 295s 295s unitizer> Y 295s 295s > get_intercept(res) 295s [1] -277 295s 295s unitizer> Y 295s 295s = Finalize Unitizer ============================================================ 295s 295s | You will IRREVERSIBLY modify 'unitizer/unitizer.fastlm.unitizer' by: 295s | - Adding 3 out of 3 new tests 295s 295s | Update unitizer ([Y]es, [N]o, [P]rev, [B]rowse, [R]erun)? 295s 295s unitizer> Y 295s 295s | unitizer updated. 295s 295s | Summary of files in common directory 'unitizer': 295s | 295s | Pass Fail 295s | 1. fastlm1.R 4 - 295s | 2. fastlm2.R 1 - 295s | $3. unitizer.fastlm.R ? ? 295s | ................................ 295s | ? ? 295s | Legend: 295s | $ `unitizer` has been modified and needs to be re-run to recompute summary 295s 295s | Type number of unitizer to review, 'A' to review all that require review, 'R' 295s | to re-run all updated 295s 295s unitizer> R 295s 295s | Summary of files in common directory 'unitizer': 295s | 295s | Pass Fail 295s | 1. fastlm1.R 4 - 295s | 2. fastlm2.R 1 - 295s | 3. unitizer.fastlm.R 3 - 295s | ................................ 295s | 8 - 295s 295s | 8/8 tests passed; nothing to review. 295s 295s > print(untz3b) 295s Summary of tests (accept/total): 295s 295s id test.file Passed 295s 1 fastlm1.R 4/4 * 295s 2 fastlm2.R 1/1 * 295s 3 unitizer.fastlm.R 3/3 $ 295s --------------------------------- 295s 0 Totals 8/8 295s 295s * unitizer was not saved 295s $ unitizer was saved in prior evaluation 295s 295s Test files in common directory 'tests/unitizer' 295s > identical( 295s + vapply(get_unitizer(untz3b), class, character(1L)), rep("unitizer", 3L) 295s + ) 295s [1] TRUE 295s > # - "namespace conflict" ------------------------------------------------------- 295s > 295s > # Namespace conflicts; unfortunately if either `covr` or `data.table` are 295s > # loaded this may not work quite right. Also as of `covr` 2.2.2 it seems that 295s > # the R session `covr` launches now seems to load the covr namespace. The 295s > # logic here ensures covr namespace is always loaded for this tests, if 295s > # possible. So we omit the line were what namespaces could not be unloaded are 295s > # mentioned. 295s > 295s > unitizer:::read_line_set_vals("Y") 295s > ns.conf1 <- unitizer:::capture_output( 295s + unitize_dir(FLM.TEST.DIR, state = "pristine", interactive.mode = TRUE) 295s + ) 295s > ns.conf1$message <- ns.conf1$message[-3] 295s > ns.conf1 295s - Output ----------------------------------------------------------------------- 295s 295s 295s | Summary of files in common directory 'unitizer': 295s | 295s | Pass Fail 295s | 1. fastlm1.R 4 - 295s | 2. fastlm2.R 1 - 295s | 3. unitizer.fastlm.R 3 - 295s | ................................ 295s | 8 - 295s 295s | Do you wish to proceed despite compromised state tracking 295s | ([Y]es, [N]o)? 295s 295s unitizer> Y 295s 295s - Message ---------------------------------------------------------------------- 295s 295s | `unitizer` was unable to run with `options` state tracking enabled starting 295s | with the first test file because the following namespaces could not be 295s 295s | You may proceed normally but be aware that option state was not managed 295s | starting with the file in question, and option state will not be managed 295s | during review, or restored to original values after `unitizer` completes 295s | evaluation. You may quit `unitizer` now to avoid any changes. See `?unitiz- 295s | erState` for more details. 295s 295s | 8/8 tests passed; nothing to review. 295s 295s > 295s > unitizer:::read_line_set_vals("N") 295s > ns.conf2 <- unitizer:::capture_output( 295s + unitize_dir(FLM.TEST.DIR, state = "pristine", interactive.mode = TRUE) 295s + ) 296s > ns.conf2$message <- ns.conf2$message[-3] 296s > ns.conf2 296s - Output ----------------------------------------------------------------------- 296s 296s 296s | Summary of files in common directory 'unitizer': 296s | 296s | Pass Fail 296s | 1. fastlm1.R 4 - 296s | 2. fastlm2.R 1 - 296s | 3. unitizer.fastlm.R 3 - 296s | ................................ 296s | 8 - 296s 296s | Do you wish to proceed despite compromised state tracking 296s | ([Y]es, [N]o)? 296s 296s unitizer> N 296s 296s - Message ---------------------------------------------------------------------- 296s 296s | `unitizer` was unable to run with `options` state tracking enabled starting 296s | with the first test file because the following namespaces could not be 296s 296s | You may proceed normally but be aware that option state was not managed 296s | starting with the file in question, and option state will not be managed 296s | during review, or restored to original values after `unitizer` completes 296s | evaluation. You may quit `unitizer` now to avoid any changes. See `?unitiz- 296s | erState` for more details. 296s 296s > 296s > # Non-interactive; also testing what happens when we run a test with errors 296s > # inside a try block 296s > 296s > try(unitize_dir(FLM.TEST.DIR, state = "pristine", interactive.mode = FALSE)) 296s 296s Warning in check_call_stack() : 296s It appears you are running unitizer inside an error handling function such as 296s `withCallingHanlders`, `tryCatch`, or `withRestarts`. This is strongly dis- 296s couraged as it may cause unpredictable behavior from unitizer in the event tests 296s produce conditions / errors. We strongly recommend you re-run your tests 296s outside of such handling functions. 296s 296s 296s 296s 296s 296s 296s | Unexpectedly exited evaluation attempt when executing test expression: 296s | > fastlm(1:100, 1:10) 296s | Make sure you are not calling `unitize` inside a `tryCatch`/`try` block, 296s | invoking a restart defined outside `unitize`, evaluating an expression that 296s | calls `quit()`/`q()`, or quitting from a `browser()`/`debug()`/`trace()`. If 296s | none of these apply yet you are seeing this message please contact package 296s | maintainer. 296s 296s Error in fastlm(1:100, 1:10) : 296s Arguments `x` and `y` must be the same length. 296s > ns.conf3 <- unitizer:::capture_output( 296s + try( 296s + unitize( 296s + file.path(FLM.TEST.DIR, "fastlm2.R"), state = "pristine", 296s + interactive.mode = FALSE 296s + ) ) ) 296s > ns.conf3$message <- ns.conf3$message[-grep('unloaded', ns.conf3$message)] 296s > ns.conf3 296s - Output ----------------------------------------------------------------------- 296s 296s 296s - Message ---------------------------------------------------------------------- 296s 296s Warning in check_call_stack() : 296s It appears you are running unitizer inside an error handling function such as 296s `withCallingHanlders`, `tryCatch`, or `withRestarts`. This is strongly dis- 296s couraged as it may cause unpredictable behavior from unitizer in the event tests 296s produce conditions / errors. We strongly recommend you re-run your tests 296s outside of such handling functions. 296s Warning in history_capt(history, interactive.mode) : 296s Unable to capture history in non-interactive mode. 296s | `unitizer` was unable to run with `options` state tracking enabled starting 296s | with the first test file because the following namespaces could not be 296s 296s Error in unitize_browse(unitizers = unitizers[valid], mode = mode, interactive.mode = interactive.mode, : 296s Unable to proceed in non-interactive mode; set options state tracking to a value 296s less than or equal to search path state tracking or see vignette for other 296s workarounds. 296s > 296s > # - "Removing Tests" ----------------------------------------------------------- 296s > 296s > # Removing tests; del2 has the same tests as del1, but with some removed 296s > extra.dir <- file.path(FLM.TEST.DIR, "..", "extra") 296s > unitize(file.path(extra.dir, "del1.R"), auto.accept = "new", interactive.mode = FALSE) 296s 296s Warning in history_capt(history, interactive.mode) : 296s Unable to capture history in non-interactive mode. 296s +------------------------------------------------------------------------------+ 296s | unitizer for: extra/del1.R | 296s +------------------------------------------------------------------------------+ 296s 296s Pass Fail New 296s basic tests - - 3 296s more tests - - 3 296s ............................ 296s - - 6 296s 296s | Auto-accepting changes... 296s | unitizer updated. 296s 296s > unitizer:::read_line_set_vals(c("Y", "YY", "Y", "Y")) 296s > unitize( 296s + file.path(extra.dir, "del2.R"), 296s + store.id = file.path(extra.dir, "del1.unitizer"), 296s + interactive.mode = TRUE 296s + ) 296s 296s +------------------------------------------------------------------------------+ 296s | unitizer for: extra/del2.R | 296s +------------------------------------------------------------------------------+ 296s 296s Pass Fail Del 296s basic tests 2 - 1 296s - - 3 296s ............................ 296s 2 - 4 296s 296s = basic tests ================================================================== 296s 296s - Removed ---------------------------------------------------------------------- 296s 296s | The following test exists in the unitizer store but not in the new test 296s | script. Remove test from store ([Y]es, [N]o, [P]rev, [B]rowse, [R]erun, 296s | [Q]uit, [H]elp)? 296s 296s > "hello" 296s [1] "hello" 296s 296s unitizer> Y 296s 296s = Other Removed Items ========================================================== 296s 296s - Removed ---------------------------------------------------------------------- 296s 296s | The 3 tests in this section exist in the unitizer store but not in the new 296s | test script. Remove tests from store ([Y]es, [N]o, [P]rev, [B]rowse, [R]erun, 296s | [Q]uit, [H]elp)? 296s 296s > 3 296s [1] 3 296s 296s unitizer> YY 296s 296s 1. 3 . . . . Removed:- 296s 2. 645 . . . . Removed:- 296s 3. 9/0 . . . . Removed:- 296s 296s Choose 'Y' for the 3 tests shown above ([Y]es, [N]o)? 296s unitizer> Y 296s 296s = Finalize Unitizer ============================================================ 296s 296s | You will IRREVERSIBLY modify 'extra/del1.unitizer' by: 296s | - Removing 4 out of 4 removed tests 296s 296s | Update unitizer ([Y]es, [N]o, [P]rev, [B]rowse, [R]erun)? 296s 296s unitizer> Y 296s 296s | unitizer updated. 296s 296s > # - "navigate" ----------------------------------------------------------------- 296s > 296s > # Update `fastlm` to cause unitizers to fail, and go through the errors 296s > update_fastlm(FLM, version = "0.1.1") 296s > inst_pak(FLM) 297s > # Try navigating through the unitizer 297s > unitizer:::read_line_set_vals(c("P", "B", "3", "N", "U", "N", 297s + "N", "B", "U", "Q")) 297s > untz7a <- unitize(FLM.TEST.FILE, interactive.mode = TRUE) 297s 297s +------------------------------------------------------------------------------+ 297s | unitizer for: unitizer/fastlm1.R | 297s +------------------------------------------------------------------------------+ 297s 297s Pass Fail 297s 2 2 297s ...................... 297s 2 2 297s 297s - Failed ----------------------------------------------------------------------- 297s 297s | The 2 tests in this section failed because the new evaluations do not match 297s | the reference values from the store. Overwrite with new results ([Y]es, [N]o, 297s | [P]rev, [B]rowse, [R]erun, [Q]uit, [H]elp)? 297s 297s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 297s > dat <- data.frame(x = 1:100, y = (1:100)^2) 297s > res <- fastlm(dat$x, dat$y) 297s 297s # Our fast computations do not produce the same results as our 297s # original tests so they fail. If you need more detail than the 297s # provided diff you may use `.new`/`.NEW` or `.ref`/`.REF`. 297s # 297s # You should reject these tests by typing 'N' at the prompt since 297s # they are incorrect. 297s 297s > res 297s intercept slope rsq 297s -3.54e+13 7.01e+11 9.39e-01 297s attr(,"class") 297s [1] "fastlm" 297s 298s | Value mismatch: 298s 298s < .ref > .new 298s @@ 1,4 @@ @@ 1,4 @@ 298s intercept slope rsq intercept slope rsq 298s < -1717.000 101.000 0.939 > -3.54e+13 7.01e+11 9.39e-01 298s attr(,"class") attr(,"class") 298s [1] "fastlm" [1] "fastlm" 298s 298s | State mismatch; see `.DIFF$state` for details. 298s 298s unitizer> P 298s 298s | At first reviewable item; nothing to step back to 298s 298s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 298s > dat <- data.frame(x = 1:100, y = (1:100)^2) 298s > res <- fastlm(dat$x, dat$y) 298s 298s # Our fast computations do not produce the same results as our 298s # original tests so they fail. If you need more detail than the 298s # provided diff you may use `.new`/`.NEW` or `.ref`/`.REF`. 298s # 298s # You should reject these tests by typing 'N' at the prompt since 298s # they are incorrect. 298s 298s > res 298s intercept slope rsq 298s -3.54e+13 7.01e+11 9.39e-01 298s attr(,"class") 298s [1] "fastlm" 298s 298s | Value mismatch: 298s 298s < .ref > .new 298s @@ 1,4 @@ @@ 1,4 @@ 298s intercept slope rsq intercept slope rsq 298s < -1717.000 101.000 0.939 > -3.54e+13 7.01e+11 9.39e-01 298s attr(,"class") attr(,"class") 298s [1] "fastlm" [1] "fastlm" 298s 298s | State mismatch; see `.DIFF$state` for details. 298s 298s unitizer> B 298s 298s *1. library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) . -:- 298s *2. dat <- data.frame(x = 1:100, y = (1:100)^2) . . . . . . -:- 298s *3. res <- fastlm(dat$x, dat$y) . . . . . . . . . . . . -:- 298s 4. res . . . . . . . . . . . . . . . . . . . . Failed:- 298s 5. get_slope(res) . . . . . . . . . . . . . . . . Failed:- 298s 6. get_rsq(res) . . . . . . . . . . . . . . . . . Passed:- 298s 7. fastlm(1:100, 1:10) . . . . . . . . . . . . . . Passed:- 298s 298s | What test do you wish to review (input a test number, [U]nreviewed)? 298s 298s unitizer> 3 298s 298s | You selected a test that is not normally reviewed in this mode; 298s | as such, upon test completion, you will be brought back to this menu 298s | instead of being taken to the next reviewable test. 298s 298s - Failed ----------------------------------------------------------------------- 298s 298s | The 2 tests in this section failed because the new evaluations do not match 298s | the reference values from the store. Overwrite with new results ([Y]es, [N]o, 298s | [P]rev, [B]rowse, [R]erun, [Q]uit, [H]elp)? 298s 298s > res <- fastlm(dat$x, dat$y) 298s unitizer> N 298s 298s *1. library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) . -:- 298s *2. dat <- data.frame(x = 1:100, y = (1:100)^2) . . . . . . -:- 298s *3. res <- fastlm(dat$x, dat$y) . . . . . . . . . . . . -:N 298s 4. res . . . . . . . . . . . . . . . . . . . . Failed:- 298s 5. get_slope(res) . . . . . . . . . . . . . . . . Failed:- 298s 6. get_rsq(res) . . . . . . . . . . . . . . . . . Passed:- 298s 7. fastlm(1:100, 1:10) . . . . . . . . . . . . . . Passed:- 298s 298s | What test do you wish to review (input a test number, [U]nreviewed)? 298s 298s unitizer> U 298s 298s - Failed ----------------------------------------------------------------------- 298s 298s | The 2 tests in this section failed because the new evaluations do not match 298s | the reference values from the store. Overwrite with new results ([Y]es, [N]o, 298s | [P]rev, [B]rowse, [R]erun, [Q]uit, [H]elp)? 298s 298s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 298s > dat <- data.frame(x = 1:100, y = (1:100)^2) 298s > res <- fastlm(dat$x, dat$y) 298s 298s # Our fast computations do not produce the same results as our 298s # original tests so they fail. If you need more detail than the 298s # provided diff you may use `.new`/`.NEW` or `.ref`/`.REF`. 298s # 298s # You should reject these tests by typing 'N' at the prompt since 298s # they are incorrect. 298s 298s > res 298s intercept slope rsq 298s -3.54e+13 7.01e+11 9.39e-01 298s attr(,"class") 298s [1] "fastlm" 298s 298s | Value mismatch: 298s 298s < .ref > .new 298s @@ 1,4 @@ @@ 1,4 @@ 298s intercept slope rsq intercept slope rsq 298s < -1717.000 101.000 0.939 > -3.54e+13 7.01e+11 9.39e-01 298s attr(,"class") attr(,"class") 298s [1] "fastlm" [1] "fastlm" 298s 298s | State mismatch; see `.DIFF$state` for details. 298s 298s unitizer> N 298s 298s # This one is also incorrect; reject with 'N' 298s 298s > get_slope(res) 298s [1] 7.01e+11 298s 298s | Value mismatch: 298s 298s < .ref > .new 298s @@ 1 @@ @@ 1 @@ 298s < [1] 101 > [1] 7.01e+11 298s 298s | State mismatch; see `.DIFF$state` for details. 298s 298s unitizer> N 298s 298s = Finalize Unitizer ============================================================ 298s 298s | You made no changes to the unitizer so there is no need to update it. While 298s | unnecessary, you can force an update by typing O at the prompt. 298s 298s | Exit unitizer ([Y]es, [P]rev, [B]rowse, [R]erun, f[O]rce)? 298s 298s unitizer> B 298s 298s *1. library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) . -:- 298s *2. dat <- data.frame(x = 1:100, y = (1:100)^2) . . . . . . -:- 298s *3. res <- fastlm(dat$x, dat$y) . . . . . . . . . . . . -:N 298s 4. res . . . . . . . . . . . . . . . . . . . . Failed:N 298s 5. get_slope(res) . . . . . . . . . . . . . . . . Failed:N 298s 6. get_rsq(res) . . . . . . . . . . . . . . . . . Passed:- 298s 7. fastlm(1:100, 1:10) . . . . . . . . . . . . . . Passed:- 298s 298s | What test do you wish to review (input a test number, [U]nreviewed)? 298s 298s unitizer> U 298s 298s | No unreviewed tests. 298s 298s = Finalize Unitizer ============================================================ 298s 298s | You made no changes to the unitizer so there is no need to update it. While 298s | unnecessary, you can force an update by typing O at the prompt. 298s 298s | Exit unitizer ([Y]es, [P]rev, [B]rowse, [R]erun, f[O]rce)? 298s 298s unitizer> Q 298s 298s | Changes discarded. 298s | unitizer unchanged. 298s 298s > attr(untz7a, "test.file") <- basename(attr(untz7a, "test.file")) 298s > attr(untz7a, "store.id") <- basename(attr(untz7a, "store.id")) 298s > path <- attr(untz7a, "test.file") 298s > path 298s [1] "fastlm1.R" 298s > (path.norm <- unitizer:::normalize_path(path, mustWork=FALSE, exists=TRUE)) 298s [1] "fastlm1.R" 298s > (rel.path <- unitizer:::relativize_path(path.norm, wd=NULL, only.if.shorter=TRUE, exists=TRUE)) 298s [1] "fastlm1.R" 298s > (pkg.dir <- unitizer:::get_package_dir(path.norm, exists=TRUE)) 298s [1] "." 298s > untz7a 298s Test File: fastlm1.R 298s Store ID: fastlm1.unitizer 298s 298s id call ignored status user reviewed 298s 1 1 library(utzflm, lib.loc = g... * Failed N FALSE 298s 2 2 dat <- data.frame(x = 1:100... * Failed N FALSE 298s 3 3 res <- fastlm(dat$x, dat$y) * Failed N TRUE 298s 4 4 res Failed N TRUE 298s 5 5 get_slope(res) Failed N TRUE 298s 6 6 get_rsq(res) Passed Y FALSE 298s 7 7 fastlm(1:100, 1:10) Passed Y FALSE 298s 298s You chose NOT to save these changes to the unitizer store 298s > 298s > # - "review dir" --------------------------------------------------------------- 298s > 298s > # list help, review first item, but do nothing 298s > unitizer:::read_line_set_vals(c("H", "1", "Q", "Q")) 298s > unitize_dir(FLM.TEST.DIR, interactive.mode = TRUE) 298s 299s | Summary of files in common directory 'unitizer': 299s | 299s | Pass Fail 299s | *1. fastlm1.R 2 2 299s | 2. fastlm2.R 1 - 299s | *3. unitizer.fastlm.R 1 2 299s | ................................ 299s | 4 4 299s | Legend: 299s | * `unitizer` requires review 299s 299s | Type number of unitizer to review, 'A' to review all that require review 299s 299s unitizer> H 299s 299s | Available options: 299s | - 1:3: unitizer number to review 299s | - A: Review all `unitzers` that require review (*) 299s | - AA: Review all tests 299s | - RR: Re-run all tests 299s | - Q: quit 299s | 299s | Pick a unitizer or an option ([A]ll, [Q]uit, [H]elp)? 299s 299s unitizer> 1 299s +------------------------------------------------------------------------------+ 299s | unitizer for: unitizer/fastlm1.R | 299s +------------------------------------------------------------------------------+ 299s 299s Pass Fail 299s 2 2 299s ...................... 299s 2 2 299s 299s - Failed ----------------------------------------------------------------------- 299s 299s | The 2 tests in this section failed because the new evaluations do not match 299s | the reference values from the store. Overwrite with new results ([Y]es, [N]o, 299s | [P]rev, [B]rowse, [R]erun, [Q]uit, [H]elp)? 299s 299s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 299s > dat <- data.frame(x = 1:100, y = (1:100)^2) 299s > res <- fastlm(dat$x, dat$y) 299s 299s # Our fast computations do not produce the same results as our 299s # original tests so they fail. If you need more detail than the 299s # provided diff you may use `.new`/`.NEW` or `.ref`/`.REF`. 299s # 299s # You should reject these tests by typing 'N' at the prompt since 299s # they are incorrect. 299s 299s > res 299s intercept slope rsq 299s -3.54e+13 7.01e+11 9.39e-01 299s attr(,"class") 299s [1] "fastlm" 299s 299s | Value mismatch: 299s 299s < .ref > .new 299s @@ 1,4 @@ @@ 1,4 @@ 299s intercept slope rsq intercept slope rsq 299s < -1717.000 101.000 0.939 > -3.54e+13 7.01e+11 9.39e-01 299s attr(,"class") attr(,"class") 299s [1] "fastlm" [1] "fastlm" 299s 299s | State mismatch; see `.DIFF$state` for details. 299s 299s unitizer> Q 299s 299s | No changes recorded. 299s | unitizer unchanged. 299s 299s | Summary of files in common directory 'unitizer': 299s | 299s | Pass Fail 299s | *1. fastlm1.R 2 2 299s | 2. fastlm2.R 1 - 299s | *3. unitizer.fastlm.R 1 2 299s | ................................ 299s | 4 4 299s | Legend: 299s | * `unitizer` requires review 299s 299s | Type number of unitizer to review, 'A' to review all that require review 299s 299s unitizer> Q 299s 299s > # incorrect selection 299s > unitizer:::read_line_set_vals(c("H", "4", "1", "Q", "Q")) 299s > unitize_dir(FLM.TEST.DIR, interactive.mode = TRUE) 299s 299s | Summary of files in common directory 'unitizer': 299s | 299s | Pass Fail 299s | *1. fastlm1.R 2 2 299s | 2. fastlm2.R 1 - 299s | *3. unitizer.fastlm.R 1 2 299s | ................................ 299s | 4 4 299s | Legend: 299s | * `unitizer` requires review 299s 299s | Type number of unitizer to review, 'A' to review all that require review 299s 299s unitizer> H 299s 299s | Available options: 299s | - 1:3: unitizer number to review 299s | - A: Review all `unitzers` that require review (*) 299s | - AA: Review all tests 299s | - RR: Re-run all tests 299s | - Q: quit 299s | 299s | Pick a unitizer or an option ([A]ll, [Q]uit, [H]elp)? 299s 299s unitizer> 4 299s | Type a number in `1:3` at the prompt 299s [1] 4 299s unitizer> 1 299s +------------------------------------------------------------------------------+ 299s | unitizer for: unitizer/fastlm1.R | 299s +------------------------------------------------------------------------------+ 299s 299s Pass Fail 299s 2 2 299s ...................... 299s 2 2 299s 299s - Failed ----------------------------------------------------------------------- 299s 299s | The 2 tests in this section failed because the new evaluations do not match 299s | the reference values from the store. Overwrite with new results ([Y]es, [N]o, 299s | [P]rev, [B]rowse, [R]erun, [Q]uit, [H]elp)? 299s 299s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 299s > dat <- data.frame(x = 1:100, y = (1:100)^2) 299s > res <- fastlm(dat$x, dat$y) 299s 299s # Our fast computations do not produce the same results as our 299s # original tests so they fail. If you need more detail than the 299s # provided diff you may use `.new`/`.NEW` or `.ref`/`.REF`. 299s # 299s # You should reject these tests by typing 'N' at the prompt since 299s # they are incorrect. 299s 299s > res 299s intercept slope rsq 299s -3.54e+13 7.01e+11 9.39e-01 299s attr(,"class") 299s [1] "fastlm" 299s 299s | Value mismatch: 299s 299s < .ref > .new 299s @@ 1,4 @@ @@ 1,4 @@ 299s intercept slope rsq intercept slope rsq 299s < -1717.000 101.000 0.939 > -3.54e+13 7.01e+11 9.39e-01 299s attr(,"class") attr(,"class") 299s [1] "fastlm" [1] "fastlm" 299s 299s | State mismatch; see `.DIFF$state` for details. 299s 299s unitizer> Q 299s 299s | No changes recorded. 299s | unitizer unchanged. 299s 299s | Summary of files in common directory 'unitizer': 299s | 299s | Pass Fail 299s | *1. fastlm1.R 2 2 299s | 2. fastlm2.R 1 - 299s | *3. unitizer.fastlm.R 1 2 299s | ................................ 299s | 4 4 299s | Legend: 299s | * `unitizer` requires review 299s 299s | Type number of unitizer to review, 'A' to review all that require review 299s 299s unitizer> Q 299s 299s > # simulate slow unitizer review 299s > old.opt <- options(unitizer.prompt.b4.quit.time = 0) 299s > unitizer:::read_line_set_vals(c("H", "1", "Q", "Q", "Q", "Y")) 299s > unitize_dir(FLM.TEST.DIR, interactive.mode = TRUE) 299s 300s | Summary of files in common directory 'unitizer': 300s | 300s | Pass Fail 300s | *1. fastlm1.R 2 2 300s | 2. fastlm2.R 1 - 300s | *3. unitizer.fastlm.R 1 2 300s | ................................ 300s | 4 4 300s | Legend: 300s | * `unitizer` requires review 300s 300s | Type number of unitizer to review, 'A' to review all that require review 300s 300s unitizer> H 300s 300s | Available options: 300s | - 1:3: unitizer number to review 300s | - A: Review all `unitzers` that require review (*) 300s | - AA: Review all tests 300s | - RR: Re-run all tests 300s | - Q: quit 300s | 300s | Pick a unitizer or an option ([A]ll, [Q]uit, [H]elp)? 300s 300s unitizer> 1 300s +------------------------------------------------------------------------------+ 300s | unitizer for: unitizer/fastlm1.R | 300s +------------------------------------------------------------------------------+ 300s 300s Pass Fail 300s 2 2 300s ...................... 300s 2 2 300s 300s - Failed ----------------------------------------------------------------------- 300s 300s | The 2 tests in this section failed because the new evaluations do not match 300s | the reference values from the store. Overwrite with new results ([Y]es, [N]o, 300s | [P]rev, [B]rowse, [R]erun, [Q]uit, [H]elp)? 300s 300s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 300s > dat <- data.frame(x = 1:100, y = (1:100)^2) 300s > res <- fastlm(dat$x, dat$y) 300s 300s # Our fast computations do not produce the same results as our 300s # original tests so they fail. If you need more detail than the 300s # provided diff you may use `.new`/`.NEW` or `.ref`/`.REF`. 300s # 300s # You should reject these tests by typing 'N' at the prompt since 300s # they are incorrect. 300s 300s > res 300s intercept slope rsq 300s -3.54e+13 7.01e+11 9.39e-01 300s attr(,"class") 300s [1] "fastlm" 300s 300s | Value mismatch: 300s 300s < .ref > .new 300s @@ 1,4 @@ @@ 1,4 @@ 300s intercept slope rsq intercept slope rsq 300s < -1717.000 101.000 0.939 > -3.54e+13 7.01e+11 9.39e-01 300s attr(,"class") attr(,"class") 300s [1] "fastlm" [1] "fastlm" 300s 300s | State mismatch; see `.DIFF$state` for details. 300s 300s unitizer> Q 300s 300s = Finalize Unitizer ============================================================ 300s 300s | You have 2 unreviewed tests; press `B` to browse tests, `U` to go to first 300s | unreviewed test. 300s 300s | You made no changes to the unitizer so there is no need to update it. While 300s | unnecessary, you can force an update by typing O at the prompt. 300s 300s | Exit unitizer ([Y]es, [P]rev, [B]rowse, [U]nreviewed, [R]erun, f[O]rce)? 300s 300s unitizer> Q 300s 300s | Changes discarded. 300s | unitizer unchanged. 300s 300s | Summary of files in common directory 'unitizer': 300s | 300s | Pass Fail 300s | *1. fastlm1.R 2 2 300s | 2. fastlm2.R 1 - 300s | *3. unitizer.fastlm.R 1 2 300s | ................................ 300s | 4 4 300s | Legend: 300s | * `unitizer` requires review 300s 300s | Type number of unitizer to review, 'A' to review all that require review 300s 300s unitizer> Q 300s 300s | Are you sure you want to quit? 300s 300s unitizer> Y 300s 300s > options(old.opt) 300s > # Failures in non-interactive mode (note, can't run on the actual "fastlm.R" 300s > # file b/c we need to do this under a `try`): 300s > try( 300s + unitize_dir(FLM.TEST.DIR, pattern = "unitize|fastlm2", interactive.mode = FALSE) 300s + ) 300s 300s Warning in check_call_stack() : 300s It appears you are running unitizer inside an error handling function such as 300s `withCallingHanlders`, `tryCatch`, or `withRestarts`. This is strongly dis- 300s couraged as it may cause unpredictable behavior from unitizer in the event tests 300s produce conditions / errors. We strongly recommend you re-run your tests 300s outside of such handling functions. 300s Warning in history_capt(history, interactive.mode) : 300s Unable to capture history in non-interactive mode. 300s | Summary of files in common directory 'unitizer': 300s | 300s | Pass Fail 300s | 1. fastlm2.R 1 - 300s | *2. unitizer.fastlm.R 1 2 300s | ................................ 300s | 2 2 300s | Legend: 300s | * `unitizer` requires review 300s 300s +------------------------------------------------------------------------------+ 300s | unitizer for: unitizer/unitizer.fastlm.R | 300s +------------------------------------------------------------------------------+ 300s 300s Pass Fail 300s 1 2 300s ...................... 300s 1 2 300s 300s - Failed ----------------------------------------------------------------------- 300s 300s | The 2 tests in this section failed because the new evaluations do not match 300s | the reference values from the store. Overwrite with new results ([Y]es, [N]o, 300s | [P]rev, [B]rowse, [R]erun, [Q]uit, [H]elp)? 300s 300s # Extra test file for internal tests; not for DEMO 300s 300s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 300s > x <- 1:10 300s > y <- x^3 300s > res <- fastlm(x, y) 300s > get_slope(res) 300s [1] 717379 300s 300s | Value mismatch: 300s 300s < .ref > .new 300s @@ 1 @@ @@ 1 @@ 300s < [1] 105 > [1] 717379 300s 300s | State mismatch; see `.DIFF$state` for details. 300s 300s > get_intercept(res) 300s [1] -3945281 300s 300s | Value mismatch: 300s 300s < .ref > .new 300s @@ 1 @@ @@ 1 @@ 300s < [1] -277 > [1] -3945281 300s 300s | State mismatch; see `.DIFF$state` for details. 300s 300s | User input required to proceed, but we are in non-interactive mode. 300s 300s | unitizer unchanged. 300s 300s | * Fail: get_slope(res) 300s | * Fail: get_intercept(res) 300s | in 'unitizer/unitizer.fastlm.R' 300s 300s | Newly evaluated tests do not match unitizer (Pass: 2, Fail: 2); see above for 300s | more info, or run in interactive mode. 300s 300s Error in unitize_core(test.files = test.files, store.ids = store.ids, : 300s Cannot proceed in non-interactive mode. 300s > # review all that need review, but don't do anything 300s > unitizer:::read_line_set_vals(c("A", "Q", "Q", "Q")) 300s > unitize_dir(FLM.TEST.DIR, interactive.mode = TRUE) 300s 301s | Summary of files in common directory 'unitizer': 301s | 301s | Pass Fail 301s | *1. fastlm1.R 2 2 301s | 2. fastlm2.R 1 - 301s | *3. unitizer.fastlm.R 1 2 301s | ................................ 301s | 4 4 301s | Legend: 301s | * `unitizer` requires review 301s 301s | Type number of unitizer to review, 'A' to review all that require review 301s 301s unitizer> A 301s 301s +------------------------------------------------------------------------------+ 301s | unitizer for: unitizer/fastlm1.R | 301s +------------------------------------------------------------------------------+ 301s 301s Pass Fail 301s 2 2 301s ...................... 301s 2 2 301s 301s - Failed ----------------------------------------------------------------------- 301s 301s | The 2 tests in this section failed because the new evaluations do not match 301s | the reference values from the store. Overwrite with new results ([Y]es, [N]o, 301s | [P]rev, [B]rowse, [R]erun, [QQ]uit All, [Q]uit, [H]elp)? 301s 301s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 301s > dat <- data.frame(x = 1:100, y = (1:100)^2) 301s > res <- fastlm(dat$x, dat$y) 301s 301s # Our fast computations do not produce the same results as our 301s # original tests so they fail. If you need more detail than the 301s # provided diff you may use `.new`/`.NEW` or `.ref`/`.REF`. 301s # 301s # You should reject these tests by typing 'N' at the prompt since 301s # they are incorrect. 301s 301s > res 301s intercept slope rsq 301s -3.54e+13 7.01e+11 9.39e-01 301s attr(,"class") 301s [1] "fastlm" 301s 301s | Value mismatch: 301s 301s < .ref > .new 301s @@ 1,4 @@ @@ 1,4 @@ 301s intercept slope rsq intercept slope rsq 301s < -1717.000 101.000 0.939 > -3.54e+13 7.01e+11 9.39e-01 301s attr(,"class") attr(,"class") 301s [1] "fastlm" [1] "fastlm" 301s 301s | State mismatch; see `.DIFF$state` for details. 301s 301s unitizer> Q 301s 301s | No changes recorded. 301s | unitizer unchanged. 301s 301s +------------------------------------------------------------------------------+ 301s | unitizer for: unitizer/unitizer.fastlm.R | 301s +------------------------------------------------------------------------------+ 301s 301s Pass Fail 301s 1 2 301s ...................... 301s 1 2 301s 301s - Failed ----------------------------------------------------------------------- 301s 301s | The 2 tests in this section failed because the new evaluations do not match 301s | the reference values from the store. Overwrite with new results ([Y]es, [N]o, 301s | [P]rev, [B]rowse, [R]erun, [QQ]uit All, [Q]uit, [H]elp)? 301s 301s # Extra test file for internal tests; not for DEMO 301s 301s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 301s > x <- 1:10 301s > y <- x^3 301s > res <- fastlm(x, y) 301s > get_slope(res) 301s [1] 717379 301s 301s | Value mismatch: 301s 301s < .ref > .new 301s @@ 1 @@ @@ 1 @@ 301s < [1] 105 > [1] 717379 301s 301s | State mismatch; see `.DIFF$state` for details. 301s 301s unitizer> Q 301s 301s | No changes recorded. 301s | unitizer unchanged. 301s 301s | Summary of files in common directory 'unitizer': 301s | 301s | Pass Fail 301s | *1. fastlm1.R 2 2 301s | 2. fastlm2.R 1 - 301s | *3. unitizer.fastlm.R 1 2 301s | ................................ 301s | 4 4 301s | Legend: 301s | * `unitizer` requires review 301s 301s | Type number of unitizer to review, 'A' to review all that require review 301s 301s unitizer> Q 301s 301s > # review all, but don't do anything 301s > unitizer:::read_line_set_vals(c("AA", "Q", "Q", "Q", "Q")) 301s > unitize_dir(FLM.TEST.DIR, interactive.mode = TRUE) 301s 301s | Summary of files in common directory 'unitizer': 301s | 301s | Pass Fail 301s | *1. fastlm1.R 2 2 301s | 2. fastlm2.R 1 - 301s | *3. unitizer.fastlm.R 1 2 301s | ................................ 301s | 4 4 301s | Legend: 301s | * `unitizer` requires review 301s 301s | Type number of unitizer to review, 'A' to review all that require review 301s 301s unitizer> AA 301s 301s +------------------------------------------------------------------------------+ 301s | unitizer for: unitizer/fastlm1.R | 301s +------------------------------------------------------------------------------+ 301s 301s Pass Fail 301s 2 2 301s ...................... 301s 2 2 301s 301s - Failed ----------------------------------------------------------------------- 301s 301s | The 2 tests in this section failed because the new evaluations do not match 301s | the reference values from the store. Overwrite with new results ([Y]es, [N]o, 301s | [P]rev, [B]rowse, [R]erun, [QQ]uit All, [Q]uit, [H]elp)? 301s 301s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 301s > dat <- data.frame(x = 1:100, y = (1:100)^2) 301s > res <- fastlm(dat$x, dat$y) 301s 301s # Our fast computations do not produce the same results as our 301s # original tests so they fail. If you need more detail than the 301s # provided diff you may use `.new`/`.NEW` or `.ref`/`.REF`. 301s # 301s # You should reject these tests by typing 'N' at the prompt since 301s # they are incorrect. 301s 301s > res 301s intercept slope rsq 301s -3.54e+13 7.01e+11 9.39e-01 301s attr(,"class") 301s [1] "fastlm" 301s 301s | Value mismatch: 301s 301s < .ref > .new 301s @@ 1,4 @@ @@ 1,4 @@ 301s intercept slope rsq intercept slope rsq 301s < -1717.000 101.000 0.939 > -3.54e+13 7.01e+11 9.39e-01 301s attr(,"class") attr(,"class") 301s [1] "fastlm" [1] "fastlm" 301s 301s | State mismatch; see `.DIFF$state` for details. 301s 301s unitizer> Q 301s 301s | No changes recorded. 301s | unitizer unchanged. 301s 301s +------------------------------------------------------------------------------+ 301s | unitizer for: unitizer/fastlm2.R | 301s +------------------------------------------------------------------------------+ 301s 301s Pass Fail 301s 1 - 301s ...................... 301s 1 - 301s 301s *1. x <- 1:10 . . . . . . . . . . . . . . . . . . . -:- 301s *2. y <- 1:10^3 . . . . . . . . . . . . . . . . . . -:- 301s *3. res <- summary(lm(y ~ x, data.frame(x = x, y = y))) . . . . . -:- 301s *4. intercept <- res$coefficients[1, 1] . . . . . . . . . . -:- 301s *5. slope <- res$coefficients[2, 1] . . . . . . . . . . . -:- 301s *6. rsq <- res$r.squared . . . . . . . . . . . . . . . -:- 301s 7. structure(c(intercept = intercept, slope = slope, rsq = rsq),... Passed:- 301s 301s | What test do you wish to review (input a test number, [U]nreviewed)? 301s 301s unitizer> Q 301s 301s | No changes recorded. 301s | unitizer unchanged. 301s 301s +------------------------------------------------------------------------------+ 301s | unitizer for: unitizer/unitizer.fastlm.R | 301s +------------------------------------------------------------------------------+ 301s 301s Pass Fail 301s 1 2 301s ...................... 301s 1 2 301s 301s - Failed ----------------------------------------------------------------------- 301s 301s | The 2 tests in this section failed because the new evaluations do not match 301s | the reference values from the store. Overwrite with new results ([Y]es, [N]o, 301s | [P]rev, [B]rowse, [R]erun, [QQ]uit All, [Q]uit, [H]elp)? 301s 301s # Extra test file for internal tests; not for DEMO 301s 301s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 301s > x <- 1:10 301s > y <- x^3 301s > res <- fastlm(x, y) 301s > get_slope(res) 301s [1] 717379 301s 301s | Value mismatch: 301s 301s < .ref > .new 301s @@ 1 @@ @@ 1 @@ 301s < [1] 105 > [1] 717379 301s 301s | State mismatch; see `.DIFF$state` for details. 301s 301s unitizer> Q 301s 301s | No changes recorded. 301s | unitizer unchanged. 301s 301s | Summary of files in common directory 'unitizer': 301s | 301s | Pass Fail 301s | *1. fastlm1.R 2 2 301s | 2. fastlm2.R 1 - 301s | *3. unitizer.fastlm.R 1 2 301s | ................................ 301s | 4 4 301s | Legend: 301s | * `unitizer` requires review 301s 301s | Type number of unitizer to review, 'A' to review all that require review 301s 301s unitizer> Q 301s 301s > # review one, and Re-eval despite no change 301s > unitizer:::read_line_set_vals(c("1", "R", "Y", "Q", "Q")) 301s > unitize_dir(FLM.TEST.DIR, interactive.mode = TRUE) 301s 302s | Summary of files in common directory 'unitizer': 302s | 302s | Pass Fail 302s | *1. fastlm1.R 2 2 302s | 2. fastlm2.R 1 - 302s | *3. unitizer.fastlm.R 1 2 302s | ................................ 302s | 4 4 302s | Legend: 302s | * `unitizer` requires review 302s 302s | Type number of unitizer to review, 'A' to review all that require review 302s 302s unitizer> 1 302s +------------------------------------------------------------------------------+ 302s | unitizer for: unitizer/fastlm1.R | 302s +------------------------------------------------------------------------------+ 302s 302s Pass Fail 302s 2 2 302s ...................... 302s 2 2 302s 302s - Failed ----------------------------------------------------------------------- 302s 302s | The 2 tests in this section failed because the new evaluations do not match 302s | the reference values from the store. Overwrite with new results ([Y]es, [N]o, 302s | [P]rev, [B]rowse, [R]erun, [Q]uit, [H]elp)? 302s 302s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 302s > dat <- data.frame(x = 1:100, y = (1:100)^2) 302s > res <- fastlm(dat$x, dat$y) 302s 302s # Our fast computations do not produce the same results as our 302s # original tests so they fail. If you need more detail than the 302s # provided diff you may use `.new`/`.NEW` or `.ref`/`.REF`. 302s # 302s # You should reject these tests by typing 'N' at the prompt since 302s # they are incorrect. 302s 302s > res 302s intercept slope rsq 302s -3.54e+13 7.01e+11 9.39e-01 302s attr(,"class") 302s [1] "fastlm" 302s 302s | Value mismatch: 302s 302s < .ref > .new 302s @@ 1,4 @@ @@ 1,4 @@ 302s intercept slope rsq intercept slope rsq 302s < -1717.000 101.000 0.939 > -3.54e+13 7.01e+11 9.39e-01 302s attr(,"class") attr(,"class") 302s [1] "fastlm" [1] "fastlm" 302s 302s | State mismatch; see `.DIFF$state` for details. 302s 302s unitizer> R 302s 302s | Toggling re-run mode ON for this unitizer 302s 302s = Finalize Unitizer ============================================================ 302s 302s | You have 2 unreviewed tests; press `B` to browse tests, `U` to go to first 302s | unreviewed test. 302s 302s | You made no changes to the unitizer so there is no need to update it. While 302s | unnecessary, you can force an update by typing O at the prompt. 302s 302s | Re-run unitizer ([Y]es, [P]rev, [B]rowse, [U]nreviewed, [R]erun, f[O]rce)? 302s 302s unitizer> Y 302s 302s | unitizer unchanged. 302s 302s +------------------------------------------------------------------------------+ 302s | unitizer for: unitizer/fastlm1.R | 302s +------------------------------------------------------------------------------+ 302s 302s Pass Fail 302s 2 2 302s ...................... 302s 2 2 302s 302s - Failed ----------------------------------------------------------------------- 302s 302s | The 2 tests in this section failed because the new evaluations do not match 302s | the reference values from the store. Overwrite with new results ([Y]es, [N]o, 302s | [P]rev, [B]rowse, [R]erun, [Q]uit, [H]elp)? 302s 302s | Jumping to test #4 because that was the test under review when test re-run was 302s | requested. 302s 302s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 302s > dat <- data.frame(x = 1:100, y = (1:100)^2) 302s > res <- fastlm(dat$x, dat$y) 302s 302s # Our fast computations do not produce the same results as our 302s # original tests so they fail. If you need more detail than the 302s # provided diff you may use `.new`/`.NEW` or `.ref`/`.REF`. 302s # 302s # You should reject these tests by typing 'N' at the prompt since 302s # they are incorrect. 302s 302s > res 302s intercept slope rsq 302s -3.54e+13 7.01e+11 9.39e-01 302s attr(,"class") 302s [1] "fastlm" 302s 302s | Value mismatch: 302s 302s < .ref > .new 302s @@ 1,4 @@ @@ 1,4 @@ 302s intercept slope rsq intercept slope rsq 302s < -1717.000 101.000 0.939 > -3.54e+13 7.01e+11 9.39e-01 302s attr(,"class") attr(,"class") 302s [1] "fastlm" [1] "fastlm" 302s 302s | State mismatch; see `.DIFF$state` for details. 302s 302s unitizer> Q 302s 302s | No changes recorded. 302s | unitizer unchanged. 302s 302s | Summary of files in common directory 'unitizer': 302s | 302s | Pass Fail 302s | *1. fastlm1.R 2 2 302s | 2. fastlm2.R 1 - 302s | *3. unitizer.fastlm.R 1 2 302s | ................................ 302s | 4 4 302s | Legend: 302s | * `unitizer` requires review 302s 302s | Type number of unitizer to review, 'A' to review all that require review 302s 302s unitizer> Q 302s 302s > unitizer:::read_line_set_vals(c("1", "RR", "Y", "Q", "Q")) 302s > unitize_dir(FLM.TEST.DIR, interactive.mode = TRUE) 302s 303s | Summary of files in common directory 'unitizer': 303s | 303s | Pass Fail 303s | *1. fastlm1.R 2 2 303s | 2. fastlm2.R 1 - 303s | *3. unitizer.fastlm.R 1 2 303s | ................................ 303s | 4 4 303s | Legend: 303s | * `unitizer` requires review 303s 303s | Type number of unitizer to review, 'A' to review all that require review 303s 303s unitizer> 1 303s +------------------------------------------------------------------------------+ 303s | unitizer for: unitizer/fastlm1.R | 303s +------------------------------------------------------------------------------+ 303s 303s Pass Fail 303s 2 2 303s ...................... 303s 2 2 303s 303s - Failed ----------------------------------------------------------------------- 303s 303s | The 2 tests in this section failed because the new evaluations do not match 303s | the reference values from the store. Overwrite with new results ([Y]es, [N]o, 303s | [P]rev, [B]rowse, [R]erun, [Q]uit, [H]elp)? 303s 303s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 303s > dat <- data.frame(x = 1:100, y = (1:100)^2) 303s > res <- fastlm(dat$x, dat$y) 303s 303s # Our fast computations do not produce the same results as our 303s # original tests so they fail. If you need more detail than the 303s # provided diff you may use `.new`/`.NEW` or `.ref`/`.REF`. 303s # 303s # You should reject these tests by typing 'N' at the prompt since 303s # they are incorrect. 303s 303s > res 303s intercept slope rsq 303s -3.54e+13 7.01e+11 9.39e-01 303s attr(,"class") 303s [1] "fastlm" 303s 303s | Value mismatch: 303s 303s < .ref > .new 303s @@ 1,4 @@ @@ 1,4 @@ 303s intercept slope rsq intercept slope rsq 303s < -1717.000 101.000 0.939 > -3.54e+13 7.01e+11 9.39e-01 303s attr(,"class") attr(,"class") 303s [1] "fastlm" [1] "fastlm" 303s 303s | State mismatch; see `.DIFF$state` for details. 303s 303s unitizer> RR 303s 303s | Toggling re-run mode ON for all loaded unitizers 303s 303s = Finalize Unitizer ============================================================ 303s 303s | You have 2 unreviewed tests; press `B` to browse tests, `U` to go to first 303s | unreviewed test. 303s 303s | You made no changes to the unitizer so there is no need to update it. While 303s | unnecessary, you can force an update by typing O at the prompt. 303s 303s | Re-run all loaded unitizers ([Y]es, [P]rev, [B]rowse, [U]nreviewed, [R]erun, 303s | f[O]rce)? 303s 303s unitizer> Y 303s 303s | unitizer unchanged. 303s 303s | Summary of files in common directory 'unitizer': 303s | 303s | Pass Fail 303s | *1. fastlm1.R 2 2 303s | 2. fastlm2.R 1 - 303s | *3. unitizer.fastlm.R 1 2 303s | ................................ 303s | 4 4 303s | Legend: 303s | * `unitizer` requires review 303s 303s | Type number of unitizer to review, 'A' to review all that require review 303s 303s unitizer> Q 303s 303s > # Test force eval 303s > # first run, force update and accept 303s > # second run, R from dir summary doesn't set bookmarks 303s > unitizer:::read_line_set_vals(c("1", "O", "Q", "Y", "R", "1", 303s + "Q", "Q")) 303s > unitize_dir(FLM.TEST.DIR, interactive.mode = TRUE) 303s 304s | Summary of files in common directory 'unitizer': 304s | 304s | Pass Fail 304s | *1. fastlm1.R 2 2 304s | 2. fastlm2.R 1 - 304s | *3. unitizer.fastlm.R 1 2 304s | ................................ 304s | 4 4 304s | Legend: 304s | * `unitizer` requires review 304s 304s | Type number of unitizer to review, 'A' to review all that require review 304s 304s unitizer> 1 304s +------------------------------------------------------------------------------+ 304s | unitizer for: unitizer/fastlm1.R | 304s +------------------------------------------------------------------------------+ 304s 304s Pass Fail 304s 2 2 304s ...................... 304s 2 2 304s 304s - Failed ----------------------------------------------------------------------- 304s 304s | The 2 tests in this section failed because the new evaluations do not match 304s | the reference values from the store. Overwrite with new results ([Y]es, [N]o, 304s | [P]rev, [B]rowse, [R]erun, [Q]uit, [H]elp)? 304s 304s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 304s > dat <- data.frame(x = 1:100, y = (1:100)^2) 304s > res <- fastlm(dat$x, dat$y) 304s 304s # Our fast computations do not produce the same results as our 304s # original tests so they fail. If you need more detail than the 304s # provided diff you may use `.new`/`.NEW` or `.ref`/`.REF`. 304s # 304s # You should reject these tests by typing 'N' at the prompt since 304s # they are incorrect. 304s 304s > res 304s intercept slope rsq 304s -3.54e+13 7.01e+11 9.39e-01 304s attr(,"class") 304s [1] "fastlm" 304s 304s | Value mismatch: 304s 304s < .ref > .new 304s @@ 1,4 @@ @@ 1,4 @@ 304s intercept slope rsq intercept slope rsq 304s < -1717.000 101.000 0.939 > -3.54e+13 7.01e+11 9.39e-01 304s attr(,"class") attr(,"class") 304s [1] "fastlm" [1] "fastlm" 304s 304s | State mismatch; see `.DIFF$state` for details. 304s 304s unitizer> O 304s 304s | Toggling force update mode ON 304s 304s unitizer> Q 304s 304s = Finalize Unitizer ============================================================ 304s 304s | You have 2 unreviewed tests; press `B` to browse tests, `U` to go to first 304s | unreviewed test. 304s 304s | Running in `force.update` mode so `unitizer` will be re-saved even though 304s | there are no changes to record (see `?unitize` for details). 304s 304s | You are about to update 'unitizer/fastlm1.unitizer' with re-evaluated but 304s | otherwise unchanged tests. 304s 304s | Update unitizer ([Y]es, [N]o, [P]rev, [B]rowse, [U]nreviewed, [R]erun, 304s | f[O]rce)? 304s 304s unitizer> Y 304s 304s | unitizer updated. 304s 304s | Summary of files in common directory 'unitizer': 304s | 304s | Pass Fail 304s | $1. fastlm1.R ? ? 304s | 2. fastlm2.R 1 - 304s | *3. unitizer.fastlm.R 1 2 304s | ................................ 304s | ? ? 304s | Legend: 304s | * `unitizer` requires review 304s | $ `unitizer` has been modified and needs to be re-run to recompute summary 304s 304s | Type number of unitizer to review, 'A' to review all that require review, 'R' 304s | to re-run all updated 304s 304s unitizer> R 304s 304s | Summary of files in common directory 'unitizer': 304s | 304s | Pass Fail 304s | *1. fastlm1.R 2 2 304s | 2. fastlm2.R 1 - 304s | *3. unitizer.fastlm.R 1 2 304s | ................................ 304s | 4 4 304s | Legend: 304s | * `unitizer` requires review 304s 304s | Type number of unitizer to review, 'A' to review all that require review 304s 304s unitizer> 1 304s +------------------------------------------------------------------------------+ 304s | unitizer for: unitizer/fastlm1.R | 304s +------------------------------------------------------------------------------+ 304s 304s Pass Fail 304s 2 2 304s ...................... 304s 2 2 304s 304s - Failed ----------------------------------------------------------------------- 304s 304s | The 2 tests in this section failed because the new evaluations do not match 304s | the reference values from the store. Overwrite with new results ([Y]es, [N]o, 304s | [P]rev, [B]rowse, [R]erun, [Q]uit, [H]elp)? 304s 304s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 304s > dat <- data.frame(x = 1:100, y = (1:100)^2) 304s > res <- fastlm(dat$x, dat$y) 304s 304s # Our fast computations do not produce the same results as our 304s # original tests so they fail. If you need more detail than the 304s # provided diff you may use `.new`/`.NEW` or `.ref`/`.REF`. 304s # 304s # You should reject these tests by typing 'N' at the prompt since 304s # they are incorrect. 304s 304s > res 304s intercept slope rsq 304s -3.54e+13 7.01e+11 9.39e-01 304s attr(,"class") 304s [1] "fastlm" 304s 304s | Value mismatch: 304s 304s < .ref > .new 304s @@ 1,4 @@ @@ 1,4 @@ 304s intercept slope rsq intercept slope rsq 304s < -1717.000 101.000 0.939 > -3.54e+13 7.01e+11 9.39e-01 304s attr(,"class") attr(,"class") 304s [1] "fastlm" [1] "fastlm" 304s 304s | State mismatch; see `.DIFF$state` for details. 304s 304s unitizer> Q 304s 304s | No changes recorded. 304s | unitizer unchanged. 304s 304s | Summary of files in common directory 'unitizer': 304s | 304s | Pass Fail 304s | *1. fastlm1.R 2 2 304s | 2. fastlm2.R 1 - 304s | *3. unitizer.fastlm.R 1 2 304s | ................................ 304s | 4 4 304s | Legend: 304s | * `unitizer` requires review 304s 304s | Type number of unitizer to review, 'A' to review all that require review 304s 304s unitizer> Q 304s 304s > # Variations on YY, YYY, and YYY 304s > unitizer:::read_line_set_vals(c("1", "YY", "Y", "Q", "Q")) 304s > unitize_dir(FLM.TEST.DIR, interactive.mode = TRUE) 304s 304s | Summary of files in common directory 'unitizer': 304s | 304s | Pass Fail 304s | *1. fastlm1.R 2 2 304s | 2. fastlm2.R 1 - 304s | *3. unitizer.fastlm.R 1 2 304s | ................................ 304s | 4 4 304s | Legend: 304s | * `unitizer` requires review 304s 304s | Type number of unitizer to review, 'A' to review all that require review 304s 304s unitizer> 1 304s +------------------------------------------------------------------------------+ 304s | unitizer for: unitizer/fastlm1.R | 304s +------------------------------------------------------------------------------+ 304s 304s Pass Fail 304s 2 2 304s ...................... 304s 2 2 304s 304s - Failed ----------------------------------------------------------------------- 304s 304s | The 2 tests in this section failed because the new evaluations do not match 304s | the reference values from the store. Overwrite with new results ([Y]es, [N]o, 304s | [P]rev, [B]rowse, [R]erun, [Q]uit, [H]elp)? 304s 304s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 304s > dat <- data.frame(x = 1:100, y = (1:100)^2) 304s > res <- fastlm(dat$x, dat$y) 304s 304s # Our fast computations do not produce the same results as our 304s # original tests so they fail. If you need more detail than the 304s # provided diff you may use `.new`/`.NEW` or `.ref`/`.REF`. 304s # 304s # You should reject these tests by typing 'N' at the prompt since 304s # they are incorrect. 304s 304s > res 304s intercept slope rsq 304s -3.54e+13 7.01e+11 9.39e-01 304s attr(,"class") 304s [1] "fastlm" 304s 304s | Value mismatch: 304s 304s < .ref > .new 304s @@ 1,4 @@ @@ 1,4 @@ 304s intercept slope rsq intercept slope rsq 304s < -1717.000 101.000 0.939 > -3.54e+13 7.01e+11 9.39e-01 304s attr(,"class") attr(,"class") 304s [1] "fastlm" [1] "fastlm" 304s 304s | State mismatch; see `.DIFF$state` for details. 304s 304s unitizer> YY 304s 305s 4. res . . . . . Failed:- 305s 5. get_slope(res) . Failed:- 305s 305s Choose 'Y' for the 2 tests shown above ([Y]es, [N]o)? 305s unitizer> Y 305s 305s = Finalize Unitizer ============================================================ 305s 305s | You will IRREVERSIBLY modify 'unitizer/fastlm1.unitizer' by: 305s | - Replacing 2 out of 2 failed tests 305s 305s | Update unitizer ([Y]es, [N]o, [P]rev, [B]rowse, [R]erun)? 305s 305s unitizer> Q 305s 305s | Changes discarded. 305s | unitizer unchanged. 305s 305s | Summary of files in common directory 'unitizer': 305s | 305s | Pass Fail 305s | *1. fastlm1.R 2 2 305s | 2. fastlm2.R 1 - 305s | *3. unitizer.fastlm.R 1 2 305s | ................................ 305s | 4 4 305s | Legend: 305s | * `unitizer` requires review 305s 305s | Type number of unitizer to review, 'A' to review all that require review 305s 305s unitizer> Q 305s 305s > unitizer:::read_line_set_vals(c("1", "YYY", "Y", "Q", "Q")) 305s > unitize_dir(FLM.TEST.DIR, interactive.mode = TRUE) 305s 305s | Summary of files in common directory 'unitizer': 305s | 305s | Pass Fail 305s | *1. fastlm1.R 2 2 305s | 2. fastlm2.R 1 - 305s | *3. unitizer.fastlm.R 1 2 305s | ................................ 305s | 4 4 305s | Legend: 305s | * `unitizer` requires review 305s 305s | Type number of unitizer to review, 'A' to review all that require review 305s 305s unitizer> 1 305s +------------------------------------------------------------------------------+ 305s | unitizer for: unitizer/fastlm1.R | 305s +------------------------------------------------------------------------------+ 305s 305s Pass Fail 305s 2 2 305s ...................... 305s 2 2 305s 305s - Failed ----------------------------------------------------------------------- 305s 305s | The 2 tests in this section failed because the new evaluations do not match 305s | the reference values from the store. Overwrite with new results ([Y]es, [N]o, 305s | [P]rev, [B]rowse, [R]erun, [Q]uit, [H]elp)? 305s 305s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 305s > dat <- data.frame(x = 1:100, y = (1:100)^2) 305s > res <- fastlm(dat$x, dat$y) 305s 305s # Our fast computations do not produce the same results as our 305s # original tests so they fail. If you need more detail than the 305s # provided diff you may use `.new`/`.NEW` or `.ref`/`.REF`. 305s # 305s # You should reject these tests by typing 'N' at the prompt since 305s # they are incorrect. 305s 305s > res 305s intercept slope rsq 305s -3.54e+13 7.01e+11 9.39e-01 305s attr(,"class") 305s [1] "fastlm" 305s 305s | Value mismatch: 305s 305s < .ref > .new 305s @@ 1,4 @@ @@ 1,4 @@ 305s intercept slope rsq intercept slope rsq 305s < -1717.000 101.000 0.939 > -3.54e+13 7.01e+11 9.39e-01 305s attr(,"class") attr(,"class") 305s [1] "fastlm" [1] "fastlm" 305s 305s | State mismatch; see `.DIFF$state` for details. 305s 305s unitizer> YYY 305s 305s 4. res . . . . . Failed:- 305s 5. get_slope(res) . Failed:- 305s 305s Choose 'Y' for the 2 tests shown above ([Y]es, [N]o)? 305s unitizer> Y 305s 305s = Finalize Unitizer ============================================================ 305s 305s | You will IRREVERSIBLY modify 'unitizer/fastlm1.unitizer' by: 305s | - Replacing 2 out of 2 failed tests 305s 305s | Update unitizer ([Y]es, [N]o, [P]rev, [B]rowse, [R]erun)? 305s 305s unitizer> Q 305s 305s | Changes discarded. 305s | unitizer unchanged. 305s 305s | Summary of files in common directory 'unitizer': 305s | 305s | Pass Fail 305s | *1. fastlm1.R 2 2 305s | 2. fastlm2.R 1 - 305s | *3. unitizer.fastlm.R 1 2 305s | ................................ 305s | 4 4 305s | Legend: 305s | * `unitizer` requires review 305s 305s | Type number of unitizer to review, 'A' to review all that require review 305s 305s unitizer> Q 305s 305s > unitizer:::read_line_set_vals(c("1", "YYYY", "Y", "Q", "Q")) 305s > unitize_dir(FLM.TEST.DIR, interactive.mode = TRUE) 305s 305s | Summary of files in common directory 'unitizer': 305s | 305s | Pass Fail 305s | *1. fastlm1.R 2 2 305s | 2. fastlm2.R 1 - 305s | *3. unitizer.fastlm.R 1 2 305s | ................................ 305s | 4 4 305s | Legend: 305s | * `unitizer` requires review 305s 305s | Type number of unitizer to review, 'A' to review all that require review 305s 305s unitizer> 1 305s +------------------------------------------------------------------------------+ 305s | unitizer for: unitizer/fastlm1.R | 305s +------------------------------------------------------------------------------+ 305s 305s Pass Fail 305s 2 2 305s ...................... 305s 2 2 305s 305s - Failed ----------------------------------------------------------------------- 305s 305s | The 2 tests in this section failed because the new evaluations do not match 305s | the reference values from the store. Overwrite with new results ([Y]es, [N]o, 305s | [P]rev, [B]rowse, [R]erun, [Q]uit, [H]elp)? 305s 305s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 305s > dat <- data.frame(x = 1:100, y = (1:100)^2) 305s > res <- fastlm(dat$x, dat$y) 305s 305s # Our fast computations do not produce the same results as our 305s # original tests so they fail. If you need more detail than the 305s # provided diff you may use `.new`/`.NEW` or `.ref`/`.REF`. 305s # 305s # You should reject these tests by typing 'N' at the prompt since 305s # they are incorrect. 305s 305s > res 305s intercept slope rsq 305s -3.54e+13 7.01e+11 9.39e-01 305s attr(,"class") 305s [1] "fastlm" 305s 305s | Value mismatch: 305s 305s < .ref > .new 305s @@ 1,4 @@ @@ 1,4 @@ 305s intercept slope rsq intercept slope rsq 305s < -1717.000 101.000 0.939 > -3.54e+13 7.01e+11 9.39e-01 305s attr(,"class") attr(,"class") 305s [1] "fastlm" [1] "fastlm" 305s 305s | State mismatch; see `.DIFF$state` for details. 305s 305s unitizer> YYYY 305s 305s 4. res . . . . . Failed:- 305s 5. get_slope(res) . Failed:- 305s 305s Choose 'Y' for the 2 tests shown above ([Y]es, [N]o)? 305s unitizer> Y 305s 305s = Finalize Unitizer ============================================================ 305s 305s | You will IRREVERSIBLY modify 'unitizer/fastlm1.unitizer' by: 305s | - Replacing 2 out of 2 failed tests 305s 305s | Update unitizer ([Y]es, [N]o, [P]rev, [B]rowse, [R]erun)? 305s 305s unitizer> Q 305s 305s | Changes discarded. 305s | unitizer unchanged. 305s 305s | Summary of files in common directory 'unitizer': 305s | 305s | Pass Fail 305s | *1. fastlm1.R 2 2 305s | 2. fastlm2.R 1 - 305s | *3. unitizer.fastlm.R 1 2 305s | ................................ 305s | 4 4 305s | Legend: 305s | * `unitizer` requires review 305s 305s | Type number of unitizer to review, 'A' to review all that require review 305s 305s unitizer> Q 306s 306s > # review all, accepting all changes, and reevaluting everything; note that this 306s > # means we're accepting tests that are not correct 306s > unitizer:::read_line_set_vals(c("A", "Y", "Y", "Y", "Y", "Y", "Y", "RR")) 306s > unitize_dir(FLM.TEST.DIR, interactive.mode = TRUE) 306s 306s | Summary of files in common directory 'unitizer': 306s | 306s | Pass Fail 306s | *1. fastlm1.R 2 2 306s | 2. fastlm2.R 1 - 306s | *3. unitizer.fastlm.R 1 2 306s | ................................ 306s | 4 4 306s | Legend: 306s | * `unitizer` requires review 306s 306s | Type number of unitizer to review, 'A' to review all that require review 306s 306s unitizer> A 306s 306s +------------------------------------------------------------------------------+ 306s | unitizer for: unitizer/fastlm1.R | 306s +------------------------------------------------------------------------------+ 306s 306s Pass Fail 306s 2 2 306s ...................... 306s 2 2 306s 306s - Failed ----------------------------------------------------------------------- 306s 306s | The 2 tests in this section failed because the new evaluations do not match 306s | the reference values from the store. Overwrite with new results ([Y]es, [N]o, 306s | [P]rev, [B]rowse, [R]erun, [QQ]uit All, [Q]uit, [H]elp)? 306s 306s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 306s > dat <- data.frame(x = 1:100, y = (1:100)^2) 306s > res <- fastlm(dat$x, dat$y) 306s 306s # Our fast computations do not produce the same results as our 306s # original tests so they fail. If you need more detail than the 306s # provided diff you may use `.new`/`.NEW` or `.ref`/`.REF`. 306s # 306s # You should reject these tests by typing 'N' at the prompt since 306s # they are incorrect. 306s 306s > res 306s intercept slope rsq 306s -3.54e+13 7.01e+11 9.39e-01 306s attr(,"class") 306s [1] "fastlm" 306s 306s | Value mismatch: 306s 306s < .ref > .new 306s @@ 1,4 @@ @@ 1,4 @@ 306s intercept slope rsq intercept slope rsq 306s < -1717.000 101.000 0.939 > -3.54e+13 7.01e+11 9.39e-01 306s attr(,"class") attr(,"class") 306s [1] "fastlm" [1] "fastlm" 306s 306s | State mismatch; see `.DIFF$state` for details. 306s 306s unitizer> Y 306s 306s # This one is also incorrect; reject with 'N' 306s 306s > get_slope(res) 306s [1] 7.01e+11 306s 306s | Value mismatch: 306s 306s < .ref > .new 306s @@ 1 @@ @@ 1 @@ 306s < [1] 101 > [1] 7.01e+11 306s 306s | State mismatch; see `.DIFF$state` for details. 306s 306s unitizer> Y 306s 306s = Finalize Unitizer ============================================================ 306s 306s | You will IRREVERSIBLY modify 'unitizer/fastlm1.unitizer' by: 306s | - Replacing 2 out of 2 failed tests 306s 306s | Update unitizer ([Y]es, [N]o, [P]rev, [B]rowse, [R]erun, [QQ]uit All)? 306s 306s unitizer> Y 306s 306s | unitizer updated. 306s 306s +------------------------------------------------------------------------------+ 306s | unitizer for: unitizer/unitizer.fastlm.R | 306s +------------------------------------------------------------------------------+ 306s 306s Pass Fail 306s 1 2 306s ...................... 306s 1 2 306s 306s - Failed ----------------------------------------------------------------------- 306s 306s | The 2 tests in this section failed because the new evaluations do not match 306s | the reference values from the store. Overwrite with new results ([Y]es, [N]o, 306s | [P]rev, [B]rowse, [R]erun, [QQ]uit All, [Q]uit, [H]elp)? 306s 306s # Extra test file for internal tests; not for DEMO 306s 306s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 306s > x <- 1:10 306s > y <- x^3 306s > res <- fastlm(x, y) 306s > get_slope(res) 306s [1] 717379 306s 306s | Value mismatch: 306s 306s < .ref > .new 306s @@ 1 @@ @@ 1 @@ 306s < [1] 105 > [1] 717379 306s 306s | State mismatch; see `.DIFF$state` for details. 306s 306s unitizer> Y 306s 306s > get_intercept(res) 306s [1] -3945281 306s 306s | Value mismatch: 306s 306s < .ref > .new 306s @@ 1 @@ @@ 1 @@ 306s < [1] -277 > [1] -3945281 306s 306s | State mismatch; see `.DIFF$state` for details. 306s 306s unitizer> Y 306s 306s = Finalize Unitizer ============================================================ 306s 306s | You will IRREVERSIBLY modify 'unitizer/unitizer.fastlm.unitizer' by: 306s | - Replacing 2 out of 2 failed tests 306s 306s | Update unitizer ([Y]es, [N]o, [P]rev, [B]rowse, [R]erun, [QQ]uit All)? 306s 306s unitizer> Y 306s 306s | unitizer updated. 306s 306s | Summary of files in common directory 'unitizer': 306s | 306s | Pass Fail 306s | $1. fastlm1.R ? ? 306s | 2. fastlm2.R 1 - 306s | $3. unitizer.fastlm.R ? ? 306s | ................................ 306s | ? ? 306s | Legend: 306s | $ `unitizer` has been modified and needs to be re-run to recompute summary 306s 306s | Type number of unitizer to review, 'A' to review all that require review, 'R' 306s | to re-run all updated 306s 306s unitizer> RR 306s 306s | Summary of files in common directory 'unitizer': 306s | 306s | Pass Fail 306s | 1. fastlm1.R 4 - 306s | 2. fastlm2.R 1 - 306s | 3. unitizer.fastlm.R 3 - 306s | ................................ 306s | 8 - 306s 306s | 8/8 tests passed; nothing to review. 306s 306s > 306s > # - "multi-sect" --------------------------------------------------------------- 306s > 306s > # Upgrade again, and try with deleted tests and other things 306s > update_fastlm(FLM, version = "0.1.2") 306s > inst_pak(FLM) 308s > unitizer:::read_line_set_vals(c("3", "ref(res)", "Y", "Y", "B", 308s + "1", "B", "U", "Y", "RR", "Y", "Q")) 308s > txt20 <- unitizer:::capture_output(unitize_dir(FLM.TEST.DIR, interactive.mode = TRUE)) 308s > txt20$output <- gsub("^<\\w+: .*?>", "", txt20$output) 308s > txt20 308s - Output ----------------------------------------------------------------------- 308s 308s 308s | Summary of files in common directory 'unitizer': 308s | 308s | Pass Fail New Del 308s | *1. fastlm1.R 2 2 - - 308s | 2. fastlm2.R 1 - - - 308s | *3. unitizer.fastlm.R 1 1 1 1 308s | .......................................... 308s | 4 3 1 1 308s | Legend: 308s | * `unitizer` requires review 308s 308s | Type number of unitizer to review, 'A' to review all that require review 308s 308s unitizer> 3 308s +------------------------------------------------------------------------------+ 308s | unitizer for: unitizer/unitizer.fastlm.R | 308s +------------------------------------------------------------------------------+ 308s 308s Pass Fail New Del 308s - - - 1 308s Basic Tests - 1 - - 308s Advanced Tests 1 - 1 - 308s .................................... 308s 1 1 1 1 308s 308s = =================================================================== 308s 308s - Removed ---------------------------------------------------------------------- 308s 308s | The following test exists in the unitizer store but not in the new test 308s | script. Remove test from store ([Y]es, [N]o, [P]rev, [B]rowse, [R]erun, 308s | [Q]uit, [H]elp)? 308s 308s > get_intercept(res) 308s [1] -3945281 308s 308s unitizer> ref(res) 308s unitizer> Y 308s 308s = Basic Tests ================================================================== 308s 308s - Failed ----------------------------------------------------------------------- 308s 308s | The following test failed because the new evaluation does not match the 308s | reference value from the store. Overwrite with new result ([Y]es, [N]o, 308s | [P]rev, [B]rowse, [R]erun, [Q]uit, [H]elp)? 308s 308s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 308s > x <- 1:10 308s > y <- x^3 308s > res <- fastlm(x, y) 308s > get_slope(res) 308s [1] 105 308s 308s | Value mismatch: 308s 308s < .ref > .new 308s @@ 1 @@ @@ 1 @@ 308s < [1] 717379 > [1] 105 308s 308s | State mismatch; see `.DIFF$state` for details. 308s 308s unitizer> Y 308s 308s = Advanced Tests =============================================================== 308s 308s - New -------------------------------------------------------------------------- 308s 308s | The following test is new. Add test to store ([Y]es, [N]o, [P]rev, [B]rowse, 308s | [R]erun, [Q]uit, [H]elp)? 308s 308s > 2 * get_slope(res) + get_intercept(res) 308s [1] -66.4 308s 308s unitizer> B 308s 308s = =================================================================== 308s 8. get_intercept(res) . . . . . . . . . . . . . . . Removed:Y 308s = Basic Tests ================================================================== 308s *1. library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) . -:- 308s *2. x <- 1:10 . . . . . . . . . . . . . . . . . . -:- 308s *3. y <- x^3 . . . . . . . . . . . . . . . . . . -:- 308s *4. res <- fastlm(x, y) . . . . . . . . . . . . . . -:- 308s 5. get_slope(res) . . . . . . . . . . . . . . . . Failed:Y 308s = Advanced Tests =============================================================== 308s 6. 2 * get_slope(res) + get_intercept(res) . . . . . . . . New:- 308s 7. get_rsq(res) . . . . . . . . . . . . . . . . . Passed:- 308s 308s | What test do you wish to review (input a test number, [U]nreviewed)? 308s 308s unitizer> 1 308s 308s = Basic Tests ================================================================== 308s 308s - Failed ----------------------------------------------------------------------- 308s 308s | The following test failed because the new evaluation does not match the 308s | reference value from the store. Overwrite with new result ([Y]es, [N]o, 308s | [P]rev, [B]rowse, [R]erun, [Q]uit, [H]elp)? 308s 308s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 308s unitizer> B 308s 308s = =================================================================== 308s 8. get_intercept(res) . . . . . . . . . . . . . . . Removed:Y 308s = Basic Tests ================================================================== 308s *1. library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) . -:- 308s *2. x <- 1:10 . . . . . . . . . . . . . . . . . . -:- 308s *3. y <- x^3 . . . . . . . . . . . . . . . . . . -:- 308s *4. res <- fastlm(x, y) . . . . . . . . . . . . . . -:- 308s 5. get_slope(res) . . . . . . . . . . . . . . . . Failed:Y 308s = Advanced Tests =============================================================== 308s 6. 2 * get_slope(res) + get_intercept(res) . . . . . . . . New:- 308s 7. get_rsq(res) . . . . . . . . . . . . . . . . . Passed:- 308s 308s | What test do you wish to review (input a test number, [U]nreviewed)? 308s 308s unitizer> U 308s 308s = Advanced Tests =============================================================== 308s 308s - New -------------------------------------------------------------------------- 308s 308s | The following test is new. Add test to store ([Y]es, [N]o, [P]rev, [B]rowse, 308s | [R]erun, [Q]uit, [H]elp)? 308s 308s > 2 * get_slope(res) + get_intercept(res) 308s [1] -66.4 308s 308s unitizer> Y 308s 308s = Finalize Unitizer ============================================================ 308s 308s | Update unitizer ([Y]es, [N]o, [P]rev, [B]rowse, [R]erun)? 308s 308s unitizer> RR 308s 308s | Update unitizer and re-run all loaded unitizers ([Y]es, [N]o, [P]rev, [B] 308s | rowse, [R]erun)? 308s 308s unitizer> Y 308s 308s | Summary of files in common directory 'unitizer': 308s | 308s | Pass Fail 308s | *1. fastlm1.R 2 2 308s | 2. fastlm2.R 1 - 308s | 3. unitizer.fastlm.R 3 - 308s | ................................ 308s | 6 2 308s | Legend: 308s | * `unitizer` requires review 308s 308s | Type number of unitizer to review, 'A' to review all that require review 308s 308s unitizer> Q 308s 308s - Message ---------------------------------------------------------------------- 308s 308s `ref` is only active when there is an active secondary environment 308s | You selected a test that is not normally reviewed in this mode; 308s | as such, upon test completion, you will be brought back to this menu 308s | instead of being taken to the next reviewable test. 308s 308s | You will IRREVERSIBLY modify 'unitizer/unitizer.fastlm.unitizer' by: 308s | - Replacing 1 out of 1 failed tests 308s | - Adding 1 out of 1 new tests 308s | - Removing 1 out of 1 removed tests 308s 308s | Toggling re-run mode ON for all loaded unitizers 308s 308s | You will IRREVERSIBLY modify 'unitizer/unitizer.fastlm.unitizer' by: 308s | - Replacing 1 out of 1 failed tests 308s | - Adding 1 out of 1 new tests 308s | - Removing 1 out of 1 removed tests 308s 308s | unitizer updated. 308s 308s > 308s > # - "Load Fail" ---------------------------------------------------------------- 308s > 308s > # Purposefully mess up one of the unitizers to see if the load fail stuff works 308s > saveRDS(list(1, 2, 3), file.path(FLM.TEST.DIR, "fastlm1.unitizer", 308s + "data.rds")) 308s > try(unitize_dir(FLM.TEST.DIR, interactive.mode = TRUE)) 308s 308s Warning in check_call_stack() : 308s It appears you are running unitizer inside an error handling function such as 308s `withCallingHanlders`, `tryCatch`, or `withRestarts`. This is strongly dis- 308s couraged as it may cause unpredictable behavior from unitizer in the event tests 308s produce conditions / errors. We strongly recommend you re-run your tests 308s outside of such handling functions. 309s | 309s | The following unitizer could not be loaded: 309s | - unitizer/fastlm1.unitizer: `get_unitizer` error: Retrieved object is not a 309s | unitizer store 309s 309s Error in load_unitizers(store.ids[active], test.files[active], par.frame = util.frame, : 309s Cannot proceed with invalid or out of date unitizers. You must either fix or remove them. 309s > unitizer:::read_line_set_vals(NULL) 309s > 309s PASS 309s Begin testing t-utz2.R 309s 309s R version 4.3.2 (2023-10-31) -- "Eye Holes" 309s Copyright (C) 2023 The R Foundation for Statistical Computing 309s Platform: aarch64-unknown-linux-gnu (64-bit) 309s 309s R is free software and comes with ABSOLUTELY NO WARRANTY. 309s You are welcome to redistribute it under certain conditions. 309s Type 'license()' or 'licence()' for distribution details. 309s 309s R is a collaborative project with many contributors. 309s Type 'contributors()' for more information and 309s 'citation()' on how to cite R or R packages in publications. 309s 309s Type 'demo()' for some demos, 'help()' for on-line help, or 309s 'help.start()' for an HTML browser interface to help. 309s Type 'q()' to quit R. 309s 309s > # Overflow tests from testthat.unitize.R 309s > 309s > source(file.path("_helper", "init.R")) 309s > source(file.path("_helper", "pkgs.R")) 309s Install Packages 312s Setup Demos 312s > 312s > library(unitizer) 312s > 312s > # /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ 312s > # - "unreviewed variations" ---------------------------------------------------- 312s > # /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ 312s > 312s > # Test unreviewed 312s > # Accept one and go to unreviewed 312s > # Accept one more and browse and go to unreviewed 312s > # Accept two remaining and confirm no unreviewed 312s > # No unreviewed tests 312s > unitizer:::read_line_set_vals( 312s + c("Y", "Q", "U", "Y", "B", "U", "Y", "Y", "U", "B", "U", "Q") 312s + ) 312s > out <- unitizer:::capture_output(unitize(FLM.TEST.FILE, interactive.mode = TRUE)) 313s > unitizer:::clean_eval_exp(out) 313s - Output ----------------------------------------------------------------------- 313s 313s 313s +------------------------------------------------------------------------------+ 313s | unitizer for: unitizer/fastlm1.R | 313s +------------------------------------------------------------------------------+ 313s 313s Pass Fail New 313s - - 4 313s ........................... 313s - - 4 313s 313s - New -------------------------------------------------------------------------- 313s 313s | The 4 tests in this section are new. Add tests to store ([Y]es, [N]o, [P]rev, 313s | [B]rowse, [R]erun, [Q]uit, [H]elp)? 313s 313s # Assignments and calls to `library` are not considered tests by 313s # `unitizer` so you will not need to review them 313s 313s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 313s > dat <- data.frame(x = 1:100, y = (1:100)^2) 313s > res <- fastlm(dat$x, dat$y) 313s 313s # The `unitizer>` prompt is like the standard R prompt. You may 313s # enter expressions such as `lm(y ~ x, dat)$coefficients`, or 313s # `str(res)`. 313s # 313s # Once you are done reviewing, you need to tell `unitizer` you 313s # accept the test by typing 'Y' at the prompt. Enter 'H' for help. 313s 313s > res 313s intercept slope rsq 313s -1717.000 101.000 0.939 313s attr(,"class") 313s [1] "fastlm" 313s 313s unitizer> Y 313s 313s # There are three more tests to review; accept them with 'Y' 313s 313s > get_slope(res) 313s [1] 101 313s 313s unitizer> Q 313s 313s = Finalize Unitizer ============================================================ 313s 313s | You have 3 unreviewed tests; press `B` to browse tests, `U` to go to first 313s | unreviewed test. 313s 313s | Update unitizer ([Y]es, [N]o, [P]rev, [B]rowse, [U]nreviewed, [R]erun)? 313s 313s unitizer> U 313s 313s # There are three more tests to review; accept them with 'Y' 313s 313s > get_slope(res) 313s [1] 101 313s 313s unitizer> Y 313s 313s > get_rsq(res) 313s [1] 0.939 313s 313s unitizer> B 313s 313s *1. library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) . -:- 313s *2. dat <- data.frame(x = 1:100, y = (1:100)^2) . . . . . . -:- 313s *3. res <- fastlm(dat$x, dat$y) . . . . . . . . . . . . -:- 313s 4. res . . . . . . . . . . . . . . . . . . . . New:Y 313s 5. get_slope(res) . . . . . . . . . . . . . . . . New:Y 313s 6. get_rsq(res) . . . . . . . . . . . . . . . . . New:- 313s 7. fastlm(1:100, 1:10) . . . . . . . . . . . . . . New:- 313s 313s | What test do you wish to review (input a test number, [U]nreviewed)? 313s 313s unitizer> U 313s 313s - New -------------------------------------------------------------------------- 313s 313s | The 4 tests in this section are new. Add tests to store ([Y]es, [N]o, [P]rev, 313s | [B]rowse, [R]erun, [Q]uit, [H]elp)? 313s 313s > get_rsq(res) 313s [1] 0.939 313s 313s unitizer> Y 313s 313s # This last test is expected to cause an error; press 'Y' to 313s # accept it so future checks can confirm the same error persists 313s 313s > fastlm(1:100, 1:10) 313s 313s unitizer> Y 313s 313s = Finalize Unitizer ============================================================ 313s 313s | Update unitizer ([Y]es, [N]o, [P]rev, [B]rowse, [R]erun)? 313s 313s unitizer> U 313s 313s | Update unitizer ([Y]es, [N]o, [P]rev, [B]rowse, [R]erun, [Q]uit, [H]elp)? 313s 313s unitizer> B 313s 313s *1. library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) . -:- 313s *2. dat <- data.frame(x = 1:100, y = (1:100)^2) . . . . . . -:- 313s *3. res <- fastlm(dat$x, dat$y) . . . . . . . . . . . . -:- 313s 4. res . . . . . . . . . . . . . . . . . . . . New:Y 313s 5. get_slope(res) . . . . . . . . . . . . . . . . New:Y 313s 6. get_rsq(res) . . . . . . . . . . . . . . . . . New:Y 313s 7. fastlm(1:100, 1:10) . . . . . . . . . . . . . . New:Y 313s 313s | What test do you wish to review (input a test number, [U]nreviewed)? 313s 313s unitizer> U 313s 313s = Finalize Unitizer ============================================================ 313s 313s | Update unitizer ([Y]es, [N]o, [P]rev, [B]rowse, [R]erun)? 313s 313s unitizer> Q 313s 313s | unitizer unchanged. 313s 313s - Message ---------------------------------------------------------------------- 313s 313s | You will IRREVERSIBLY modify 'unitizer/fastlm1.unitizer' by: 313s | - Adding 1 out of 4 new tests 313s 313s Error in fastlm(1:100, 1:10) : 313s Arguments `x` and `y` must be the same length. 313s | You will IRREVERSIBLY modify 'unitizer/fastlm1.unitizer' by: 313s | - Adding 4 out of 4 new tests 313s 313s Error in : object 'U' not found 313s | No unreviewed tests. 313s 313s | You will IRREVERSIBLY modify 'unitizer/fastlm1.unitizer' by: 313s | - Adding 4 out of 4 new tests 313s 313s | Changes discarded. 313s > 313s > # /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ 313s > # - "Re-eval" ------------------------------------------------------------------ 313s > # /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ 313s > 313s > # Test re-eval 313s > # Re-eval and jump back to file 1 313s > # Quit from file 1 and back to main menu 313s > # Accept one test in file 2 and quit 313s > # Go to file 3, accept one, and Re-eval all 313s > 313s > unitizer:::read_line_set_vals( 313s + c("1", "Y", "R", "Y", "Q", "2", "Y", "Y", "3", "Y", "RR", "Y", "Q", "Q") 313s + ) 313s > untz1 <- unitize_dir(FLM.TEST.DIR, interactive.mode = TRUE) 313s 313s | Summary of files in common directory 'unitizer': 313s | 313s | Pass Fail New 313s | *1. fastlm1.R - - 4 313s | *2. fastlm2.R - - 1 313s | *3. unitizer.fastlm.R - - 3 313s | ..................................... 313s | - - 8 313s | Legend: 313s | * `unitizer` requires review 313s 313s | Type number of unitizer to review, 'A' to review all that require review 313s 313s unitizer> 1 313s +------------------------------------------------------------------------------+ 313s | unitizer for: unitizer/fastlm1.R | 313s +------------------------------------------------------------------------------+ 313s 313s Pass Fail New 313s - - 4 313s ........................... 313s - - 4 313s 314s - New -------------------------------------------------------------------------- 314s 314s | The 4 tests in this section are new. Add tests to store ([Y]es, [N]o, [P]rev, 314s | [B]rowse, [R]erun, [Q]uit, [H]elp)? 314s 314s # Assignments and calls to `library` are not considered tests by 314s # `unitizer` so you will not need to review them 314s 314s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 314s > dat <- data.frame(x = 1:100, y = (1:100)^2) 314s > res <- fastlm(dat$x, dat$y) 314s 314s # The `unitizer>` prompt is like the standard R prompt. You may 314s # enter expressions such as `lm(y ~ x, dat)$coefficients`, or 314s # `str(res)`. 314s # 314s # Once you are done reviewing, you need to tell `unitizer` you 314s # accept the test by typing 'Y' at the prompt. Enter 'H' for help. 314s 314s > res 314s intercept slope rsq 314s -1717.000 101.000 0.939 314s attr(,"class") 314s [1] "fastlm" 314s 314s unitizer> Y 314s 314s # There are three more tests to review; accept them with 'Y' 314s 314s > get_slope(res) 314s [1] 101 314s 314s unitizer> R 314s 314s | Toggling re-run mode ON for this unitizer 314s 314s = Finalize Unitizer ============================================================ 314s 314s | You have 3 unreviewed tests; press `B` to browse tests, `U` to go to first 314s | unreviewed test. 314s 314s | You will IRREVERSIBLY modify 'unitizer/fastlm1.unitizer' by: 314s | - Adding 1 out of 4 new tests 314s 314s | Update unitizer and re-run unitizer ([Y]es, [N]o, [P]rev, [B]rowse, [U] 314s | nreviewed, [R]erun)? 314s 314s unitizer> Y 314s 314s | unitizer updated. 314s 314s +------------------------------------------------------------------------------+ 314s | unitizer for: unitizer/fastlm1.R | 314s +------------------------------------------------------------------------------+ 314s 314s Pass Fail New 314s 1 - 3 314s ........................... 314s 1 - 3 314s 314s - New -------------------------------------------------------------------------- 314s 314s | The 3 tests in this section are new. Add tests to store ([Y]es, [N]o, [P]rev, 314s | [B]rowse, [R]erun, [Q]uit, [H]elp)? 314s 314s | Jumping to test #5 because that was the test under review when test re-run was 314s | requested. 314s 314s # There are three more tests to review; accept them with 'Y' 314s 314s > get_slope(res) 314s [1] 101 314s 314s unitizer> Q 314s 314s | No changes recorded. 314s | unitizer unchanged. 314s 314s | Summary of files in common directory 'unitizer': 314s | 314s | Pass Fail New 314s | *1. fastlm1.R 1 - 3 314s | *2. fastlm2.R - - 1 314s | *3. unitizer.fastlm.R - - 3 314s | ..................................... 314s | 1 - 7 314s | Legend: 314s | * `unitizer` requires review 314s 314s | Type number of unitizer to review, 'A' to review all that require review 314s 314s unitizer> 2 314s +------------------------------------------------------------------------------+ 314s | unitizer for: unitizer/fastlm2.R | 314s +------------------------------------------------------------------------------+ 314s 314s Pass Fail New 314s - - 1 314s ........................... 314s - - 1 314s 314s - New -------------------------------------------------------------------------- 314s 314s | The following test is new. Add test to store ([Y]es, [N]o, [P]rev, [B]rowse, 314s | [R]erun, [Q]uit, [H]elp)? 314s 314s # For internal tests only; not for demo 314s 314s > x <- 1:10 314s > y <- 1:10^3 314s > res <- summary(lm(y ~ x, data.frame(x = x, y = y))) 314s > intercept <- res$coefficients[1, 1] 314s > slope <- res$coefficients[2, 1] 314s > rsq <- res$r.squared 314s > structure(c(intercept = intercept, slope = slope, rsq = rsq), 314s + class = "fastlm") 314s intercept slope rsq 314s 4.95e+02 1.00e+00 9.90e-05 314s attr(,"class") 314s [1] "fastlm" 314s 314s unitizer> Y 314s 314s = Finalize Unitizer ============================================================ 314s 314s | You will IRREVERSIBLY modify 'unitizer/fastlm2.unitizer' by: 314s | - Adding 1 out of 1 new tests 314s 314s | Update unitizer ([Y]es, [N]o, [P]rev, [B]rowse, [R]erun)? 314s 314s unitizer> Y 314s 314s | unitizer updated. 314s 314s | Summary of files in common directory 'unitizer': 314s | 314s | Pass Fail New 314s | *1. fastlm1.R 1 - 3 314s | $2. fastlm2.R ? ? ? 314s | *3. unitizer.fastlm.R - - 3 314s | ..................................... 314s | ? ? ? 314s | Legend: 314s | * `unitizer` requires review 314s | $ `unitizer` has been modified and needs to be re-run to recompute summary 314s 314s | Type number of unitizer to review, 'A' to review all that require review, 'R' 314s | to re-run all updated 314s 314s unitizer> 3 314s +------------------------------------------------------------------------------+ 314s | unitizer for: unitizer/unitizer.fastlm.R | 314s +------------------------------------------------------------------------------+ 314s 314s Pass Fail New 314s - - 3 314s ........................... 314s - - 3 314s 314s - New -------------------------------------------------------------------------- 314s 314s | The 3 tests in this section are new. Add tests to store ([Y]es, [N]o, [P]rev, 314s | [B]rowse, [R]erun, [Q]uit, [H]elp)? 314s 314s # Extra test file for internal tests; not for DEMO 314s 314s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 314s > x <- 1:10 314s > y <- x^3 314s > res <- fastlm(x, y) 314s > get_slope(res) 314s [1] 105 314s 314s unitizer> Y 314s 314s > get_rsq(res) 314s [1] 0.862 314s 314s unitizer> RR 314s 314s | Toggling re-run mode ON for all loaded unitizers 314s 314s = Finalize Unitizer ============================================================ 314s 314s | You have 2 unreviewed tests; press `B` to browse tests, `U` to go to first 314s | unreviewed test. 314s 314s | You will IRREVERSIBLY modify 'unitizer/unitizer.fastlm.unitizer' by: 314s | - Adding 1 out of 3 new tests 314s 314s | Update unitizer and re-run all loaded unitizers ([Y]es, [N]o, [P]rev, [B] 314s | rowse, [U]nreviewed, [R]erun)? 314s 314s unitizer> Y 314s 314s | unitizer updated. 314s 315s | Summary of files in common directory 'unitizer': 315s | 315s | Pass Fail New 315s | *1. fastlm1.R 1 - 3 315s | 2. fastlm2.R 1 - - 315s | *3. unitizer.fastlm.R 1 - 2 315s | ..................................... 315s | 3 - 5 315s | Legend: 315s | * `unitizer` requires review 315s 315s | Type number of unitizer to review, 'A' to review all that require review 315s 315s unitizer> Q 315s 315s > print(untz1) 315s Summary of tests (accept/total): 315s 315s id test.file New Passed Totals 315s 1 fastlm1.R 0/3 1/1 1/4 $ 315s 2 fastlm2.R 0/0 1/1 1/1 $ 315s 3 unitizer.fastlm.R 0/2 1/1 1/3 $ 315s ----------------------------------------------------- 315s 0 Totals 0/5 3/3 3/8 315s 315s $ unitizer was saved in prior evaluation 315s 315s Test files in common directory 'tests/unitizer' 315s > # remove temp file names and display 315s > invisible(lapply(untz1, function(x) {print(x); cat('\n')})) 315s Test File: tests/unitizer/fastlm1.R 315s Store ID: tests/unitizer/fastlm1.unitizer 315s 315s id call ignored status user reviewed 315s 1 4 library(utzflm, lib.loc = g... * Passed Y FALSE 315s 2 5 dat <- data.frame(x = 1:100... * Passed Y FALSE 315s 3 6 res <- fastlm(dat$x, dat$y) * Passed Y FALSE 315s 4 7 res Passed Y FALSE 315s 5 1 get_slope(res) New N FALSE 315s 6 2 get_rsq(res) New N FALSE 315s 7 3 fastlm(1:100, 1:10) New N FALSE 315s 315s You chose NOT to save these changes to the unitizer store 315s 315s Test File: tests/unitizer/fastlm2.R 315s Store ID: tests/unitizer/fastlm2.unitizer 315s 315s id call ignored status user reviewed 315s 1 1 x <- 1:10 * Passed Y FALSE 315s 2 2 y <- 1:10^3 * Passed Y FALSE 315s 3 3 res <- summary(lm(y ~ x, da... * Passed Y FALSE 315s 4 4 intercept <- res$coefficien... * Passed Y FALSE 315s 5 5 slope <- res$coefficients[2... * Passed Y FALSE 315s 6 6 rsq <- res$r.squared * Passed Y FALSE 315s 7 7 structure(c(intercept = int... Passed Y FALSE 315s 315s You chose NOT to save these changes to the unitizer store 315s 315s Test File: tests/unitizer/unitizer.fastlm.R 315s Store ID: tests/unitizer/unitizer.fastlm.unitizer 315s 315s id call ignored status user reviewed 315s 1 3 library(utzflm, lib.loc = g... * Passed Y FALSE 315s 2 4 x <- 1:10 * Passed Y FALSE 315s 3 5 y <- x^3 * Passed Y FALSE 315s 4 6 res <- fastlm(x, y) * Passed Y FALSE 315s 5 7 get_slope(res) Passed Y FALSE 315s 6 1 get_rsq(res) New N FALSE 315s 7 2 get_intercept(res) New N FALSE 315s 315s You chose NOT to save these changes to the unitizer store 315s 315s > 315s > # /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ 315s > # - "Section Extra" ------------------------------------------------------------ 315s > # /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ 315s > 315s > # Make sure that deleted items from a section are still marked from that 315s > # section upgrade to version two to use the files that are set up for that 315s > # there; notice update_fastlm_*extra* 315s > # Re-set by dropping unitizers 315s > 315s > unlink(list.dirs(FLM.TEST.DIR, recursive = FALSE), recursive = TRUE) 315s > unitizer:::update_fastlm_extra(FLM) 315s > inst_pak(FLM) 316s > test.file.1 <- file.path(FLM.TEST.DIR, "unitizer.fastlm.R") 316s > test.file.2 <- file.path(FLM.TEST.DIR, "unitizer.fastlm2.R") 316s > test.store <- file.path(FLM.TEST.DIR, "store2.unitizer") 316s > # First auto accept all initial tests, and then re-run with second version to 316s > # make sure deleted tests are where we think they should be 316s > out.1 <- 316s + unitizer:::capture_output(unitize(test.file.1, test.store, auto.accept = "new")) 316s > unitizer:::read_line_set_vals(c("B", "Q")) 316s > out.2 <- unitizer:::capture_output( 316s + untz.2 <- unitize(test.file.2, test.store, interactive.mode = TRUE) 316s + ) 316s > attributes(untz.2) <- NULL 316s > untz.2 316s [[1]] 316s [1] 1 2 3 4 5 6 7 316s 316s [[2]] 316s [1] "library(utzflm, lib.loc = getOption(\"unitizer.tmp.lib.loc\"))" 316s [2] "x <- 1:10" 316s [3] "y <- x^2" 316s [4] "res <- fastlm(x, y)" 316s [5] "get_slope(res)" 316s [6] "get_rsq(res)" 316s [7] "2 * get_slope(res) + get_intercept(res)" 316s 316s [[3]] 316s [1] "Basic Tests" "Basic Tests" "Basic Tests" "Basic Tests" 316s [5] "Basic Tests" "Advanced Tests" "Advanced Tests" 316s 316s [[4]] 316s [1] TRUE TRUE TRUE TRUE FALSE FALSE FALSE 316s 316s [[5]] 316s [1] Failed Failed Failed Failed Failed Failed Removed 316s Levels: New Passed Failed Removed Corrupted 316s 316s [[6]] 316s [1] N N N N N N N 316s Levels: Y N 316s 316s [[7]] 316s [1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE 316s 316s > 316s > # /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ 316s > # - "warning when comp funs produce output" ------------------------------------ 316s > # /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ 316s > 316s > # Sections with comp funs that output to stdout/stderr 316s > temp.loc <- tempfile() 316s > dir.create(temp.loc) 316s > file.copy(file.path(START.DIR, "_helper", "unitizers", "sects.R"), temp.loc) 316s [1] TRUE 316s > f.sec <- file.path(temp.loc, "sects.R") 316s > odir <- setwd(temp.loc) 316s > out <- unitizer:::capture_output( 316s + unitize(f.sec, auto.accept = "new", interactive.mode = FALSE 316s + ) ) 316s > 316s > unitize(f.sec, interactive.mode = FALSE) 316s 316s Warning in close_and_clear(e1@global$cons) : 316s Test comparison functions appear to have produced output, which should not happen (see `?unitizer_sect` for more details). If you did not provide custom testing functions, contact maintainer. First 50 lines follow: 316s I'm outputting to stdout 316s I'm outputting to stderr 316s I'm outputting to both 1 316s I'm outputting to both 2 316s 316s Warning in history_capt(history, interactive.mode) : 316s Unable to capture history in non-interactive mode. 317s | 3/3 tests passed; nothing to review. 317s 317s > setwd(odir) 317s > unlink(temp.loc, recursive = TRUE) 317s > 317s > # - "Corner Case Files" -------------------------------------------------------- 317s > 317s > # Corner case files 317s > # empty 317s > temp.empty <- paste0(tempfile(), "-empty.R") 317s > cat("\n", file = temp.empty) 317s > empty.capt <- unitizer:::capture_output(unitize(temp.empty, force = TRUE)) 317s > # File, but does not end in .R 317s > temp.bad <- paste0(tempfile()) 317s > 317s > cat("\n", file = temp.bad) 317s > badname.capt <- unitizer:::capture_output(try(unitize(temp.bad))) 317s > any(grepl("`get_unitizer` error", out$message)) 317s [1] FALSE 317s > 317s > any(grepl("Empty unitizer", empty.capt$output)) 317s [1] TRUE 317s > any(grepl("No valid unitizers available", badname.capt$message)) 317s [1] FALSE 317s > unlink(c(temp.empty, temp.bad)) 317s > 317s > # /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ 317s > # - "Re-eval change" ----------------------------------------------------------- 317s > # /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ 317s > 317s > # re-eval reeval with a modified file 317s > temp.reeval.base <- paste0(tempfile(), "-reeval") 317s > temp.reeval <- paste0(temp.reeval.base, ".R") 317s > temp.reeval.utz <- paste0(temp.reeval.base, ".unitizer") 317s > cat("1 + 1\n2 + 2\n", file = temp.reeval) 317s > # force re-review 317s > unitizer:::read_line_set_vals(c("Y", "P", "Y", "cat(\"1 + 1\n2 + 3\n\", file=temp.reeval)", 317s + "R", "Y", "Q")) 317s > # state = environment() so we can access variables from this local 317s > reeval.capt <- unitizer:::capture_output(unitize(temp.reeval, 317s + state = environment(), interactive.mode = TRUE)) 317s > unlink(c(temp.reeval, temp.reeval.utz), recursive = TRUE) 317s > 317s > # /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ 317s > # - "Condition fail" ----------------------------------------------------------- 317s > # /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ 317s > 317s > # Fail test with conditions 317s > temp.cond.base <- paste0(tempfile(), "-cond") 317s > temp.cond <- paste0(tempfile(), ".R") 317s > temp.cond.utz <- paste0(tempfile(), ".unitizer") 317s > cond.message <- "hello world" 317s > cat("warning(cond.message)", file = temp.cond) 317s > unitizer:::read_line_set_vals(c("Y", "Y")) 317s > # state = environment() so we can access variables from this local 317s > unitizer:::capture_output( 317s + unitize(temp.cond, state = environment(), interactive.mode = TRUE) 317s + ) 317s > cond.message <- "goodbye world" 317s > unitizer:::read_line_set_vals("Q") 317s > cond.capt <- 317s + unitizer:::capture_output( 317s + unitize(temp.cond, state = environment(), interactive.mode = TRUE) 317s + ) 317s > sum(grepl("Conditions mismatch", cond.capt$output)) == 1L 317s [1] TRUE 317s > unlink(c(temp.cond, temp.cond.utz), recursive = TRUE) 317s > 317s > # /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ 317s > # - "Force" -------------------------------------------------------------------- 317s > # /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ 317s > # 317s > # Toggle force update, in order for this to work we need to create a situation 317s > # where in a `unitize_dir`, one file passes, the other doesn't, and we review 317s > # the file that passes. Otherwise the only other way to do it is to set force 317s > # from the beginning, but that ruins the toggle effect. One possible issue 317s > # here is that we don't have a great way to check the file actually changed. 317s > 317s > temp.forceup.base.dir <- tempfile() 317s > dir.create(temp.forceup.base.dir) 317s > temp.forceup.1 <- file.path(temp.forceup.base.dir, "force1.R") 317s > temp.forceup.2 <- file.path(temp.forceup.base.dir, "force2.R") 317s > cat("force.var\n", file = temp.forceup.1) 317s > cat("4 + 1\n", file = temp.forceup.2) 317s > force.var <- 1 317s > unitizer:::capture_output({ 317s + unitize(temp.forceup.1, auto.accept = "new", state = environment()) 317s + unitize(temp.forceup.2, auto.accept = "new", state = environment()) 317s + }) 318s > force.var <- 2 318s > unitizer:::read_line_set_vals(c("2", "1", "Y", "O", "Q", "Q")) 318s > force.capt <- unitizer:::capture_output(unitize_dir(temp.forceup.base.dir, 318s + state = environment(), interactive.mode = TRUE)) 318s > unlink(temp.forceup.base.dir, recursive = TRUE) 318s > sum(grepl("Toggling force update mode ON", force.capt$message)) == 318s + 1L 318s [1] TRUE 318s > sum(grepl("You are about to .* with re-evaluated", force.capt$message)) == 318s + 1L 318s [1] TRUE 318s > 318s > # /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ 318s > # - "Compare Funs" ------------------------------------------------------------- 318s > # /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ 318s > 318s > # Bad comparison functions 318s > temp.bad.comp <- paste0(tempfile(), ".R") 318s > cat("\n unitizer_sect(\n 'bad comp', {1 + 1; 2 + 2},\n compare=function(x, y) list('failed', 'comparison')\n )\n", 318s + file = temp.bad.comp) 318s > unitizer:::capture_output(unitize(temp.bad.comp, auto.accept = "new")) 318s > unitizer:::read_line_set_vals(c("Q")) 318s > bad.comp.capt <- unitizer:::capture_output(unitize(temp.bad.comp, 318s + interactive.mode = TRUE)) 318s > unlink(temp.bad.comp) 318s > 318s > sum(grepl("Unable to compare value", bad.comp.capt$message)) == 1L 318s [1] TRUE 318s > sum(grepl("Corrupted", bad.comp.capt$output)) >= 1L 318s [1] TRUE 318s > 318s > # /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ 318s > # - "bad map" ------------------------------------------------------------------ 318s > # /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ 318s > 318s > # Bad store mapping functions 318s > 318s > try(unitize_dir(FLM.TEST.DIR, store.ids = function(x) stop("Bad store map fun"))) 318s 318s Error in FUN(X[[i]], ...) : Bad store map fun 318s Error in unitize_dir(FLM.TEST.DIR, store.ids = function(x) stop("Bad store map fun")) : 318s Argument `store.ids` is a function, but caused an error when attempting to use it to convert test file names to `unitizer` ids. 318s > 318s > unitizer:::read_line_set_vals(NULL) 318s > 318s > # /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ 318s > # - "Multiple Bookmarks" ------------------------------------------------------- 318s > # /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ 318s > 318s > # Issue 245: In review-all mode should not move to next unitizer until the 318s > # review bookmark is cleared. 318s > 318s > temp.dir <- tempfile() 318s > dir.create(temp.dir) 318s > writeLines("'hello'\n'world'", file.path(temp.dir, "a.R")) 318s > writeLines("2 + 1\n3 + 2", file.path(temp.dir, "b.R")) 318s > writeLines("pi\n2 * pi\nsqrt(pi)", file.path(temp.dir, "c.R")) 318s > unitizer:::read_line_set_vals( 318s + c("A","N","N","Y","Y","R","Y","Q","Y","R","Y","Y","Y","Y","Q") 318s + ) 318s > unitize_dir(temp.dir, interactive.mode=TRUE) 318s 318s | Summary of files in common directory '.': 318s | 318s | Pass Fail New 318s | *1. a.R - - 2 318s | *2. b.R - - 2 318s | *3. c.R - - 3 318s | ....................... 318s | - - 7 318s | Legend: 318s | * `unitizer` requires review 318s 318s | Type number of unitizer to review, 'A' to review all that require review 318s 318s unitizer> A 318s 318s +------------------------------------------------------------------------------+ 318s | unitizer for: a.R | 318s +------------------------------------------------------------------------------+ 318s 318s Pass Fail New 318s - - 2 318s ........................... 318s - - 2 318s 318s - New -------------------------------------------------------------------------- 318s 318s | The 2 tests in this section are new. Add tests to store ([Y]es, [N]o, [P]rev, 318s | [B]rowse, [R]erun, [QQ]uit All, [Q]uit, [H]elp)? 318s 318s > "hello" 318s [1] "hello" 318s 318s unitizer> N 318s 318s > "world" 318s [1] "world" 318s 318s unitizer> N 318s 318s = Finalize Unitizer ============================================================ 318s 318s | You made no changes to the unitizer so there is no need to update it. While 318s | unnecessary, you can force an update by typing O at the prompt. 318s 318s | Exit unitizer ([Y]es, [P]rev, [B]rowse, [R]erun, f[O]rce, [QQ]uit All)? 318s 318s unitizer> Y 318s 318s | unitizer unchanged. 318s 318s +------------------------------------------------------------------------------+ 318s | unitizer for: b.R | 318s +------------------------------------------------------------------------------+ 318s 318s Pass Fail New 318s - - 2 318s ........................... 318s - - 2 318s 318s - New -------------------------------------------------------------------------- 318s 318s | The 2 tests in this section are new. Add tests to store ([Y]es, [N]o, [P]rev, 318s | [B]rowse, [R]erun, [QQ]uit All, [Q]uit, [H]elp)? 318s 318s > 2 + 1 318s [1] 3 318s 318s unitizer> Y 318s 318s > 3 + 2 318s [1] 5 318s 318s unitizer> R 318s 318s | Toggling re-run mode ON for this unitizer 318s 318s = Finalize Unitizer ============================================================ 318s 318s | You have 1 unreviewed tests; press `B` to browse tests, `U` to go to first 318s | unreviewed test. 318s 318s | You will IRREVERSIBLY modify 'b.unitizer' by: 318s | - Adding 1 out of 2 new tests 318s 318s | Update unitizer and re-run unitizer ([Y]es, [N]o, [P]rev, [B]rowse, [U] 318s | nreviewed, [R]erun, [QQ]uit All)? 318s 318s unitizer> Y 318s 318s | unitizer updated. 318s 319s +------------------------------------------------------------------------------+ 319s | unitizer for: b.R | 319s +------------------------------------------------------------------------------+ 319s 319s Pass Fail New 319s 1 - 1 319s ........................... 319s 1 - 1 319s 319s - New -------------------------------------------------------------------------- 319s 319s | The following test is new. Add test to store ([Y]es, [N]o, [P]rev, [B]rowse, 319s | [R]erun, [QQ]uit All, [Q]uit, [H]elp)? 319s 319s | Jumping to test #2 because that was the test under review when test re-run was 319s | requested. 319s 319s > 3 + 2 319s [1] 5 319s 319s unitizer> Q 319s 319s | No changes recorded. 319s | unitizer unchanged. 319s 319s +------------------------------------------------------------------------------+ 319s | unitizer for: c.R | 319s +------------------------------------------------------------------------------+ 319s 319s Pass Fail New 319s - - 3 319s ........................... 319s - - 3 319s 319s - New -------------------------------------------------------------------------- 319s 319s | The 3 tests in this section are new. Add tests to store ([Y]es, [N]o, [P]rev, 319s | [B]rowse, [R]erun, [QQ]uit All, [Q]uit, [H]elp)? 319s 319s > pi 319s [1] 3.14 319s 319s unitizer> Y 319s 319s > 2 * pi 319s [1] 6.28 319s 319s unitizer> R 319s 319s | Toggling re-run mode ON for this unitizer 319s 319s = Finalize Unitizer ============================================================ 319s 319s | You have 2 unreviewed tests; press `B` to browse tests, `U` to go to first 319s | unreviewed test. 319s 319s | You will IRREVERSIBLY modify 'c.unitizer' by: 319s | - Adding 1 out of 3 new tests 319s 319s | Update unitizer and re-run unitizer ([Y]es, [N]o, [P]rev, [B]rowse, [U] 319s | nreviewed, [R]erun, [QQ]uit All)? 319s 319s unitizer> Y 319s 319s | unitizer updated. 319s 319s +------------------------------------------------------------------------------+ 319s | unitizer for: c.R | 319s +------------------------------------------------------------------------------+ 319s 319s Pass Fail New 319s 1 - 2 319s ........................... 319s 1 - 2 319s 319s - New -------------------------------------------------------------------------- 319s 319s | The 2 tests in this section are new. Add tests to store ([Y]es, [N]o, [P]rev, 319s | [B]rowse, [R]erun, [Q]uit, [H]elp)? 319s 319s | Jumping to test #2 because that was the test under review when test re-run was 319s | requested. 319s 319s > 2 * pi 319s [1] 6.28 319s 319s unitizer> Y 319s 319s > sqrt(pi) 319s [1] 1.77 319s 319s unitizer> Y 319s 319s = Finalize Unitizer ============================================================ 319s 319s | You will IRREVERSIBLY modify 'c.unitizer' by: 319s | - Adding 2 out of 2 new tests 319s 319s | Update unitizer ([Y]es, [N]o, [P]rev, [B]rowse, [R]erun)? 319s 319s unitizer> Y 319s 319s | unitizer updated. 319s 319s | Summary of files in common directory '.': 319s | 319s | Pass Fail New 319s | *1. a.R - - 2 319s | *2. b.R 1 - 1 319s | $3. c.R ? ? ? 319s | ....................... 319s | ? ? ? 319s | Legend: 319s | * `unitizer` requires review 319s | $ `unitizer` has been modified and needs to be re-run to recompute summary 319s 319s | Type number of unitizer to review, 'A' to review all that require review, 'R' 319s | to re-run all updated 319s 319s unitizer> Q 319s 319s > 319s > # Make sure re-eval all clears all bookmarks 319s > unlink( 319s + list.files(temp.dir, full.names=TRUE, pattern="\\.unitizer$"), 319s + recursive=TRUE 319s + ) 319s > unitizer:::read_line_set_vals(c("A","Q","Y","RR","Y","Q")) 319s > unitize_dir(temp.dir, interactive.mode=TRUE) 319s 319s | Summary of files in common directory '.': 319s | 319s | Pass Fail New 319s | *1. a.R - - 2 319s | *2. b.R - - 2 319s | *3. c.R - - 3 319s | ....................... 319s | - - 7 319s | Legend: 319s | * `unitizer` requires review 319s 319s | Type number of unitizer to review, 'A' to review all that require review 319s 319s unitizer> A 319s 319s +------------------------------------------------------------------------------+ 319s | unitizer for: a.R | 319s +------------------------------------------------------------------------------+ 319s 319s Pass Fail New 319s - - 2 319s ........................... 319s - - 2 319s 319s - New -------------------------------------------------------------------------- 319s 319s | The 2 tests in this section are new. Add tests to store ([Y]es, [N]o, [P]rev, 319s | [B]rowse, [R]erun, [QQ]uit All, [Q]uit, [H]elp)? 319s 319s > "hello" 319s [1] "hello" 319s 319s unitizer> Q 319s 319s | No changes recorded. 319s | unitizer unchanged. 319s 319s +------------------------------------------------------------------------------+ 319s | unitizer for: b.R | 319s +------------------------------------------------------------------------------+ 319s 319s Pass Fail New 319s - - 2 319s ........................... 319s - - 2 319s 319s - New -------------------------------------------------------------------------- 319s 319s | The 2 tests in this section are new. Add tests to store ([Y]es, [N]o, [P]rev, 319s | [B]rowse, [R]erun, [QQ]uit All, [Q]uit, [H]elp)? 319s 319s > 2 + 1 319s [1] 3 319s 319s unitizer> Y 319s 319s > 3 + 2 319s [1] 5 319s 319s unitizer> RR 319s 319s | Toggling re-run mode ON for all loaded unitizers 319s 319s = Finalize Unitizer ============================================================ 319s 319s | You have 1 unreviewed tests; press `B` to browse tests, `U` to go to first 319s | unreviewed test. 319s 319s | You will IRREVERSIBLY modify 'b.unitizer' by: 319s | - Adding 1 out of 2 new tests 319s 319s | Update unitizer and re-run all loaded unitizers ([Y]es, [N]o, [P]rev, [B] 319s | rowse, [U]nreviewed, [R]erun, [QQ]uit All)? 319s 319s unitizer> Y 319s 319s | unitizer updated. 319s 320s | Summary of files in common directory '.': 320s | 320s | Pass Fail New 320s | *1. a.R - - 2 320s | *2. b.R 1 - 1 320s | *3. c.R - - 3 320s | ....................... 320s | 1 - 6 320s | Legend: 320s | * `unitizer` requires review 320s 320s | Type number of unitizer to review, 'A' to review all that require review 320s 320s unitizer> Q 320s 320s > 320s > unitizer:::read_line_set_vals(NULL) 320s > unlink(temp.dir, recursive=TRUE) 320s > 320s > # /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ 320s > # - "Non-Standard Conditions" -------------------------------------------------- 320s > # /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ 320s > 320s > # Issue 272: some conditions don't produce any output, but for `unitizer` we 320s > # consider normally non-test expressions that produce conditions as tests. So 320s > # we need a mechanism for clarifying what happened. 320s > 320s > temp.dir <- tempfile() 320s > temp.file <- file.path(temp.dir, 'a.R') 320s > dir.create(temp.dir) 320s > 320s > unitizer:::read_line_set_vals("Q") 320s > writeLines( 320s + c( 320s + "cond <- simpleCondition('hello')", 320s + "class(cond) <- c('svgchop_unsupported', 'svgchop', class(cond))", 320s + "invisible(signalCondition(cond))" 320s + ), 320s + temp.file 320s + ) 320s > unitize(temp.file, interactive.mode=TRUE) 320s 320s +------------------------------------------------------------------------------+ 320s | unitizer for: a.R | 320s +------------------------------------------------------------------------------+ 320s 320s Pass Fail New 320s - - 1 320s ........................... 320s - - 1 320s 320s - New -------------------------------------------------------------------------- 320s 320s | The following test is new. Add test to store ([Y]es, [N]o, [P]rev, [B]rowse, 320s | [R]erun, [Q]uit, [H]elp)? 320s 320s > cond <- simpleCondition("hello") 320s > class(cond) <- c("svgchop_unsupported", "svgchop", class(cond)) 320s > invisible(signalCondition(cond)) 320s 320s | Test silently signalled conditions (use e.g. .NEW$conditions[[1]] to inspect): 320s 320s Condition list with 1 condition: 320s 1. svgchop_unsupported: hello 320s 320s unitizer> Q 320s 320s | No changes recorded. 320s | unitizer unchanged. 320s 320s > 320s > unitizer:::read_line_set_vals(NULL) 320s > unlink(temp.dir, recursive=TRUE) 320s > 320s > # /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ 320s > # - "Output Transcript in non-Interactive" ------------------------------------- 320s > # /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ 320s > 320s > # Issue 286: don't capture output in non-interactive. 320s > # We need `try` because we're testing what happens when the unitizer fails. 320s > 320s > temp.dir <- tempfile() 320s > temp.file <- file.path(temp.dir, 'a.R') 320s > dir.create(temp.dir) 320s > writeLines('warning("boom")', temp.file) # can't use error b/c try below 320s > old.opt <- options(unitizer.transcript=NULL, unitizer.show.progress=TRUE) 320s > try(unitize(temp.file)) 320s 320s Warning in check_call_stack() : 320s It appears you are running unitizer inside an error handling function such as 320s `withCallingHanlders`, `tryCatch`, or `withRestarts`. This is strongly dis- 320s couraged as it may cause unpredictable behavior from unitizer in the event tests 320s produce conditions / errors. We strongly recommend you re-run your tests 320s outside of such handling functions. 320s Preloads... 320s Loading unitizer data... 320s Parsing tests... 320s Parsing a.R 320s Evaluating tests... 320s 320s warning("boom") 320s Warning in withVisible(warning("boom")) : boom 320s 320s Prepping Unitizers... 320s Warning in history_capt(history, interactive.mode) : 320s Unable to capture history in non-interactive mode. 320s 320s +------------------------------------------------------------------------------+ 320s | unitizer for: a.R | 320s +------------------------------------------------------------------------------+ 320s 320s Pass Fail New 320s - - 1 320s ........................... 320s - - 1 320s 320s - New -------------------------------------------------------------------------- 320s 320s | The following test is new. Add test to store ([Y]es, [N]o, [P]rev, [B]rowse, 320s | [R]erun, [Q]uit, [H]elp)? 320s 320s > warning("boom") 320s 320s | Test signalled conditions (use e.g. .NEW$conditions[[1]] to inspect): 320s 320s Condition list with 1 condition: 320s 1. Warning: boom 320s 320s | User input required to proceed, but we are in non-interactive mode. 320s 320s | unitizer unchanged. 320s 320s | * New: warning("boom") 320s | in 'a.R' 320s 320s | Newly evaluated tests do not match unitizer (New: 1); see above for more info, 320s | or run in interactive mode. 320s 320s | Running in transcript mode: only stderr text that is also part of a signalled 320s | condition is in the test review section (scroll up to the evaluation section 320s | for the rest). See `transcript` parameter in `?unitize`. 320s 320s Error in unitize_core(test.file.inf, list(store.id.inf), state = state, : 320s Cannot proceed in non-interactive mode. 320s > options(old.opt) 320s > unlink(temp.dir, recursive=TRUE) 320s > 320s > # /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ 320s > # - "Display All Tests in non-Interactive" ------------------------------------- 320s > # /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ 320s > 320s > # Issue 293: don't stop after first failing test 320s > # We need `try` because we're testing what happens when the unitizer fails. 320s > 320s > temp.dir <- tempfile() 320s > temp.file.a <- file.path(temp.dir, 'a.R') 320s > temp.file.b <- file.path(temp.dir, 'b.R') 320s > dir.create(temp.dir) 320s > writeLines(c("1 + 1", "warning('hello')"), temp.file.a) 320s > writeLines(c("2 + 1", "warning('goodbye')"), temp.file.b) 320s > try(unitize_dir(temp.dir, transcript=FALSE)) 320s 320s Warning in check_call_stack() : 320s It appears you are running unitizer inside an error handling function such as 320s `withCallingHanlders`, `tryCatch`, or `withRestarts`. This is strongly dis- 320s couraged as it may cause unpredictable behavior from unitizer in the event tests 320s produce conditions / errors. We strongly recommend you re-run your tests 320s outside of such handling functions. 320s Warning in history_capt(history, interactive.mode) : 320s Unable to capture history in non-interactive mode. 320s | Summary of files in common directory '.': 320s | 320s | Pass Fail New 320s | *1. a.R - - 2 320s | *2. b.R - - 2 320s | ....................... 320s | - - 4 320s | Legend: 320s | * `unitizer` requires review 320s 320s +------------------------------------------------------------------------------+ 320s | unitizer for: a.R | 320s +------------------------------------------------------------------------------+ 320s 320s Pass Fail New 320s - - 2 320s ........................... 320s - - 2 320s 320s - New -------------------------------------------------------------------------- 320s 320s | The 2 tests in this section are new. Add tests to store ([Y]es, [N]o, [P]rev, 320s | [B]rowse, [R]erun, [QQ]uit All, [Q]uit, [H]elp)? 320s 320s > 1 + 1 320s [1] 2 320s 320s > warning("hello") 320s Warning: hello 320s 320s | User input required to proceed, but we are in non-interactive mode. 320s 320s | unitizer unchanged. 320s 320s +------------------------------------------------------------------------------+ 320s | unitizer for: b.R | 320s +------------------------------------------------------------------------------+ 320s 320s Pass Fail New 320s - - 2 320s ........................... 320s - - 2 320s 320s - New -------------------------------------------------------------------------- 320s 320s | The 2 tests in this section are new. Add tests to store ([Y]es, [N]o, [P]rev, 320s | [B]rowse, [R]erun, [QQ]uit All, [Q]uit, [H]elp)? 320s 320s > 2 + 1 320s [1] 3 320s 320s > warning("goodbye") 320s Warning: goodbye 320s 320s | User input required to proceed, but we are in non-interactive mode. 320s 320s | unitizer unchanged. 320s 320s | * New: 1 + 1 320s | * New: warning("hello") 320s | in 'a.R' 320s 320s | * New: 2 + 1 320s | * New: warning("goodbye") 320s | in 'b.R' 320s 320s | Newly evaluated tests do not match unitizer (New: 4); see above for more info, 320s | or run in interactive mode. 320s 320s Error in unitize_core(test.files = test.files, store.ids = store.ids, : 320s Cannot proceed in non-interactive mode. 320s > options(old.opt) 320s > unlink(temp.dir, recursive=TRUE) 320s > 320s > 320s PASS 320s Begin testing zz-check.R 320s 320s R version 4.3.2 (2023-10-31) -- "Eye Holes" 320s Copyright (C) 2023 The R Foundation for Statistical Computing 320s Platform: aarch64-unknown-linux-gnu (64-bit) 320s 320s R is free software and comes with ABSOLUTELY NO WARRANTY. 320s You are welcome to redistribute it under certain conditions. 320s Type 'license()' or 'licence()' for distribution details. 320s 320s R is a collaborative project with many contributors. 320s Type 'contributors()' for more information and 320s 'citation()' on how to cite R or R packages in publications. 320s 320s Type 'demo()' for some demos, 'help()' for on-line help, or 320s 'help.start()' for an HTML browser interface to help. 320s Type 'q()' to quit R. 320s 320s > source('aammrtf/check.R') 320s 43: > lorem1 <- "Today, with Kiernan on the stand offering confirmation, Howard walked the jury through the enormous amount of data pulled from Ulbricht's computer. Defense lawyers haven't had a chance yet to respond to this evidence<80><94>that will likely come tomorrow. The mountain they have to climb looks higher than ever, though. Last week, Ulbricht's lawyer outlined a defense in which Ulbricht walked away from the marketplace he created and was \"lured back.\" But what will explain the dozens of folders of data on this laptop, with data from the upper echelons of Silk Road management<80><94>mixed with the most intimate details of Ulbricht's personal life?" 320s Warning message: 320s In eval(ei, envir) : Some outputs contain non-ASCII: 320s 't-text.Rout' 320s > 320s PASS 321s autopkgtest [20:36:35]: test run-unit-test: -----------------------] 321s run-unit-test PASS 321s autopkgtest [20:36:35]: test run-unit-test: - - - - - - - - - - results - - - - - - - - - - 322s autopkgtest [20:36:36]: test pkg-r-autopkgtest: preparing testbed 323s Reading package lists... 323s Building dependency tree... 323s Reading state information... 324s Starting pkgProblemResolver with broken count: 0 324s Starting 2 pkgProblemResolver with broken count: 0 324s Done 324s The following additional packages will be installed: 324s build-essential cpp cpp-13 cpp-13-aarch64-linux-gnu cpp-aarch64-linux-gnu 324s dctrl-tools g++ g++-13 g++-13-aarch64-linux-gnu g++-aarch64-linux-gnu gcc 324s gcc-13 gcc-13-aarch64-linux-gnu gcc-aarch64-linux-gnu gfortran gfortran-13 324s gfortran-13-aarch64-linux-gnu gfortran-aarch64-linux-gnu icu-devtools 324s libasan8 libatomic1 libblas-dev libbz2-dev libc-dev-bin libc6-dev libcc1-0 324s libcrypt-dev libgcc-13-dev libgfortran-13-dev libhwasan0 libicu-dev libisl23 324s libitm1 libjpeg-dev libjpeg-turbo8-dev libjpeg8-dev liblapack-dev liblsan0 324s liblzma-dev libmpc3 libncurses-dev libnsl-dev libpcre2-16-0 libpcre2-32-0 324s libpcre2-dev libpcre2-posix3 libpkgconf3 libpng-dev libreadline-dev 324s libstdc++-13-dev libtirpc-dev libtsan2 libubsan1 linux-libc-dev pkg-config 324s pkg-r-autopkgtest pkgconf pkgconf-bin r-base-dev rpcsvc-proto zlib1g-dev 324s Suggested packages: 324s cpp-doc gcc-13-locales cpp-13-doc debtags gcc-13-doc gcc-multilib 324s manpages-dev autoconf automake libtool flex bison gdb gcc-doc 324s gdb-aarch64-linux-gnu gfortran-doc gfortran-13-doc libcoarrays-dev 324s liblapack-doc glibc-doc icu-doc liblzma-doc ncurses-doc readline-doc 324s libstdc++-13-doc texlive-base texlive-latex-base texlive-plain-generic 324s texlive-fonts-recommended texlive-fonts-extra texlive-extra-utils 324s texlive-latex-recommended texlive-latex-extra texinfo 324s Recommended packages: 324s bzip2-doc manpages manpages-dev libc-devtools libpng-tools 324s The following NEW packages will be installed: 324s autopkgtest-satdep build-essential cpp cpp-13 cpp-13-aarch64-linux-gnu 324s cpp-aarch64-linux-gnu dctrl-tools g++ g++-13 g++-13-aarch64-linux-gnu 324s g++-aarch64-linux-gnu gcc gcc-13 gcc-13-aarch64-linux-gnu 324s gcc-aarch64-linux-gnu gfortran gfortran-13 gfortran-13-aarch64-linux-gnu 324s gfortran-aarch64-linux-gnu icu-devtools libasan8 libatomic1 libblas-dev 324s libbz2-dev libc-dev-bin libc6-dev libcc1-0 libcrypt-dev libgcc-13-dev 324s libgfortran-13-dev libhwasan0 libicu-dev libisl23 libitm1 libjpeg-dev 324s libjpeg-turbo8-dev libjpeg8-dev liblapack-dev liblsan0 liblzma-dev libmpc3 324s libncurses-dev libnsl-dev libpcre2-16-0 libpcre2-32-0 libpcre2-dev 324s libpcre2-posix3 libpkgconf3 libpng-dev libreadline-dev libstdc++-13-dev 324s libtirpc-dev libtsan2 libubsan1 linux-libc-dev pkg-config pkg-r-autopkgtest 324s pkgconf pkgconf-bin r-base-dev rpcsvc-proto zlib1g-dev 324s 0 upgraded, 62 newly installed, 0 to remove and 0 not upgraded. 324s Need to get 92.9 MB/92.9 MB of archives. 324s After this operation, 343 MB of additional disk space will be used. 324s Get:1 /tmp/autopkgtest.dIKf7I/2-autopkgtest-satdep.deb autopkgtest-satdep arm64 0 [732 B] 324s Get:2 http://ftpmaster.internal/ubuntu noble/main arm64 libc-dev-bin arm64 2.39-0ubuntu2 [19.7 kB] 325s Get:3 http://ftpmaster.internal/ubuntu noble/main arm64 linux-libc-dev arm64 6.8.0-11.11 [1569 kB] 325s Get:4 http://ftpmaster.internal/ubuntu noble/main arm64 libcrypt-dev arm64 1:4.4.36-4 [136 kB] 325s Get:5 http://ftpmaster.internal/ubuntu noble/main arm64 libtirpc-dev arm64 1.3.4+ds-1build1 [232 kB] 325s Get:6 http://ftpmaster.internal/ubuntu noble/main arm64 libnsl-dev arm64 1.3.0-3 [71.9 kB] 325s Get:7 http://ftpmaster.internal/ubuntu noble/main arm64 rpcsvc-proto arm64 1.4.2-0ubuntu6 [65.4 kB] 325s Get:8 http://ftpmaster.internal/ubuntu noble/main arm64 libc6-dev arm64 2.39-0ubuntu2 [1596 kB] 325s Get:9 http://ftpmaster.internal/ubuntu noble/main arm64 libisl23 arm64 0.26-3 [713 kB] 325s Get:10 http://ftpmaster.internal/ubuntu noble/main arm64 libmpc3 arm64 1.3.1-1 [55.3 kB] 325s Get:11 http://ftpmaster.internal/ubuntu noble/main arm64 cpp-13-aarch64-linux-gnu arm64 13.2.0-17ubuntu2 [10.3 MB] 325s Get:12 http://ftpmaster.internal/ubuntu noble/main arm64 cpp-13 arm64 13.2.0-17ubuntu2 [1028 B] 325s Get:13 http://ftpmaster.internal/ubuntu noble/main arm64 cpp-aarch64-linux-gnu arm64 4:13.2.0-7ubuntu1 [5316 B] 325s Get:14 http://ftpmaster.internal/ubuntu noble/main arm64 cpp arm64 4:13.2.0-7ubuntu1 [22.4 kB] 325s Get:15 http://ftpmaster.internal/ubuntu noble/main arm64 libcc1-0 arm64 14-20240303-1ubuntu1 [44.7 kB] 325s Get:16 http://ftpmaster.internal/ubuntu noble/main arm64 libitm1 arm64 14-20240303-1ubuntu1 [27.7 kB] 325s Get:17 http://ftpmaster.internal/ubuntu noble/main arm64 libatomic1 arm64 14-20240303-1ubuntu1 [11.4 kB] 325s Get:18 http://ftpmaster.internal/ubuntu noble/main arm64 libasan8 arm64 14-20240303-1ubuntu1 [2919 kB] 325s Get:19 http://ftpmaster.internal/ubuntu noble/main arm64 liblsan0 arm64 14-20240303-1ubuntu1 [1282 kB] 325s Get:20 http://ftpmaster.internal/ubuntu noble/main arm64 libtsan2 arm64 14-20240303-1ubuntu1 [2687 kB] 325s Get:21 http://ftpmaster.internal/ubuntu noble/main arm64 libubsan1 arm64 14-20240303-1ubuntu1 [1151 kB] 325s Get:22 http://ftpmaster.internal/ubuntu noble/main arm64 libhwasan0 arm64 14-20240303-1ubuntu1 [1597 kB] 325s Get:23 http://ftpmaster.internal/ubuntu noble/main arm64 libgcc-13-dev arm64 13.2.0-17ubuntu2 [2464 kB] 326s Get:24 http://ftpmaster.internal/ubuntu noble/main arm64 gcc-13-aarch64-linux-gnu arm64 13.2.0-17ubuntu2 [20.1 MB] 326s Get:25 http://ftpmaster.internal/ubuntu noble/main arm64 gcc-13 arm64 13.2.0-17ubuntu2 [467 kB] 326s Get:26 http://ftpmaster.internal/ubuntu noble/main arm64 gcc-aarch64-linux-gnu arm64 4:13.2.0-7ubuntu1 [1198 B] 326s Get:27 http://ftpmaster.internal/ubuntu noble/main arm64 gcc arm64 4:13.2.0-7ubuntu1 [5018 B] 326s Get:28 http://ftpmaster.internal/ubuntu noble/main arm64 libstdc++-13-dev arm64 13.2.0-17ubuntu2 [2322 kB] 326s Get:29 http://ftpmaster.internal/ubuntu noble/main arm64 g++-13-aarch64-linux-gnu arm64 13.2.0-17ubuntu2 [11.7 MB] 326s Get:30 http://ftpmaster.internal/ubuntu noble/main arm64 g++-13 arm64 13.2.0-17ubuntu2 [14.4 kB] 326s Get:31 http://ftpmaster.internal/ubuntu noble/main arm64 g++-aarch64-linux-gnu arm64 4:13.2.0-7ubuntu1 [962 B] 326s Get:32 http://ftpmaster.internal/ubuntu noble/main arm64 g++ arm64 4:13.2.0-7ubuntu1 [1082 B] 326s Get:33 http://ftpmaster.internal/ubuntu noble/main arm64 build-essential arm64 12.10ubuntu1 [4932 B] 326s Get:34 http://ftpmaster.internal/ubuntu noble/main arm64 dctrl-tools arm64 2.24-3build2 [65.2 kB] 326s Get:35 http://ftpmaster.internal/ubuntu noble/main arm64 libgfortran-13-dev arm64 13.2.0-17ubuntu2 [478 kB] 326s Get:36 http://ftpmaster.internal/ubuntu noble/main arm64 gfortran-13-aarch64-linux-gnu arm64 13.2.0-17ubuntu2 [10.8 MB] 327s Get:37 http://ftpmaster.internal/ubuntu noble/main arm64 gfortran-13 arm64 13.2.0-17ubuntu2 [10.3 kB] 327s Get:38 http://ftpmaster.internal/ubuntu noble/main arm64 gfortran-aarch64-linux-gnu arm64 4:13.2.0-7ubuntu1 [1022 B] 327s Get:39 http://ftpmaster.internal/ubuntu noble/main arm64 gfortran arm64 4:13.2.0-7ubuntu1 [1164 B] 327s Get:40 http://ftpmaster.internal/ubuntu noble/main arm64 icu-devtools arm64 74.2-1ubuntu1 [209 kB] 327s Get:41 http://ftpmaster.internal/ubuntu noble/main arm64 libblas-dev arm64 3.12.0-3 [111 kB] 327s Get:42 http://ftpmaster.internal/ubuntu noble/main arm64 libbz2-dev arm64 1.0.8-5ubuntu1 [35.8 kB] 327s Get:43 http://ftpmaster.internal/ubuntu noble/main arm64 libicu-dev arm64 74.2-1ubuntu1 [11.9 MB] 327s Get:44 http://ftpmaster.internal/ubuntu noble/main arm64 libjpeg-turbo8-dev arm64 2.1.5-2ubuntu1 [304 kB] 327s Get:45 http://ftpmaster.internal/ubuntu noble/main arm64 libjpeg8-dev arm64 8c-2ubuntu11 [1484 B] 327s Get:46 http://ftpmaster.internal/ubuntu noble/main arm64 libjpeg-dev arm64 8c-2ubuntu11 [1482 B] 327s Get:47 http://ftpmaster.internal/ubuntu noble/main arm64 liblapack-dev arm64 3.12.0-3 [4293 kB] 327s Get:48 http://ftpmaster.internal/ubuntu noble/main arm64 libncurses-dev arm64 6.4+20240113-1ubuntu1 [385 kB] 327s Get:49 http://ftpmaster.internal/ubuntu noble/main arm64 libpcre2-16-0 arm64 10.42-4ubuntu1 [195 kB] 327s Get:50 http://ftpmaster.internal/ubuntu noble/main arm64 libpcre2-32-0 arm64 10.42-4ubuntu1 [183 kB] 327s Get:51 http://ftpmaster.internal/ubuntu noble/main arm64 libpcre2-posix3 arm64 10.42-4ubuntu1 [6654 B] 327s Get:52 http://ftpmaster.internal/ubuntu noble/main arm64 libpcre2-dev arm64 10.42-4ubuntu1 [679 kB] 327s Get:53 http://ftpmaster.internal/ubuntu noble/main arm64 libpkgconf3 arm64 1.8.1-2 [31.2 kB] 327s Get:54 http://ftpmaster.internal/ubuntu noble/main arm64 zlib1g-dev arm64 1:1.3.dfsg-3ubuntu1 [895 kB] 327s Get:55 http://ftpmaster.internal/ubuntu noble/main arm64 libpng-dev arm64 1.6.43-1 [266 kB] 327s Get:56 http://ftpmaster.internal/ubuntu noble/main arm64 libreadline-dev arm64 8.2-3 [177 kB] 327s Get:57 http://ftpmaster.internal/ubuntu noble/main arm64 pkgconf-bin arm64 1.8.1-2 [20.4 kB] 327s Get:58 http://ftpmaster.internal/ubuntu noble/main arm64 pkgconf arm64 1.8.1-2 [16.7 kB] 327s Get:59 http://ftpmaster.internal/ubuntu noble/main arm64 pkg-config arm64 1.8.1-2 [7170 B] 327s Get:60 http://ftpmaster.internal/ubuntu noble/main arm64 liblzma-dev arm64 5.4.5-0.3 [209 kB] 327s Get:61 http://ftpmaster.internal/ubuntu noble/universe arm64 r-base-dev all 4.3.2-1build1 [4336 B] 327s Get:62 http://ftpmaster.internal/ubuntu noble/universe arm64 pkg-r-autopkgtest all 20231212ubuntu1 [6448 B] 328s Fetched 92.9 MB in 3s (33.1 MB/s) 328s Selecting previously unselected package libc-dev-bin. 328s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 88173 files and directories currently installed.) 328s Preparing to unpack .../00-libc-dev-bin_2.39-0ubuntu2_arm64.deb ... 328s Unpacking libc-dev-bin (2.39-0ubuntu2) ... 328s Selecting previously unselected package linux-libc-dev:arm64. 328s Preparing to unpack .../01-linux-libc-dev_6.8.0-11.11_arm64.deb ... 328s Unpacking linux-libc-dev:arm64 (6.8.0-11.11) ... 328s Selecting previously unselected package libcrypt-dev:arm64. 328s Preparing to unpack .../02-libcrypt-dev_1%3a4.4.36-4_arm64.deb ... 328s Unpacking libcrypt-dev:arm64 (1:4.4.36-4) ... 328s Selecting previously unselected package libtirpc-dev:arm64. 328s Preparing to unpack .../03-libtirpc-dev_1.3.4+ds-1build1_arm64.deb ... 328s Unpacking libtirpc-dev:arm64 (1.3.4+ds-1build1) ... 328s Selecting previously unselected package libnsl-dev:arm64. 328s Preparing to unpack .../04-libnsl-dev_1.3.0-3_arm64.deb ... 328s Unpacking libnsl-dev:arm64 (1.3.0-3) ... 328s Selecting previously unselected package rpcsvc-proto. 328s Preparing to unpack .../05-rpcsvc-proto_1.4.2-0ubuntu6_arm64.deb ... 328s Unpacking rpcsvc-proto (1.4.2-0ubuntu6) ... 328s Selecting previously unselected package libc6-dev:arm64. 328s Preparing to unpack .../06-libc6-dev_2.39-0ubuntu2_arm64.deb ... 328s Unpacking libc6-dev:arm64 (2.39-0ubuntu2) ... 328s Selecting previously unselected package libisl23:arm64. 328s Preparing to unpack .../07-libisl23_0.26-3_arm64.deb ... 328s Unpacking libisl23:arm64 (0.26-3) ... 328s Selecting previously unselected package libmpc3:arm64. 328s Preparing to unpack .../08-libmpc3_1.3.1-1_arm64.deb ... 328s Unpacking libmpc3:arm64 (1.3.1-1) ... 328s Selecting previously unselected package cpp-13-aarch64-linux-gnu. 328s Preparing to unpack .../09-cpp-13-aarch64-linux-gnu_13.2.0-17ubuntu2_arm64.deb ... 328s Unpacking cpp-13-aarch64-linux-gnu (13.2.0-17ubuntu2) ... 329s Selecting previously unselected package cpp-13. 329s Preparing to unpack .../10-cpp-13_13.2.0-17ubuntu2_arm64.deb ... 329s Unpacking cpp-13 (13.2.0-17ubuntu2) ... 329s Selecting previously unselected package cpp-aarch64-linux-gnu. 329s Preparing to unpack .../11-cpp-aarch64-linux-gnu_4%3a13.2.0-7ubuntu1_arm64.deb ... 329s Unpacking cpp-aarch64-linux-gnu (4:13.2.0-7ubuntu1) ... 329s Selecting previously unselected package cpp. 329s Preparing to unpack .../12-cpp_4%3a13.2.0-7ubuntu1_arm64.deb ... 329s Unpacking cpp (4:13.2.0-7ubuntu1) ... 329s Selecting previously unselected package libcc1-0:arm64. 329s Preparing to unpack .../13-libcc1-0_14-20240303-1ubuntu1_arm64.deb ... 329s Unpacking libcc1-0:arm64 (14-20240303-1ubuntu1) ... 329s Selecting previously unselected package libitm1:arm64. 329s Preparing to unpack .../14-libitm1_14-20240303-1ubuntu1_arm64.deb ... 329s Unpacking libitm1:arm64 (14-20240303-1ubuntu1) ... 329s Selecting previously unselected package libatomic1:arm64. 329s Preparing to unpack .../15-libatomic1_14-20240303-1ubuntu1_arm64.deb ... 329s Unpacking libatomic1:arm64 (14-20240303-1ubuntu1) ... 329s Selecting previously unselected package libasan8:arm64. 329s Preparing to unpack .../16-libasan8_14-20240303-1ubuntu1_arm64.deb ... 329s Unpacking libasan8:arm64 (14-20240303-1ubuntu1) ... 329s Selecting previously unselected package liblsan0:arm64. 329s Preparing to unpack .../17-liblsan0_14-20240303-1ubuntu1_arm64.deb ... 329s Unpacking liblsan0:arm64 (14-20240303-1ubuntu1) ... 329s Selecting previously unselected package libtsan2:arm64. 329s Preparing to unpack .../18-libtsan2_14-20240303-1ubuntu1_arm64.deb ... 329s Unpacking libtsan2:arm64 (14-20240303-1ubuntu1) ... 329s Selecting previously unselected package libubsan1:arm64. 329s Preparing to unpack .../19-libubsan1_14-20240303-1ubuntu1_arm64.deb ... 329s Unpacking libubsan1:arm64 (14-20240303-1ubuntu1) ... 329s Selecting previously unselected package libhwasan0:arm64. 329s Preparing to unpack .../20-libhwasan0_14-20240303-1ubuntu1_arm64.deb ... 329s Unpacking libhwasan0:arm64 (14-20240303-1ubuntu1) ... 329s Selecting previously unselected package libgcc-13-dev:arm64. 329s Preparing to unpack .../21-libgcc-13-dev_13.2.0-17ubuntu2_arm64.deb ... 329s Unpacking libgcc-13-dev:arm64 (13.2.0-17ubuntu2) ... 329s Selecting previously unselected package gcc-13-aarch64-linux-gnu. 329s Preparing to unpack .../22-gcc-13-aarch64-linux-gnu_13.2.0-17ubuntu2_arm64.deb ... 329s Unpacking gcc-13-aarch64-linux-gnu (13.2.0-17ubuntu2) ... 330s Selecting previously unselected package gcc-13. 330s Preparing to unpack .../23-gcc-13_13.2.0-17ubuntu2_arm64.deb ... 330s Unpacking gcc-13 (13.2.0-17ubuntu2) ... 330s Selecting previously unselected package gcc-aarch64-linux-gnu. 330s Preparing to unpack .../24-gcc-aarch64-linux-gnu_4%3a13.2.0-7ubuntu1_arm64.deb ... 330s Unpacking gcc-aarch64-linux-gnu (4:13.2.0-7ubuntu1) ... 330s Selecting previously unselected package gcc. 330s Preparing to unpack .../25-gcc_4%3a13.2.0-7ubuntu1_arm64.deb ... 330s Unpacking gcc (4:13.2.0-7ubuntu1) ... 330s Selecting previously unselected package libstdc++-13-dev:arm64. 330s Preparing to unpack .../26-libstdc++-13-dev_13.2.0-17ubuntu2_arm64.deb ... 330s Unpacking libstdc++-13-dev:arm64 (13.2.0-17ubuntu2) ... 330s Selecting previously unselected package g++-13-aarch64-linux-gnu. 330s Preparing to unpack .../27-g++-13-aarch64-linux-gnu_13.2.0-17ubuntu2_arm64.deb ... 330s Unpacking g++-13-aarch64-linux-gnu (13.2.0-17ubuntu2) ... 330s Selecting previously unselected package g++-13. 330s Preparing to unpack .../28-g++-13_13.2.0-17ubuntu2_arm64.deb ... 330s Unpacking g++-13 (13.2.0-17ubuntu2) ... 330s Selecting previously unselected package g++-aarch64-linux-gnu. 330s Preparing to unpack .../29-g++-aarch64-linux-gnu_4%3a13.2.0-7ubuntu1_arm64.deb ... 330s Unpacking g++-aarch64-linux-gnu (4:13.2.0-7ubuntu1) ... 330s Selecting previously unselected package g++. 330s Preparing to unpack .../30-g++_4%3a13.2.0-7ubuntu1_arm64.deb ... 330s Unpacking g++ (4:13.2.0-7ubuntu1) ... 330s Selecting previously unselected package build-essential. 330s Preparing to unpack .../31-build-essential_12.10ubuntu1_arm64.deb ... 330s Unpacking build-essential (12.10ubuntu1) ... 330s Selecting previously unselected package dctrl-tools. 330s Preparing to unpack .../32-dctrl-tools_2.24-3build2_arm64.deb ... 330s Unpacking dctrl-tools (2.24-3build2) ... 330s Selecting previously unselected package libgfortran-13-dev:arm64. 330s Preparing to unpack .../33-libgfortran-13-dev_13.2.0-17ubuntu2_arm64.deb ... 330s Unpacking libgfortran-13-dev:arm64 (13.2.0-17ubuntu2) ... 330s Selecting previously unselected package gfortran-13-aarch64-linux-gnu. 330s Preparing to unpack .../34-gfortran-13-aarch64-linux-gnu_13.2.0-17ubuntu2_arm64.deb ... 330s Unpacking gfortran-13-aarch64-linux-gnu (13.2.0-17ubuntu2) ... 331s Selecting previously unselected package gfortran-13. 331s Preparing to unpack .../35-gfortran-13_13.2.0-17ubuntu2_arm64.deb ... 331s Unpacking gfortran-13 (13.2.0-17ubuntu2) ... 331s Selecting previously unselected package gfortran-aarch64-linux-gnu. 331s Preparing to unpack .../36-gfortran-aarch64-linux-gnu_4%3a13.2.0-7ubuntu1_arm64.deb ... 331s Unpacking gfortran-aarch64-linux-gnu (4:13.2.0-7ubuntu1) ... 331s Selecting previously unselected package gfortran. 331s Preparing to unpack .../37-gfortran_4%3a13.2.0-7ubuntu1_arm64.deb ... 331s Unpacking gfortran (4:13.2.0-7ubuntu1) ... 331s Selecting previously unselected package icu-devtools. 331s Preparing to unpack .../38-icu-devtools_74.2-1ubuntu1_arm64.deb ... 331s Unpacking icu-devtools (74.2-1ubuntu1) ... 331s Selecting previously unselected package libblas-dev:arm64. 331s Preparing to unpack .../39-libblas-dev_3.12.0-3_arm64.deb ... 331s Unpacking libblas-dev:arm64 (3.12.0-3) ... 331s Selecting previously unselected package libbz2-dev:arm64. 331s Preparing to unpack .../40-libbz2-dev_1.0.8-5ubuntu1_arm64.deb ... 331s Unpacking libbz2-dev:arm64 (1.0.8-5ubuntu1) ... 331s Selecting previously unselected package libicu-dev:arm64. 331s Preparing to unpack .../41-libicu-dev_74.2-1ubuntu1_arm64.deb ... 331s Unpacking libicu-dev:arm64 (74.2-1ubuntu1) ... 331s Selecting previously unselected package libjpeg-turbo8-dev:arm64. 331s Preparing to unpack .../42-libjpeg-turbo8-dev_2.1.5-2ubuntu1_arm64.deb ... 331s Unpacking libjpeg-turbo8-dev:arm64 (2.1.5-2ubuntu1) ... 331s Selecting previously unselected package libjpeg8-dev:arm64. 331s Preparing to unpack .../43-libjpeg8-dev_8c-2ubuntu11_arm64.deb ... 331s Unpacking libjpeg8-dev:arm64 (8c-2ubuntu11) ... 331s Selecting previously unselected package libjpeg-dev:arm64. 331s Preparing to unpack .../44-libjpeg-dev_8c-2ubuntu11_arm64.deb ... 331s Unpacking libjpeg-dev:arm64 (8c-2ubuntu11) ... 331s Selecting previously unselected package liblapack-dev:arm64. 331s Preparing to unpack .../45-liblapack-dev_3.12.0-3_arm64.deb ... 331s Unpacking liblapack-dev:arm64 (3.12.0-3) ... 331s Selecting previously unselected package libncurses-dev:arm64. 331s Preparing to unpack .../46-libncurses-dev_6.4+20240113-1ubuntu1_arm64.deb ... 331s Unpacking libncurses-dev:arm64 (6.4+20240113-1ubuntu1) ... 331s Selecting previously unselected package libpcre2-16-0:arm64. 331s Preparing to unpack .../47-libpcre2-16-0_10.42-4ubuntu1_arm64.deb ... 331s Unpacking libpcre2-16-0:arm64 (10.42-4ubuntu1) ... 331s Selecting previously unselected package libpcre2-32-0:arm64. 332s Preparing to unpack .../48-libpcre2-32-0_10.42-4ubuntu1_arm64.deb ... 332s Unpacking libpcre2-32-0:arm64 (10.42-4ubuntu1) ... 332s Selecting previously unselected package libpcre2-posix3:arm64. 332s Preparing to unpack .../49-libpcre2-posix3_10.42-4ubuntu1_arm64.deb ... 332s Unpacking libpcre2-posix3:arm64 (10.42-4ubuntu1) ... 332s Selecting previously unselected package libpcre2-dev:arm64. 332s Preparing to unpack .../50-libpcre2-dev_10.42-4ubuntu1_arm64.deb ... 332s Unpacking libpcre2-dev:arm64 (10.42-4ubuntu1) ... 332s Selecting previously unselected package libpkgconf3:arm64. 332s Preparing to unpack .../51-libpkgconf3_1.8.1-2_arm64.deb ... 332s Unpacking libpkgconf3:arm64 (1.8.1-2) ... 332s Selecting previously unselected package zlib1g-dev:arm64. 332s Preparing to unpack .../52-zlib1g-dev_1%3a1.3.dfsg-3ubuntu1_arm64.deb ... 332s Unpacking zlib1g-dev:arm64 (1:1.3.dfsg-3ubuntu1) ... 332s Selecting previously unselected package libpng-dev:arm64. 332s Preparing to unpack .../53-libpng-dev_1.6.43-1_arm64.deb ... 332s Unpacking libpng-dev:arm64 (1.6.43-1) ... 332s Selecting previously unselected package libreadline-dev:arm64. 332s Preparing to unpack .../54-libreadline-dev_8.2-3_arm64.deb ... 332s Unpacking libreadline-dev:arm64 (8.2-3) ... 332s Selecting previously unselected package pkgconf-bin. 332s Preparing to unpack .../55-pkgconf-bin_1.8.1-2_arm64.deb ... 332s Unpacking pkgconf-bin (1.8.1-2) ... 332s Selecting previously unselected package pkgconf:arm64. 332s Preparing to unpack .../56-pkgconf_1.8.1-2_arm64.deb ... 332s Unpacking pkgconf:arm64 (1.8.1-2) ... 332s Selecting previously unselected package pkg-config:arm64. 332s Preparing to unpack .../57-pkg-config_1.8.1-2_arm64.deb ... 332s Unpacking pkg-config:arm64 (1.8.1-2) ... 332s Selecting previously unselected package liblzma-dev:arm64. 332s Preparing to unpack .../58-liblzma-dev_5.4.5-0.3_arm64.deb ... 332s Unpacking liblzma-dev:arm64 (5.4.5-0.3) ... 332s Selecting previously unselected package r-base-dev. 332s Preparing to unpack .../59-r-base-dev_4.3.2-1build1_all.deb ... 332s Unpacking r-base-dev (4.3.2-1build1) ... 332s Selecting previously unselected package pkg-r-autopkgtest. 332s Preparing to unpack .../60-pkg-r-autopkgtest_20231212ubuntu1_all.deb ... 332s Unpacking pkg-r-autopkgtest (20231212ubuntu1) ... 332s Selecting previously unselected package autopkgtest-satdep. 332s Preparing to unpack .../61-2-autopkgtest-satdep.deb ... 332s Unpacking autopkgtest-satdep (0) ... 332s Setting up linux-libc-dev:arm64 (6.8.0-11.11) ... 332s Setting up libpcre2-16-0:arm64 (10.42-4ubuntu1) ... 332s Setting up libpcre2-32-0:arm64 (10.42-4ubuntu1) ... 332s Setting up libtirpc-dev:arm64 (1.3.4+ds-1build1) ... 332s Setting up libpkgconf3:arm64 (1.8.1-2) ... 332s Setting up rpcsvc-proto (1.4.2-0ubuntu6) ... 332s Setting up libmpc3:arm64 (1.3.1-1) ... 332s Setting up libatomic1:arm64 (14-20240303-1ubuntu1) ... 332s Setting up icu-devtools (74.2-1ubuntu1) ... 332s Setting up pkgconf-bin (1.8.1-2) ... 332s Setting up liblzma-dev:arm64 (5.4.5-0.3) ... 332s Setting up libubsan1:arm64 (14-20240303-1ubuntu1) ... 332s Setting up libpcre2-posix3:arm64 (10.42-4ubuntu1) ... 332s Setting up libnsl-dev:arm64 (1.3.0-3) ... 332s Setting up libhwasan0:arm64 (14-20240303-1ubuntu1) ... 332s Setting up libcrypt-dev:arm64 (1:4.4.36-4) ... 332s Setting up libasan8:arm64 (14-20240303-1ubuntu1) ... 332s Setting up libtsan2:arm64 (14-20240303-1ubuntu1) ... 332s Setting up libisl23:arm64 (0.26-3) ... 332s Setting up libc-dev-bin (2.39-0ubuntu2) ... 332s Setting up libcc1-0:arm64 (14-20240303-1ubuntu1) ... 332s Setting up liblsan0:arm64 (14-20240303-1ubuntu1) ... 332s Setting up libblas-dev:arm64 (3.12.0-3) ... 332s update-alternatives: using /usr/lib/aarch64-linux-gnu/blas/libblas.so to provide /usr/lib/aarch64-linux-gnu/libblas.so (libblas.so-aarch64-linux-gnu) in auto mode 332s Setting up dctrl-tools (2.24-3build2) ... 332s Setting up libitm1:arm64 (14-20240303-1ubuntu1) ... 332s Setting up cpp-13-aarch64-linux-gnu (13.2.0-17ubuntu2) ... 332s Setting up pkgconf:arm64 (1.8.1-2) ... 332s Setting up cpp-aarch64-linux-gnu (4:13.2.0-7ubuntu1) ... 332s Setting up liblapack-dev:arm64 (3.12.0-3) ... 332s update-alternatives: using /usr/lib/aarch64-linux-gnu/lapack/liblapack.so to provide /usr/lib/aarch64-linux-gnu/liblapack.so (liblapack.so-aarch64-linux-gnu) in auto mode 332s Setting up pkg-config:arm64 (1.8.1-2) ... 332s Setting up libgcc-13-dev:arm64 (13.2.0-17ubuntu2) ... 332s Setting up libc6-dev:arm64 (2.39-0ubuntu2) ... 332s Setting up libgfortran-13-dev:arm64 (13.2.0-17ubuntu2) ... 332s Setting up libicu-dev:arm64 (74.2-1ubuntu1) ... 332s Setting up libstdc++-13-dev:arm64 (13.2.0-17ubuntu2) ... 332s Setting up libbz2-dev:arm64 (1.0.8-5ubuntu1) ... 332s Setting up libjpeg-turbo8-dev:arm64 (2.1.5-2ubuntu1) ... 332s Setting up libncurses-dev:arm64 (6.4+20240113-1ubuntu1) ... 332s Setting up libpcre2-dev:arm64 (10.42-4ubuntu1) ... 332s Setting up cpp-13 (13.2.0-17ubuntu2) ... 332s Setting up gcc-13-aarch64-linux-gnu (13.2.0-17ubuntu2) ... 332s Setting up libreadline-dev:arm64 (8.2-3) ... 332s Setting up gcc-13 (13.2.0-17ubuntu2) ... 332s Setting up zlib1g-dev:arm64 (1:1.3.dfsg-3ubuntu1) ... 332s Setting up cpp (4:13.2.0-7ubuntu1) ... 332s Setting up libjpeg8-dev:arm64 (8c-2ubuntu11) ... 332s Setting up g++-13-aarch64-linux-gnu (13.2.0-17ubuntu2) ... 332s Setting up gcc-aarch64-linux-gnu (4:13.2.0-7ubuntu1) ... 332s Setting up g++-13 (13.2.0-17ubuntu2) ... 332s Setting up libpng-dev:arm64 (1.6.43-1) ... 332s Setting up libjpeg-dev:arm64 (8c-2ubuntu11) ... 332s Setting up gfortran-13-aarch64-linux-gnu (13.2.0-17ubuntu2) ... 332s Setting up gcc (4:13.2.0-7ubuntu1) ... 332s Setting up gfortran-13 (13.2.0-17ubuntu2) ... 332s Setting up g++-aarch64-linux-gnu (4:13.2.0-7ubuntu1) ... 332s Setting up gfortran-aarch64-linux-gnu (4:13.2.0-7ubuntu1) ... 332s Setting up gfortran (4:13.2.0-7ubuntu1) ... 332s update-alternatives: using /usr/bin/gfortran to provide /usr/bin/f95 (f95) in auto mode 332s update-alternatives: warning: skip creation of /usr/share/man/man1/f95.1.gz because associated file /usr/share/man/man1/gfortran.1.gz (of link group f95) doesn't exist 332s update-alternatives: using /usr/bin/gfortran to provide /usr/bin/f77 (f77) in auto mode 332s update-alternatives: warning: skip creation of /usr/share/man/man1/f77.1.gz because associated file /usr/share/man/man1/gfortran.1.gz (of link group f77) doesn't exist 332s Setting up g++ (4:13.2.0-7ubuntu1) ... 332s update-alternatives: using /usr/bin/g++ to provide /usr/bin/c++ (c++) in auto mode 332s Setting up build-essential (12.10ubuntu1) ... 332s Setting up r-base-dev (4.3.2-1build1) ... 332s Setting up pkg-r-autopkgtest (20231212ubuntu1) ... 332s Setting up autopkgtest-satdep (0) ... 332s Processing triggers for man-db (2.12.0-3) ... 333s Processing triggers for install-info (7.1-3) ... 333s Processing triggers for libc-bin (2.39-0ubuntu2) ... 336s (Reading database ... 91732 files and directories currently installed.) 336s Removing autopkgtest-satdep (0) ... 336s autopkgtest [20:36:50]: test pkg-r-autopkgtest: /usr/share/dh-r/pkg-r-autopkgtest 336s autopkgtest [20:36:50]: test pkg-r-autopkgtest: [----------------------- 336s Test: Try to load the R library unitizer 337s 337s R version 4.3.2 (2023-10-31) -- "Eye Holes" 337s Copyright (C) 2023 The R Foundation for Statistical Computing 337s Platform: aarch64-unknown-linux-gnu (64-bit) 337s 337s R is free software and comes with ABSOLUTELY NO WARRANTY. 337s You are welcome to redistribute it under certain conditions. 337s Type 'license()' or 'licence()' for distribution details. 337s 337s R is a collaborative project with many contributors. 337s Type 'contributors()' for more information and 337s 'citation()' on how to cite R or R packages in publications. 337s 337s Type 'demo()' for some demos, 'help()' for on-line help, or 337s 'help.start()' for an HTML browser interface to help. 337s Type 'q()' to quit R. 337s 337s > library('unitizer') 337s State tracking is disabled by default to comply with CRAN policies. Add `options(unitizer.state='suggested')` to your 'Rprofile' file to enable, or `options(unitizer.state='off')` to quash this message without enabling. Prior to enabling, be sure to read `?unitizerState`,in particular the 'CRAN non-compliance' section. 337s > 337s > 337s Other tests are currently unsupported! 337s They will be progressively added. 337s autopkgtest [20:36:51]: test pkg-r-autopkgtest: -----------------------] 338s autopkgtest [20:36:52]: test pkg-r-autopkgtest: - - - - - - - - - - results - - - - - - - - - - 338s pkg-r-autopkgtest PASS 338s autopkgtest [20:36:52]: @@@@@@@@@@@@@@@@@@@@ summary 338s run-unit-test PASS 338s pkg-r-autopkgtest PASS 349s Creating nova instance adt-noble-arm64-r-cran-unitizer-20240316-203114-juju-7f2275-prod-proposed-migration-environment-3 from image adt/ubuntu-noble-arm64-server-20240314.img (UUID 7faf5f09-d335-4346-a441-4eab2f9c04fe)...