0s autopkgtest [02:24:06]: starting date and time: 2024-03-24 02:24:06+0000 0s autopkgtest [02:24:06]: git checkout: 4a1cd702 l/adt_testbed: don't blame the testbed for unsolvable build deps 0s autopkgtest [02:24:06]: host juju-7f2275-prod-proposed-migration-environment-3; command line: /home/ubuntu/autopkgtest/runner/autopkgtest --output-dir /tmp/autopkgtest-work.glsriwdd/out --timeout-copy=6000 -a i386 --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 --apt-upgrade r-cran-unitizer --timeout-short=300 --timeout-copy=20000 --timeout-build=20000 --env=ADT_TEST_TRIGGERS=r-base/4.3.3-2build1 -- ssh -s /home/ubuntu/autopkgtest/ssh-setup/nova -- --flavor autopkgtest --security-groups autopkgtest-juju-7f2275-prod-proposed-migration-environment-3@lcy02-13.secgroup --name adt-noble-i386-r-cran-unitizer-20240324-022406-juju-7f2275-prod-proposed-migration-environment-3 --image adt/ubuntu-noble-amd64-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/ 879s autopkgtest [02:38:45]: testbed dpkg architecture: amd64 879s autopkgtest [02:38:45]: testbed apt version: 2.7.12 879s autopkgtest [02:38:45]: test architecture: i386 879s autopkgtest [02:38:45]: @@@@@@@@@@@@@@@@@@@@ test bed setup 879s Get:1 http://ftpmaster.internal/ubuntu noble-proposed InRelease [117 kB] 880s Get:2 http://ftpmaster.internal/ubuntu noble-proposed/multiverse Sources [56.9 kB] 880s Get:3 http://ftpmaster.internal/ubuntu noble-proposed/restricted Sources [6540 B] 880s Get:4 http://ftpmaster.internal/ubuntu noble-proposed/universe Sources [4043 kB] 880s Get:5 http://ftpmaster.internal/ubuntu noble-proposed/main Sources [494 kB] 880s Get:6 http://ftpmaster.internal/ubuntu noble-proposed/main i386 Packages [483 kB] 880s Get:7 http://ftpmaster.internal/ubuntu noble-proposed/main amd64 Packages [725 kB] 880s Get:8 http://ftpmaster.internal/ubuntu noble-proposed/main amd64 c-n-f Metadata [3508 B] 880s Get:9 http://ftpmaster.internal/ubuntu noble-proposed/restricted amd64 Packages [30.5 kB] 880s Get:10 http://ftpmaster.internal/ubuntu noble-proposed/restricted i386 Packages [6700 B] 880s Get:11 http://ftpmaster.internal/ubuntu noble-proposed/restricted amd64 c-n-f Metadata [116 B] 880s Get:12 http://ftpmaster.internal/ubuntu noble-proposed/universe i386 Packages [1304 kB] 880s Get:13 http://ftpmaster.internal/ubuntu noble-proposed/universe amd64 Packages [4453 kB] 880s Get:14 http://ftpmaster.internal/ubuntu noble-proposed/universe amd64 c-n-f Metadata [9396 B] 880s Get:15 http://ftpmaster.internal/ubuntu noble-proposed/multiverse amd64 Packages [96.1 kB] 880s Get:16 http://ftpmaster.internal/ubuntu noble-proposed/multiverse i386 Packages [27.1 kB] 880s Get:17 http://ftpmaster.internal/ubuntu noble-proposed/multiverse amd64 c-n-f Metadata [196 B] 883s Fetched 11.9 MB in 2s (7824 kB/s) 883s Reading package lists... 885s Reading package lists... 885s Building dependency tree... 885s Reading state information... 886s Calculating upgrade... 886s The following packages will be upgraded: 886s libc-bin libc6 locales 886s 3 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 886s Need to get 8176 kB of archives. 886s After this operation, 2048 B of additional disk space will be used. 886s Get:1 http://ftpmaster.internal/ubuntu noble/main amd64 libc6 amd64 2.39-0ubuntu6 [3262 kB] 886s Get:2 http://ftpmaster.internal/ubuntu noble/main amd64 libc-bin amd64 2.39-0ubuntu6 [682 kB] 886s Get:3 http://ftpmaster.internal/ubuntu noble/main amd64 locales all 2.39-0ubuntu6 [4232 kB] 886s Preconfiguring packages ... 886s Fetched 8176 kB in 0s (72.8 MB/s) 887s (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 ... 71864 files and directories currently installed.) 887s Preparing to unpack .../libc6_2.39-0ubuntu6_amd64.deb ... 887s Unpacking libc6:amd64 (2.39-0ubuntu6) over (2.39-0ubuntu2) ... 887s Setting up libc6:amd64 (2.39-0ubuntu6) ... 887s (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 ... 71864 files and directories currently installed.) 887s Preparing to unpack .../libc-bin_2.39-0ubuntu6_amd64.deb ... 887s Unpacking libc-bin (2.39-0ubuntu6) over (2.39-0ubuntu2) ... 887s Setting up libc-bin (2.39-0ubuntu6) ... 888s (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 ... 71864 files and directories currently installed.) 888s Preparing to unpack .../locales_2.39-0ubuntu6_all.deb ... 888s Unpacking locales (2.39-0ubuntu6) over (2.39-0ubuntu2) ... 888s Setting up locales (2.39-0ubuntu6) ... 888s Generating locales (this might take a while)... 890s en_US.UTF-8... done 890s Generation complete. 890s Processing triggers for man-db (2.12.0-3) ... 891s Reading package lists... 891s Building dependency tree... 891s Reading state information... 892s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 892s sh: Attempting to set up Debian/Ubuntu apt sources automatically 892s sh: Distribution appears to be Ubuntu 893s Reading package lists... 893s Building dependency tree... 893s Reading state information... 893s eatmydata is already the newest version (131-1). 893s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 894s Reading package lists... 894s Building dependency tree... 894s Reading state information... 894s dbus is already the newest version (1.14.10-4ubuntu1). 894s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 894s Reading package lists... 894s Building dependency tree... 894s Reading state information... 895s rng-tools-debian is already the newest version (2.4). 895s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 895s Reading package lists... 895s Building dependency tree... 895s Reading state information... 895s The following packages will be REMOVED: 895s cloud-init* python3-configobj* python3-debconf* 896s 0 upgraded, 0 newly installed, 3 to remove and 0 not upgraded. 896s After this operation, 3256 kB disk space will be freed. 896s (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 ... 71864 files and directories currently installed.) 896s Removing cloud-init (24.1.2-0ubuntu1) ... 896s Removing python3-configobj (5.0.8-3) ... 896s Removing python3-debconf (1.5.86) ... 896s Processing triggers for man-db (2.12.0-3) ... 897s (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 ... 71475 files and directories currently installed.) 897s Purging configuration files for cloud-init (24.1.2-0ubuntu1) ... 897s dpkg: warning: while removing cloud-init, directory '/etc/cloud/cloud.cfg.d' not empty so not removed 897s Processing triggers for rsyslog (8.2312.0-3ubuntu3) ... 897s invoke-rc.d: policy-rc.d denied execution of try-restart. 897s Reading package lists... 898s Building dependency tree... 898s Reading state information... 898s linux-generic is already the newest version (6.8.0-11.11+1). 898s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 898s Hit:1 http://ftpmaster.internal/ubuntu noble InRelease 898s Hit:2 http://ftpmaster.internal/ubuntu noble-updates InRelease 898s Hit:3 http://ftpmaster.internal/ubuntu noble-security InRelease 900s Reading package lists... 900s Reading package lists... 901s Building dependency tree... 901s Reading state information... 901s Calculating upgrade... 901s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 901s Reading package lists... 901s Building dependency tree... 901s Reading state information... 901s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 901s autopkgtest [02:39:07]: rebooting testbed after setup commands that affected boot 1049s autopkgtest [02:41:35]: testbed running kernel: Linux 6.8.0-11-generic #11-Ubuntu SMP PREEMPT_DYNAMIC Wed Feb 14 00:29:05 UTC 2024 1051s autopkgtest [02:41:37]: @@@@@@@@@@@@@@@@@@@@ apt-source r-cran-unitizer 1051s Get:1 http://ftpmaster.internal/ubuntu noble/universe r-cran-unitizer 1.4.20-1 (dsc) [2167 B] 1051s Get:2 http://ftpmaster.internal/ubuntu noble/universe r-cran-unitizer 1.4.20-1 (tar) [609 kB] 1051s Get:3 http://ftpmaster.internal/ubuntu noble/universe r-cran-unitizer 1.4.20-1 (diff) [3464 B] 1052s gpgv: Signature made Fri Oct 27 13:07:12 2023 UTC 1052s gpgv: using RSA key F1F007320A035541F0A663CA578A0494D1C646D1 1052s gpgv: issuer "tille@debian.org" 1052s gpgv: Can't check signature: No public key 1052s dpkg-source: warning: cannot verify inline signature for ./r-cran-unitizer_1.4.20-1.dsc: no acceptable signature found 1052s autopkgtest [02:41:38]: testing package r-cran-unitizer version 1.4.20-1 1052s autopkgtest [02:41:38]: build not needed 1053s autopkgtest [02:41:39]: test run-unit-test: preparing testbed 1056s Note, using file '/tmp/autopkgtest.YT3vEq/1-autopkgtest-satdep.dsc' to get the build dependencies 1056s Reading package lists... 1056s Building dependency tree... 1056s Reading state information... 1056s Starting pkgProblemResolver with broken count: 0 1056s Starting 2 pkgProblemResolver with broken count: 0 1056s Done 1056s The following NEW packages will be installed: 1056s build-essential cpp cpp-13 cpp-13-x86-64-linux-gnu cpp-x86-64-linux-gnu 1056s fontconfig fontconfig-config fonts-dejavu-core fonts-dejavu-mono 1056s fonts-font-awesome fonts-glyphicons-halflings fonts-mathjax g++ g++-13 1056s g++-13-x86-64-linux-gnu g++-x86-64-linux-gnu gcc gcc-13 1056s gcc-13-x86-64-linux-gnu gcc-x86-64-linux-gnu javascript-common libasan8 1056s libatomic1 libblas3 libc-dev-bin libc6-dev libcairo2 libcc1-0 libcrypt-dev 1056s libdatrie1 libdeflate0 libfontconfig1 libgcc-13-dev libgfortran5 libgomp1 1056s libgraphite2-3 libharfbuzz0b libhwasan0 libice6 libisl23 libitm1 libjbig0 1056s libjpeg-turbo8 libjpeg8 libjs-bootstrap libjs-bootstrap4 libjs-d3 1056s libjs-es5-shim libjs-highlight.js libjs-jquery libjs-jquery-datatables 1056s libjs-jquery-selectize.js libjs-jquery-ui libjs-json libjs-mathjax 1056s libjs-microplugin.js libjs-modernizr libjs-popper.js libjs-prettify 1056s libjs-sifter.js libjs-twitter-bootstrap-datepicker liblapack3 liblerc4 1056s liblsan0 liblua5.4-0 libmpc3 libpango-1.0-0 libpangocairo-1.0-0 1056s libpangoft2-1.0-0 libpaper-utils libpaper1 libpixman-1-0 libquadmath0 1056s libsharpyuv0 libsm6 libstdc++-13-dev libtcl8.6 libthai-data libthai0 1056s libtiff6 libtk8.6 libtsan2 libubsan1 libwebp7 libxcb-render0 libxcb-shm0 1056s libxft2 libxrender1 libxss1 libxt6 linux-libc-dev littler 1056s node-bootstrap-sass node-html5shiv node-normalize.css pandoc pandoc-data 1056s r-base-core r-cran-base64enc r-cran-bslib r-cran-cachem r-cran-cli 1056s r-cran-commonmark r-cran-crayon r-cran-diffobj r-cran-digest r-cran-ellipsis 1056s r-cran-evaluate r-cran-fastmap r-cran-fontawesome r-cran-fs r-cran-glue 1056s r-cran-highr r-cran-htmltools r-cran-httpuv r-cran-jquerylib r-cran-jsonlite 1056s r-cran-knitr r-cran-later r-cran-lifecycle r-cran-littler r-cran-magrittr 1056s r-cran-memoise r-cran-mime r-cran-pkgkitten r-cran-promises r-cran-r6 1056s r-cran-rappdirs r-cran-rcpp r-cran-rlang r-cran-rmarkdown r-cran-sass 1056s r-cran-shiny r-cran-sourcetools r-cran-stringi r-cran-stringr r-cran-tinytex 1056s r-cran-unitizer r-cran-vctrs r-cran-withr r-cran-xfun r-cran-xtable 1056s r-cran-yaml rpcsvc-proto unzip x11-common xdg-utils zip 1056s 0 upgraded, 148 newly installed, 0 to remove and 0 not upgraded. 1056s Need to get 170 MB of archives. 1056s After this operation, 646 MB of additional disk space will be used. 1056s Get:1 http://ftpmaster.internal/ubuntu noble/main amd64 libc-dev-bin amd64 2.39-0ubuntu6 [20.4 kB] 1056s Get:2 http://ftpmaster.internal/ubuntu noble/main amd64 linux-libc-dev amd64 6.8.0-11.11 [1595 kB] 1056s Get:3 http://ftpmaster.internal/ubuntu noble/main amd64 libcrypt-dev amd64 1:4.4.36-4 [128 kB] 1056s Get:4 http://ftpmaster.internal/ubuntu noble/main amd64 rpcsvc-proto amd64 1.4.2-0ubuntu6 [68.5 kB] 1056s Get:5 http://ftpmaster.internal/ubuntu noble/main amd64 libc6-dev amd64 2.39-0ubuntu6 [2126 kB] 1056s Get:6 http://ftpmaster.internal/ubuntu noble/main amd64 libisl23 amd64 0.26-3 [741 kB] 1056s Get:7 http://ftpmaster.internal/ubuntu noble/main amd64 libmpc3 amd64 1.3.1-1 [54.1 kB] 1056s Get:8 http://ftpmaster.internal/ubuntu noble/main amd64 cpp-13-x86-64-linux-gnu amd64 13.2.0-17ubuntu2 [11.2 MB] 1056s Get:9 http://ftpmaster.internal/ubuntu noble/main amd64 cpp-13 amd64 13.2.0-17ubuntu2 [1030 B] 1056s Get:10 http://ftpmaster.internal/ubuntu noble/main amd64 cpp-x86-64-linux-gnu amd64 4:13.2.0-7ubuntu1 [5326 B] 1056s Get:11 http://ftpmaster.internal/ubuntu noble/main amd64 cpp amd64 4:13.2.0-7ubuntu1 [22.4 kB] 1056s Get:12 http://ftpmaster.internal/ubuntu noble/main amd64 libcc1-0 amd64 14-20240303-1ubuntu1 [47.7 kB] 1056s Get:13 http://ftpmaster.internal/ubuntu noble/main amd64 libgomp1 amd64 14-20240303-1ubuntu1 [147 kB] 1056s Get:14 http://ftpmaster.internal/ubuntu noble/main amd64 libitm1 amd64 14-20240303-1ubuntu1 [29.1 kB] 1056s Get:15 http://ftpmaster.internal/ubuntu noble/main amd64 libatomic1 amd64 14-20240303-1ubuntu1 [10.4 kB] 1056s Get:16 http://ftpmaster.internal/ubuntu noble/main amd64 libasan8 amd64 14-20240303-1ubuntu1 [3026 kB] 1057s Get:17 http://ftpmaster.internal/ubuntu noble/main amd64 liblsan0 amd64 14-20240303-1ubuntu1 [1310 kB] 1057s Get:18 http://ftpmaster.internal/ubuntu noble/main amd64 libtsan2 amd64 14-20240303-1ubuntu1 [2732 kB] 1057s Get:19 http://ftpmaster.internal/ubuntu noble/main amd64 libubsan1 amd64 14-20240303-1ubuntu1 [1172 kB] 1057s Get:20 http://ftpmaster.internal/ubuntu noble/main amd64 libhwasan0 amd64 14-20240303-1ubuntu1 [1629 kB] 1057s Get:21 http://ftpmaster.internal/ubuntu noble/main amd64 libquadmath0 amd64 14-20240303-1ubuntu1 [155 kB] 1057s Get:22 http://ftpmaster.internal/ubuntu noble/main amd64 libgcc-13-dev amd64 13.2.0-17ubuntu2 [2687 kB] 1057s Get:23 http://ftpmaster.internal/ubuntu noble/main amd64 gcc-13-x86-64-linux-gnu amd64 13.2.0-17ubuntu2 [21.9 MB] 1057s Get:24 http://ftpmaster.internal/ubuntu noble/main amd64 gcc-13 amd64 13.2.0-17ubuntu2 [477 kB] 1057s Get:25 http://ftpmaster.internal/ubuntu noble/main amd64 gcc-x86-64-linux-gnu amd64 4:13.2.0-7ubuntu1 [1212 B] 1057s Get:26 http://ftpmaster.internal/ubuntu noble/main amd64 gcc amd64 4:13.2.0-7ubuntu1 [5018 B] 1057s Get:27 http://ftpmaster.internal/ubuntu noble/main amd64 libstdc++-13-dev amd64 13.2.0-17ubuntu2 [2340 kB] 1057s Get:28 http://ftpmaster.internal/ubuntu noble/main amd64 g++-13-x86-64-linux-gnu amd64 13.2.0-17ubuntu2 [12.5 MB] 1057s Get:29 http://ftpmaster.internal/ubuntu noble/main amd64 g++-13 amd64 13.2.0-17ubuntu2 [14.5 kB] 1057s Get:30 http://ftpmaster.internal/ubuntu noble/main amd64 g++-x86-64-linux-gnu amd64 4:13.2.0-7ubuntu1 [964 B] 1057s Get:31 http://ftpmaster.internal/ubuntu noble/main amd64 g++ amd64 4:13.2.0-7ubuntu1 [1100 B] 1057s Get:32 http://ftpmaster.internal/ubuntu noble/main amd64 build-essential amd64 12.10ubuntu1 [4928 B] 1057s Get:33 http://ftpmaster.internal/ubuntu noble/main amd64 fonts-dejavu-mono all 2.37-8 [502 kB] 1057s Get:34 http://ftpmaster.internal/ubuntu noble/main amd64 fonts-dejavu-core all 2.37-8 [835 kB] 1057s Get:35 http://ftpmaster.internal/ubuntu noble/main amd64 fontconfig-config amd64 2.15.0-1ubuntu1 [36.9 kB] 1057s Get:36 http://ftpmaster.internal/ubuntu noble/main amd64 libfontconfig1 amd64 2.15.0-1ubuntu1 [139 kB] 1057s Get:37 http://ftpmaster.internal/ubuntu noble/main amd64 fontconfig amd64 2.15.0-1ubuntu1 [180 kB] 1057s Get:38 http://ftpmaster.internal/ubuntu noble/main amd64 fonts-font-awesome all 5.0.10+really4.7.0~dfsg-4.1 [516 kB] 1057s Get:39 http://ftpmaster.internal/ubuntu noble/universe amd64 fonts-glyphicons-halflings all 1.009~3.4.1+dfsg-3 [118 kB] 1057s Get:40 http://ftpmaster.internal/ubuntu noble/main amd64 fonts-mathjax all 2.7.9+dfsg-1 [2208 kB] 1057s Get:41 http://ftpmaster.internal/ubuntu noble/main amd64 javascript-common all 11+nmu1 [5936 B] 1057s Get:42 http://ftpmaster.internal/ubuntu noble/main amd64 libblas3 amd64 3.12.0-3 [238 kB] 1057s Get:43 http://ftpmaster.internal/ubuntu noble/main amd64 libpixman-1-0 amd64 0.42.2-1 [268 kB] 1057s Get:44 http://ftpmaster.internal/ubuntu noble/main amd64 libxcb-render0 amd64 1.15-1 [16.3 kB] 1057s Get:45 http://ftpmaster.internal/ubuntu noble/main amd64 libxcb-shm0 amd64 1.15-1 [5740 B] 1057s Get:46 http://ftpmaster.internal/ubuntu noble/main amd64 libxrender1 amd64 1:0.9.10-1.1 [20.0 kB] 1057s Get:47 http://ftpmaster.internal/ubuntu noble/main amd64 libcairo2 amd64 1.18.0-1 [572 kB] 1057s Get:48 http://ftpmaster.internal/ubuntu noble/main amd64 libdatrie1 amd64 0.2.13-3 [20.9 kB] 1057s Get:49 http://ftpmaster.internal/ubuntu noble/main amd64 libdeflate0 amd64 1.19-1 [43.7 kB] 1057s Get:50 http://ftpmaster.internal/ubuntu noble/main amd64 libgfortran5 amd64 14-20240303-1ubuntu1 [924 kB] 1057s Get:51 http://ftpmaster.internal/ubuntu noble/main amd64 libgraphite2-3 amd64 1.3.14-2 [83.1 kB] 1057s Get:52 http://ftpmaster.internal/ubuntu noble/main amd64 libharfbuzz0b amd64 8.3.0-2 [469 kB] 1057s Get:53 http://ftpmaster.internal/ubuntu noble/main amd64 x11-common all 1:7.7+23ubuntu2 [23.4 kB] 1057s Get:54 http://ftpmaster.internal/ubuntu noble/main amd64 libice6 amd64 2:1.0.10-1build2 [42.6 kB] 1057s Get:55 http://ftpmaster.internal/ubuntu noble/main amd64 libjpeg-turbo8 amd64 2.1.5-2ubuntu1 [147 kB] 1057s Get:56 http://ftpmaster.internal/ubuntu noble/main amd64 libjpeg8 amd64 8c-2ubuntu11 [2148 B] 1057s Get:57 http://ftpmaster.internal/ubuntu noble/universe amd64 libjs-bootstrap all 3.4.1+dfsg-3 [129 kB] 1057s Get:58 http://ftpmaster.internal/ubuntu noble/universe amd64 libjs-popper.js all 1.16.1+ds-6 [54.1 kB] 1057s Get:59 http://ftpmaster.internal/ubuntu noble/universe amd64 libjs-bootstrap4 all 4.6.1+dfsg1-4 [537 kB] 1057s Get:60 http://ftpmaster.internal/ubuntu noble/universe amd64 libjs-d3 all 3.5.17-4 [132 kB] 1057s Get:61 http://ftpmaster.internal/ubuntu noble/universe amd64 libjs-es5-shim all 4.6.7-2 [39.8 kB] 1057s Get:62 http://ftpmaster.internal/ubuntu noble/universe amd64 libjs-highlight.js all 9.18.5+dfsg1-2 [385 kB] 1057s Get:63 http://ftpmaster.internal/ubuntu noble/main amd64 libjs-jquery all 3.6.1+dfsg+~3.5.14-1 [328 kB] 1057s Get:64 http://ftpmaster.internal/ubuntu noble/universe amd64 libjs-jquery-datatables all 1.11.5+dfsg-2 [146 kB] 1057s Get:65 http://ftpmaster.internal/ubuntu noble/universe amd64 libjs-sifter.js all 0.6.0+dfsg-3 [12.6 kB] 1057s Get:66 http://ftpmaster.internal/ubuntu noble/universe amd64 libjs-microplugin.js all 0.0.3+dfsg-1.1 [3712 B] 1057s Get:67 http://ftpmaster.internal/ubuntu noble/universe amd64 libjs-jquery-selectize.js all 0.12.6+dfsg-1.1 [51.0 kB] 1057s Get:68 http://ftpmaster.internal/ubuntu noble/universe amd64 libjs-jquery-ui all 1.13.2+dfsg-1 [252 kB] 1057s Get:69 http://ftpmaster.internal/ubuntu noble/universe amd64 libjs-json all 0~20221030+~1.0.8-1 [20.6 kB] 1057s Get:70 http://ftpmaster.internal/ubuntu noble/universe amd64 libjs-prettify all 2015.12.04+dfsg-1.1 [39.3 kB] 1057s Get:71 http://ftpmaster.internal/ubuntu noble/main amd64 liblapack3 amd64 3.12.0-3 [2649 kB] 1057s Get:72 http://ftpmaster.internal/ubuntu noble/main amd64 liblerc4 amd64 4.0.0+ds-4ubuntu1 [184 kB] 1057s Get:73 http://ftpmaster.internal/ubuntu noble/main amd64 liblua5.4-0 amd64 5.4.6-3 [166 kB] 1057s Get:74 http://ftpmaster.internal/ubuntu noble/main amd64 libthai-data all 0.1.29-2 [158 kB] 1057s Get:75 http://ftpmaster.internal/ubuntu noble/main amd64 libthai0 amd64 0.1.29-2 [18.8 kB] 1057s Get:76 http://ftpmaster.internal/ubuntu noble/main amd64 libpango-1.0-0 amd64 1.51.0+ds-4 [228 kB] 1057s Get:77 http://ftpmaster.internal/ubuntu noble/main amd64 libpangoft2-1.0-0 amd64 1.51.0+ds-4 [42.1 kB] 1057s Get:78 http://ftpmaster.internal/ubuntu noble/main amd64 libpangocairo-1.0-0 amd64 1.51.0+ds-4 [29.0 kB] 1057s Get:79 http://ftpmaster.internal/ubuntu noble/main amd64 libpaper1 amd64 1.1.29 [13.4 kB] 1057s Get:80 http://ftpmaster.internal/ubuntu noble/main amd64 libpaper-utils amd64 1.1.29 [8658 B] 1057s Get:81 http://ftpmaster.internal/ubuntu noble/main amd64 libsharpyuv0 amd64 1.3.2-0.4 [15.6 kB] 1057s Get:82 http://ftpmaster.internal/ubuntu noble/main amd64 libsm6 amd64 2:1.2.3-1build2 [16.7 kB] 1057s Get:83 http://ftpmaster.internal/ubuntu noble/main amd64 libtcl8.6 amd64 8.6.13+dfsg-2 [984 kB] 1057s Get:84 http://ftpmaster.internal/ubuntu noble/main amd64 libjbig0 amd64 2.1-6.1ubuntu1 [29.3 kB] 1057s Get:85 http://ftpmaster.internal/ubuntu noble/main amd64 libwebp7 amd64 1.3.2-0.4 [230 kB] 1057s Get:86 http://ftpmaster.internal/ubuntu noble/main amd64 libtiff6 amd64 4.5.1+git230720-3ubuntu1 [232 kB] 1057s Get:87 http://ftpmaster.internal/ubuntu noble/main amd64 libxft2 amd64 2.3.6-1 [44.5 kB] 1057s Get:88 http://ftpmaster.internal/ubuntu noble/main amd64 libxss1 amd64 1:1.2.3-1build2 [8476 B] 1057s Get:89 http://ftpmaster.internal/ubuntu noble/main amd64 libtk8.6 amd64 8.6.14-1 [779 kB] 1057s Get:90 http://ftpmaster.internal/ubuntu noble/main amd64 libxt6 amd64 1:1.2.1-1.1 [173 kB] 1057s Get:91 http://ftpmaster.internal/ubuntu noble/main amd64 zip amd64 3.0-13 [176 kB] 1057s Get:92 http://ftpmaster.internal/ubuntu noble/main amd64 unzip amd64 6.0-28ubuntu3 [174 kB] 1057s Get:93 http://ftpmaster.internal/ubuntu noble/main amd64 xdg-utils all 1.1.3-4.1ubuntu3 [62.0 kB] 1057s Get:94 http://ftpmaster.internal/ubuntu noble/universe amd64 r-base-core amd64 4.3.2-1build1 [27.0 MB] 1057s Get:95 http://ftpmaster.internal/ubuntu noble/universe amd64 r-cran-littler amd64 0.3.19-1 [94.1 kB] 1057s Get:96 http://ftpmaster.internal/ubuntu noble/universe amd64 littler all 0.3.19-1 [2472 B] 1057s Get:97 http://ftpmaster.internal/ubuntu noble/universe amd64 node-bootstrap-sass all 3.4.3-2 [187 kB] 1057s Get:98 http://ftpmaster.internal/ubuntu noble/universe amd64 node-html5shiv all 3.7.3+dfsg-5 [13.5 kB] 1057s Get:99 http://ftpmaster.internal/ubuntu noble/universe amd64 node-normalize.css all 8.0.1-5 [10.8 kB] 1057s Get:100 http://ftpmaster.internal/ubuntu noble/universe amd64 pandoc-data all 3.1.3-1 [92.4 kB] 1057s Get:101 http://ftpmaster.internal/ubuntu noble/universe amd64 pandoc amd64 3.1.3+ds-2 [26.9 MB] 1057s Get:102 http://ftpmaster.internal/ubuntu noble/universe amd64 r-cran-base64enc amd64 0.1-3-3 [27.6 kB] 1057s Get:103 http://ftpmaster.internal/ubuntu noble/universe amd64 r-cran-rlang amd64 1.1.3-1 [1663 kB] 1057s Get:104 http://ftpmaster.internal/ubuntu noble/universe amd64 r-cran-fastmap amd64 1.1.1-1 [70.5 kB] 1057s Get:105 http://ftpmaster.internal/ubuntu noble/universe amd64 r-cran-cachem amd64 1.0.8-1 [72.1 kB] 1057s Get:106 http://ftpmaster.internal/ubuntu noble/universe amd64 r-cran-digest amd64 0.6.34-1 [186 kB] 1057s Get:107 http://ftpmaster.internal/ubuntu noble/universe amd64 r-cran-ellipsis amd64 0.3.2-2 [35.6 kB] 1057s Get:108 http://ftpmaster.internal/ubuntu noble/universe amd64 r-cran-htmltools amd64 0.5.7-1 [369 kB] 1057s Get:109 http://ftpmaster.internal/ubuntu noble/universe amd64 r-cran-jquerylib all 0.1.4+dfsg-4 [13.5 kB] 1057s Get:110 http://ftpmaster.internal/ubuntu noble/universe amd64 r-cran-jsonlite amd64 1.8.8+dfsg-1 [441 kB] 1057s Get:111 http://ftpmaster.internal/ubuntu noble/universe amd64 r-cran-cli amd64 3.6.2-1 [1380 kB] 1057s Get:112 http://ftpmaster.internal/ubuntu noble/universe amd64 r-cran-glue amd64 1.7.0-1 [154 kB] 1057s Get:113 http://ftpmaster.internal/ubuntu noble/universe amd64 r-cran-lifecycle all 1.0.4+dfsg-1 [110 kB] 1057s Get:114 http://ftpmaster.internal/ubuntu noble/universe amd64 r-cran-memoise all 2.0.1-1 [53.9 kB] 1057s Get:115 http://ftpmaster.internal/ubuntu noble/universe amd64 r-cran-mime amd64 0.12-1 [35.8 kB] 1057s Get:116 http://ftpmaster.internal/ubuntu noble/universe amd64 r-cran-fs amd64 1.6.3+dfsg-1 [229 kB] 1057s Get:117 http://ftpmaster.internal/ubuntu noble/universe amd64 r-cran-r6 all 2.5.1-1 [99.0 kB] 1057s Get:118 http://ftpmaster.internal/ubuntu noble/universe amd64 r-cran-rappdirs amd64 0.3.3-1 [47.5 kB] 1057s Get:119 http://ftpmaster.internal/ubuntu noble/universe amd64 r-cran-sass amd64 0.4.8+dfsg-1 [996 kB] 1057s Get:120 http://ftpmaster.internal/ubuntu noble/universe amd64 r-cran-bslib all 0.6.1+dfsg-1 [5138 kB] 1057s Get:121 http://ftpmaster.internal/ubuntu noble/universe amd64 r-cran-commonmark amd64 1.9.1-1 [131 kB] 1057s Get:122 http://ftpmaster.internal/ubuntu noble/universe amd64 r-cran-crayon all 1.5.2-1 [164 kB] 1057s Get:123 http://ftpmaster.internal/ubuntu noble/universe amd64 r-cran-diffobj amd64 0.3.5-1 [1117 kB] 1057s Get:124 http://ftpmaster.internal/ubuntu noble/universe amd64 r-cran-evaluate all 0.23-1 [90.2 kB] 1057s Get:125 http://ftpmaster.internal/ubuntu noble/universe amd64 r-cran-fontawesome all 0.5.2-1 [1300 kB] 1057s Get:126 http://ftpmaster.internal/ubuntu noble/universe amd64 r-cran-xfun amd64 0.41+dfsg-1 [415 kB] 1057s Get:127 http://ftpmaster.internal/ubuntu noble/universe amd64 r-cran-highr all 0.10+dfsg-1 [38.3 kB] 1057s Get:128 http://ftpmaster.internal/ubuntu noble/universe amd64 r-cran-pkgkitten all 0.2.3-1 [25.1 kB] 1057s Get:129 http://ftpmaster.internal/ubuntu noble/universe amd64 r-cran-rcpp amd64 1.0.12-1 [1981 kB] 1057s Get:130 http://ftpmaster.internal/ubuntu noble/universe amd64 r-cran-later amd64 1.3.2+dfsg-1 [123 kB] 1057s Get:131 http://ftpmaster.internal/ubuntu noble/universe amd64 r-cran-magrittr amd64 2.0.3-1 [154 kB] 1057s Get:132 http://ftpmaster.internal/ubuntu noble/universe amd64 r-cran-promises amd64 1.2.1+dfsg-1 [284 kB] 1057s Get:133 http://ftpmaster.internal/ubuntu noble/universe amd64 r-cran-httpuv amd64 1.6.14+dfsg-1 [510 kB] 1057s Get:134 http://ftpmaster.internal/ubuntu noble/universe amd64 r-cran-yaml amd64 2.3.8-1 [108 kB] 1057s Get:135 http://ftpmaster.internal/ubuntu noble/main amd64 libjs-mathjax all 2.7.9+dfsg-1 [5665 kB] 1057s Get:136 http://ftpmaster.internal/ubuntu noble/universe amd64 r-cran-knitr all 1.45+dfsg-1 [917 kB] 1057s Get:137 http://ftpmaster.internal/ubuntu noble/universe amd64 r-cran-stringi amd64 1.8.3-1 [873 kB] 1057s Get:138 http://ftpmaster.internal/ubuntu noble/universe amd64 r-cran-vctrs amd64 0.6.5-1 [1335 kB] 1057s Get:139 http://ftpmaster.internal/ubuntu noble/universe amd64 r-cran-stringr all 1.5.1-1 [290 kB] 1057s Get:140 http://ftpmaster.internal/ubuntu noble/universe amd64 r-cran-tinytex all 0.49-1 [141 kB] 1057s Get:141 http://ftpmaster.internal/ubuntu noble/universe amd64 libjs-modernizr all 2.6.2+ds1-5 [48.3 kB] 1057s Get:142 http://ftpmaster.internal/ubuntu noble/universe amd64 r-cran-xtable all 1:1.8-4-2 [689 kB] 1057s Get:143 http://ftpmaster.internal/ubuntu noble/universe amd64 r-cran-sourcetools amd64 0.1.7-1-1 [48.1 kB] 1057s Get:144 http://ftpmaster.internal/ubuntu noble/universe amd64 r-cran-withr all 2.5.0-1 [225 kB] 1057s Get:145 http://ftpmaster.internal/ubuntu noble/universe amd64 libjs-twitter-bootstrap-datepicker all 1.3.1+dfsg1-4.1 [28.5 kB] 1057s Get:146 http://ftpmaster.internal/ubuntu noble/universe amd64 r-cran-shiny all 1.8.0+dfsg-1 [2762 kB] 1058s Get:147 http://ftpmaster.internal/ubuntu noble/universe amd64 r-cran-rmarkdown all 2.25+dfsg-3 [1481 kB] 1058s Get:148 http://ftpmaster.internal/ubuntu noble/universe amd64 r-cran-unitizer all 1.4.20-1 [1419 kB] 1058s Preconfiguring packages ... 1058s Fetched 170 MB in 1s (144 MB/s) 1058s Selecting previously unselected package libc-dev-bin. 1058s (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 ... 71420 files and directories currently installed.) 1058s Preparing to unpack .../000-libc-dev-bin_2.39-0ubuntu6_amd64.deb ... 1058s Unpacking libc-dev-bin (2.39-0ubuntu6) ... 1058s Selecting previously unselected package linux-libc-dev:amd64. 1058s Preparing to unpack .../001-linux-libc-dev_6.8.0-11.11_amd64.deb ... 1058s Unpacking linux-libc-dev:amd64 (6.8.0-11.11) ... 1058s Selecting previously unselected package libcrypt-dev:amd64. 1058s Preparing to unpack .../002-libcrypt-dev_1%3a4.4.36-4_amd64.deb ... 1058s Unpacking libcrypt-dev:amd64 (1:4.4.36-4) ... 1058s Selecting previously unselected package rpcsvc-proto. 1058s Preparing to unpack .../003-rpcsvc-proto_1.4.2-0ubuntu6_amd64.deb ... 1058s Unpacking rpcsvc-proto (1.4.2-0ubuntu6) ... 1058s Selecting previously unselected package libc6-dev:amd64. 1058s Preparing to unpack .../004-libc6-dev_2.39-0ubuntu6_amd64.deb ... 1058s Unpacking libc6-dev:amd64 (2.39-0ubuntu6) ... 1059s Selecting previously unselected package libisl23:amd64. 1059s Preparing to unpack .../005-libisl23_0.26-3_amd64.deb ... 1059s Unpacking libisl23:amd64 (0.26-3) ... 1059s Selecting previously unselected package libmpc3:amd64. 1059s Preparing to unpack .../006-libmpc3_1.3.1-1_amd64.deb ... 1059s Unpacking libmpc3:amd64 (1.3.1-1) ... 1059s Selecting previously unselected package cpp-13-x86-64-linux-gnu. 1059s Preparing to unpack .../007-cpp-13-x86-64-linux-gnu_13.2.0-17ubuntu2_amd64.deb ... 1059s Unpacking cpp-13-x86-64-linux-gnu (13.2.0-17ubuntu2) ... 1059s Selecting previously unselected package cpp-13. 1059s Preparing to unpack .../008-cpp-13_13.2.0-17ubuntu2_amd64.deb ... 1059s Unpacking cpp-13 (13.2.0-17ubuntu2) ... 1059s Selecting previously unselected package cpp-x86-64-linux-gnu. 1059s Preparing to unpack .../009-cpp-x86-64-linux-gnu_4%3a13.2.0-7ubuntu1_amd64.deb ... 1059s Unpacking cpp-x86-64-linux-gnu (4:13.2.0-7ubuntu1) ... 1059s Selecting previously unselected package cpp. 1059s Preparing to unpack .../010-cpp_4%3a13.2.0-7ubuntu1_amd64.deb ... 1059s Unpacking cpp (4:13.2.0-7ubuntu1) ... 1059s Selecting previously unselected package libcc1-0:amd64. 1059s Preparing to unpack .../011-libcc1-0_14-20240303-1ubuntu1_amd64.deb ... 1059s Unpacking libcc1-0:amd64 (14-20240303-1ubuntu1) ... 1059s Selecting previously unselected package libgomp1:amd64. 1059s Preparing to unpack .../012-libgomp1_14-20240303-1ubuntu1_amd64.deb ... 1059s Unpacking libgomp1:amd64 (14-20240303-1ubuntu1) ... 1059s Selecting previously unselected package libitm1:amd64. 1059s Preparing to unpack .../013-libitm1_14-20240303-1ubuntu1_amd64.deb ... 1059s Unpacking libitm1:amd64 (14-20240303-1ubuntu1) ... 1059s Selecting previously unselected package libatomic1:amd64. 1059s Preparing to unpack .../014-libatomic1_14-20240303-1ubuntu1_amd64.deb ... 1059s Unpacking libatomic1:amd64 (14-20240303-1ubuntu1) ... 1059s Selecting previously unselected package libasan8:amd64. 1059s Preparing to unpack .../015-libasan8_14-20240303-1ubuntu1_amd64.deb ... 1059s Unpacking libasan8:amd64 (14-20240303-1ubuntu1) ... 1059s Selecting previously unselected package liblsan0:amd64. 1059s Preparing to unpack .../016-liblsan0_14-20240303-1ubuntu1_amd64.deb ... 1059s Unpacking liblsan0:amd64 (14-20240303-1ubuntu1) ... 1059s Selecting previously unselected package libtsan2:amd64. 1059s Preparing to unpack .../017-libtsan2_14-20240303-1ubuntu1_amd64.deb ... 1059s Unpacking libtsan2:amd64 (14-20240303-1ubuntu1) ... 1059s Selecting previously unselected package libubsan1:amd64. 1059s Preparing to unpack .../018-libubsan1_14-20240303-1ubuntu1_amd64.deb ... 1059s Unpacking libubsan1:amd64 (14-20240303-1ubuntu1) ... 1059s Selecting previously unselected package libhwasan0:amd64. 1059s Preparing to unpack .../019-libhwasan0_14-20240303-1ubuntu1_amd64.deb ... 1059s Unpacking libhwasan0:amd64 (14-20240303-1ubuntu1) ... 1059s Selecting previously unselected package libquadmath0:amd64. 1059s Preparing to unpack .../020-libquadmath0_14-20240303-1ubuntu1_amd64.deb ... 1059s Unpacking libquadmath0:amd64 (14-20240303-1ubuntu1) ... 1059s Selecting previously unselected package libgcc-13-dev:amd64. 1059s Preparing to unpack .../021-libgcc-13-dev_13.2.0-17ubuntu2_amd64.deb ... 1059s Unpacking libgcc-13-dev:amd64 (13.2.0-17ubuntu2) ... 1060s Selecting previously unselected package gcc-13-x86-64-linux-gnu. 1060s Preparing to unpack .../022-gcc-13-x86-64-linux-gnu_13.2.0-17ubuntu2_amd64.deb ... 1060s Unpacking gcc-13-x86-64-linux-gnu (13.2.0-17ubuntu2) ... 1060s Selecting previously unselected package gcc-13. 1060s Preparing to unpack .../023-gcc-13_13.2.0-17ubuntu2_amd64.deb ... 1060s Unpacking gcc-13 (13.2.0-17ubuntu2) ... 1060s Selecting previously unselected package gcc-x86-64-linux-gnu. 1060s Preparing to unpack .../024-gcc-x86-64-linux-gnu_4%3a13.2.0-7ubuntu1_amd64.deb ... 1060s Unpacking gcc-x86-64-linux-gnu (4:13.2.0-7ubuntu1) ... 1060s Selecting previously unselected package gcc. 1060s Preparing to unpack .../025-gcc_4%3a13.2.0-7ubuntu1_amd64.deb ... 1060s Unpacking gcc (4:13.2.0-7ubuntu1) ... 1060s Selecting previously unselected package libstdc++-13-dev:amd64. 1060s Preparing to unpack .../026-libstdc++-13-dev_13.2.0-17ubuntu2_amd64.deb ... 1060s Unpacking libstdc++-13-dev:amd64 (13.2.0-17ubuntu2) ... 1060s Selecting previously unselected package g++-13-x86-64-linux-gnu. 1060s Preparing to unpack .../027-g++-13-x86-64-linux-gnu_13.2.0-17ubuntu2_amd64.deb ... 1060s Unpacking g++-13-x86-64-linux-gnu (13.2.0-17ubuntu2) ... 1060s Selecting previously unselected package g++-13. 1060s Preparing to unpack .../028-g++-13_13.2.0-17ubuntu2_amd64.deb ... 1060s Unpacking g++-13 (13.2.0-17ubuntu2) ... 1060s Selecting previously unselected package g++-x86-64-linux-gnu. 1060s Preparing to unpack .../029-g++-x86-64-linux-gnu_4%3a13.2.0-7ubuntu1_amd64.deb ... 1060s Unpacking g++-x86-64-linux-gnu (4:13.2.0-7ubuntu1) ... 1060s Selecting previously unselected package g++. 1060s Preparing to unpack .../030-g++_4%3a13.2.0-7ubuntu1_amd64.deb ... 1060s Unpacking g++ (4:13.2.0-7ubuntu1) ... 1060s Selecting previously unselected package build-essential. 1060s Preparing to unpack .../031-build-essential_12.10ubuntu1_amd64.deb ... 1060s Unpacking build-essential (12.10ubuntu1) ... 1060s Selecting previously unselected package fonts-dejavu-mono. 1060s Preparing to unpack .../032-fonts-dejavu-mono_2.37-8_all.deb ... 1060s Unpacking fonts-dejavu-mono (2.37-8) ... 1060s Selecting previously unselected package fonts-dejavu-core. 1061s Preparing to unpack .../033-fonts-dejavu-core_2.37-8_all.deb ... 1061s Unpacking fonts-dejavu-core (2.37-8) ... 1061s Selecting previously unselected package fontconfig-config. 1061s Preparing to unpack .../034-fontconfig-config_2.15.0-1ubuntu1_amd64.deb ... 1061s Unpacking fontconfig-config (2.15.0-1ubuntu1) ... 1061s Selecting previously unselected package libfontconfig1:amd64. 1061s Preparing to unpack .../035-libfontconfig1_2.15.0-1ubuntu1_amd64.deb ... 1061s Unpacking libfontconfig1:amd64 (2.15.0-1ubuntu1) ... 1061s Selecting previously unselected package fontconfig. 1061s Preparing to unpack .../036-fontconfig_2.15.0-1ubuntu1_amd64.deb ... 1061s Unpacking fontconfig (2.15.0-1ubuntu1) ... 1061s Selecting previously unselected package fonts-font-awesome. 1061s Preparing to unpack .../037-fonts-font-awesome_5.0.10+really4.7.0~dfsg-4.1_all.deb ... 1061s Unpacking fonts-font-awesome (5.0.10+really4.7.0~dfsg-4.1) ... 1061s Selecting previously unselected package fonts-glyphicons-halflings. 1061s Preparing to unpack .../038-fonts-glyphicons-halflings_1.009~3.4.1+dfsg-3_all.deb ... 1061s Unpacking fonts-glyphicons-halflings (1.009~3.4.1+dfsg-3) ... 1061s Selecting previously unselected package fonts-mathjax. 1061s Preparing to unpack .../039-fonts-mathjax_2.7.9+dfsg-1_all.deb ... 1061s Unpacking fonts-mathjax (2.7.9+dfsg-1) ... 1061s Selecting previously unselected package javascript-common. 1061s Preparing to unpack .../040-javascript-common_11+nmu1_all.deb ... 1061s Unpacking javascript-common (11+nmu1) ... 1061s Selecting previously unselected package libblas3:amd64. 1061s Preparing to unpack .../041-libblas3_3.12.0-3_amd64.deb ... 1061s Unpacking libblas3:amd64 (3.12.0-3) ... 1061s Selecting previously unselected package libpixman-1-0:amd64. 1061s Preparing to unpack .../042-libpixman-1-0_0.42.2-1_amd64.deb ... 1061s Unpacking libpixman-1-0:amd64 (0.42.2-1) ... 1061s Selecting previously unselected package libxcb-render0:amd64. 1061s Preparing to unpack .../043-libxcb-render0_1.15-1_amd64.deb ... 1061s Unpacking libxcb-render0:amd64 (1.15-1) ... 1061s Selecting previously unselected package libxcb-shm0:amd64. 1061s Preparing to unpack .../044-libxcb-shm0_1.15-1_amd64.deb ... 1061s Unpacking libxcb-shm0:amd64 (1.15-1) ... 1061s Selecting previously unselected package libxrender1:amd64. 1061s Preparing to unpack .../045-libxrender1_1%3a0.9.10-1.1_amd64.deb ... 1061s Unpacking libxrender1:amd64 (1:0.9.10-1.1) ... 1061s Selecting previously unselected package libcairo2:amd64. 1061s Preparing to unpack .../046-libcairo2_1.18.0-1_amd64.deb ... 1061s Unpacking libcairo2:amd64 (1.18.0-1) ... 1061s Selecting previously unselected package libdatrie1:amd64. 1061s Preparing to unpack .../047-libdatrie1_0.2.13-3_amd64.deb ... 1061s Unpacking libdatrie1:amd64 (0.2.13-3) ... 1061s Selecting previously unselected package libdeflate0:amd64. 1061s Preparing to unpack .../048-libdeflate0_1.19-1_amd64.deb ... 1061s Unpacking libdeflate0:amd64 (1.19-1) ... 1061s Selecting previously unselected package libgfortran5:amd64. 1061s Preparing to unpack .../049-libgfortran5_14-20240303-1ubuntu1_amd64.deb ... 1061s Unpacking libgfortran5:amd64 (14-20240303-1ubuntu1) ... 1061s Selecting previously unselected package libgraphite2-3:amd64. 1061s Preparing to unpack .../050-libgraphite2-3_1.3.14-2_amd64.deb ... 1061s Unpacking libgraphite2-3:amd64 (1.3.14-2) ... 1061s Selecting previously unselected package libharfbuzz0b:amd64. 1061s Preparing to unpack .../051-libharfbuzz0b_8.3.0-2_amd64.deb ... 1061s Unpacking libharfbuzz0b:amd64 (8.3.0-2) ... 1061s Selecting previously unselected package x11-common. 1061s Preparing to unpack .../052-x11-common_1%3a7.7+23ubuntu2_all.deb ... 1061s Unpacking x11-common (1:7.7+23ubuntu2) ... 1062s Selecting previously unselected package libice6:amd64. 1062s Preparing to unpack .../053-libice6_2%3a1.0.10-1build2_amd64.deb ... 1062s Unpacking libice6:amd64 (2:1.0.10-1build2) ... 1062s Selecting previously unselected package libjpeg-turbo8:amd64. 1062s Preparing to unpack .../054-libjpeg-turbo8_2.1.5-2ubuntu1_amd64.deb ... 1062s Unpacking libjpeg-turbo8:amd64 (2.1.5-2ubuntu1) ... 1062s Selecting previously unselected package libjpeg8:amd64. 1062s Preparing to unpack .../055-libjpeg8_8c-2ubuntu11_amd64.deb ... 1062s Unpacking libjpeg8:amd64 (8c-2ubuntu11) ... 1062s Selecting previously unselected package libjs-bootstrap. 1062s Preparing to unpack .../056-libjs-bootstrap_3.4.1+dfsg-3_all.deb ... 1062s Unpacking libjs-bootstrap (3.4.1+dfsg-3) ... 1062s Selecting previously unselected package libjs-popper.js. 1062s Preparing to unpack .../057-libjs-popper.js_1.16.1+ds-6_all.deb ... 1062s Unpacking libjs-popper.js (1.16.1+ds-6) ... 1062s Selecting previously unselected package libjs-bootstrap4. 1062s Preparing to unpack .../058-libjs-bootstrap4_4.6.1+dfsg1-4_all.deb ... 1062s Unpacking libjs-bootstrap4 (4.6.1+dfsg1-4) ... 1062s Selecting previously unselected package libjs-d3. 1062s Preparing to unpack .../059-libjs-d3_3.5.17-4_all.deb ... 1062s Unpacking libjs-d3 (3.5.17-4) ... 1062s Selecting previously unselected package libjs-es5-shim. 1062s Preparing to unpack .../060-libjs-es5-shim_4.6.7-2_all.deb ... 1062s Unpacking libjs-es5-shim (4.6.7-2) ... 1062s Selecting previously unselected package libjs-highlight.js. 1062s Preparing to unpack .../061-libjs-highlight.js_9.18.5+dfsg1-2_all.deb ... 1062s Unpacking libjs-highlight.js (9.18.5+dfsg1-2) ... 1062s Selecting previously unselected package libjs-jquery. 1062s Preparing to unpack .../062-libjs-jquery_3.6.1+dfsg+~3.5.14-1_all.deb ... 1062s Unpacking libjs-jquery (3.6.1+dfsg+~3.5.14-1) ... 1062s Selecting previously unselected package libjs-jquery-datatables. 1062s Preparing to unpack .../063-libjs-jquery-datatables_1.11.5+dfsg-2_all.deb ... 1062s Unpacking libjs-jquery-datatables (1.11.5+dfsg-2) ... 1062s Selecting previously unselected package libjs-sifter.js. 1062s Preparing to unpack .../064-libjs-sifter.js_0.6.0+dfsg-3_all.deb ... 1062s Unpacking libjs-sifter.js (0.6.0+dfsg-3) ... 1062s Selecting previously unselected package libjs-microplugin.js. 1062s Preparing to unpack .../065-libjs-microplugin.js_0.0.3+dfsg-1.1_all.deb ... 1062s Unpacking libjs-microplugin.js (0.0.3+dfsg-1.1) ... 1062s Selecting previously unselected package libjs-jquery-selectize.js. 1062s Preparing to unpack .../066-libjs-jquery-selectize.js_0.12.6+dfsg-1.1_all.deb ... 1062s Unpacking libjs-jquery-selectize.js (0.12.6+dfsg-1.1) ... 1062s Selecting previously unselected package libjs-jquery-ui. 1062s Preparing to unpack .../067-libjs-jquery-ui_1.13.2+dfsg-1_all.deb ... 1062s Unpacking libjs-jquery-ui (1.13.2+dfsg-1) ... 1062s Selecting previously unselected package libjs-json. 1062s Preparing to unpack .../068-libjs-json_0~20221030+~1.0.8-1_all.deb ... 1062s Unpacking libjs-json (0~20221030+~1.0.8-1) ... 1062s Selecting previously unselected package libjs-prettify. 1062s Preparing to unpack .../069-libjs-prettify_2015.12.04+dfsg-1.1_all.deb ... 1062s Unpacking libjs-prettify (2015.12.04+dfsg-1.1) ... 1062s Selecting previously unselected package liblapack3:amd64. 1062s Preparing to unpack .../070-liblapack3_3.12.0-3_amd64.deb ... 1062s Unpacking liblapack3:amd64 (3.12.0-3) ... 1062s Selecting previously unselected package liblerc4:amd64. 1062s Preparing to unpack .../071-liblerc4_4.0.0+ds-4ubuntu1_amd64.deb ... 1062s Unpacking liblerc4:amd64 (4.0.0+ds-4ubuntu1) ... 1062s Selecting previously unselected package liblua5.4-0:amd64. 1062s Preparing to unpack .../072-liblua5.4-0_5.4.6-3_amd64.deb ... 1062s Unpacking liblua5.4-0:amd64 (5.4.6-3) ... 1062s Selecting previously unselected package libthai-data. 1062s Preparing to unpack .../073-libthai-data_0.1.29-2_all.deb ... 1062s Unpacking libthai-data (0.1.29-2) ... 1062s Selecting previously unselected package libthai0:amd64. 1062s Preparing to unpack .../074-libthai0_0.1.29-2_amd64.deb ... 1062s Unpacking libthai0:amd64 (0.1.29-2) ... 1062s Selecting previously unselected package libpango-1.0-0:amd64. 1062s Preparing to unpack .../075-libpango-1.0-0_1.51.0+ds-4_amd64.deb ... 1062s Unpacking libpango-1.0-0:amd64 (1.51.0+ds-4) ... 1062s Selecting previously unselected package libpangoft2-1.0-0:amd64. 1062s Preparing to unpack .../076-libpangoft2-1.0-0_1.51.0+ds-4_amd64.deb ... 1062s Unpacking libpangoft2-1.0-0:amd64 (1.51.0+ds-4) ... 1062s Selecting previously unselected package libpangocairo-1.0-0:amd64. 1062s Preparing to unpack .../077-libpangocairo-1.0-0_1.51.0+ds-4_amd64.deb ... 1062s Unpacking libpangocairo-1.0-0:amd64 (1.51.0+ds-4) ... 1062s Selecting previously unselected package libpaper1:amd64. 1062s Preparing to unpack .../078-libpaper1_1.1.29_amd64.deb ... 1062s Unpacking libpaper1:amd64 (1.1.29) ... 1062s Selecting previously unselected package libpaper-utils. 1062s Preparing to unpack .../079-libpaper-utils_1.1.29_amd64.deb ... 1062s Unpacking libpaper-utils (1.1.29) ... 1062s Selecting previously unselected package libsharpyuv0:amd64. 1062s Preparing to unpack .../080-libsharpyuv0_1.3.2-0.4_amd64.deb ... 1062s Unpacking libsharpyuv0:amd64 (1.3.2-0.4) ... 1063s Selecting previously unselected package libsm6:amd64. 1063s Preparing to unpack .../081-libsm6_2%3a1.2.3-1build2_amd64.deb ... 1063s Unpacking libsm6:amd64 (2:1.2.3-1build2) ... 1063s Selecting previously unselected package libtcl8.6:amd64. 1063s Preparing to unpack .../082-libtcl8.6_8.6.13+dfsg-2_amd64.deb ... 1063s Unpacking libtcl8.6:amd64 (8.6.13+dfsg-2) ... 1063s Selecting previously unselected package libjbig0:amd64. 1063s Preparing to unpack .../083-libjbig0_2.1-6.1ubuntu1_amd64.deb ... 1063s Unpacking libjbig0:amd64 (2.1-6.1ubuntu1) ... 1063s Selecting previously unselected package libwebp7:amd64. 1063s Preparing to unpack .../084-libwebp7_1.3.2-0.4_amd64.deb ... 1063s Unpacking libwebp7:amd64 (1.3.2-0.4) ... 1063s Selecting previously unselected package libtiff6:amd64. 1063s Preparing to unpack .../085-libtiff6_4.5.1+git230720-3ubuntu1_amd64.deb ... 1063s Unpacking libtiff6:amd64 (4.5.1+git230720-3ubuntu1) ... 1063s Selecting previously unselected package libxft2:amd64. 1063s Preparing to unpack .../086-libxft2_2.3.6-1_amd64.deb ... 1063s Unpacking libxft2:amd64 (2.3.6-1) ... 1063s Selecting previously unselected package libxss1:amd64. 1063s Preparing to unpack .../087-libxss1_1%3a1.2.3-1build2_amd64.deb ... 1063s Unpacking libxss1:amd64 (1:1.2.3-1build2) ... 1063s Selecting previously unselected package libtk8.6:amd64. 1063s Preparing to unpack .../088-libtk8.6_8.6.14-1_amd64.deb ... 1063s Unpacking libtk8.6:amd64 (8.6.14-1) ... 1063s Selecting previously unselected package libxt6:amd64. 1063s Preparing to unpack .../089-libxt6_1%3a1.2.1-1.1_amd64.deb ... 1063s Unpacking libxt6:amd64 (1:1.2.1-1.1) ... 1063s Selecting previously unselected package zip. 1063s Preparing to unpack .../090-zip_3.0-13_amd64.deb ... 1063s Unpacking zip (3.0-13) ... 1063s Selecting previously unselected package unzip. 1063s Preparing to unpack .../091-unzip_6.0-28ubuntu3_amd64.deb ... 1063s Unpacking unzip (6.0-28ubuntu3) ... 1063s Selecting previously unselected package xdg-utils. 1063s Preparing to unpack .../092-xdg-utils_1.1.3-4.1ubuntu3_all.deb ... 1063s Unpacking xdg-utils (1.1.3-4.1ubuntu3) ... 1063s Selecting previously unselected package r-base-core. 1063s Preparing to unpack .../093-r-base-core_4.3.2-1build1_amd64.deb ... 1063s Unpacking r-base-core (4.3.2-1build1) ... 1063s Selecting previously unselected package r-cran-littler. 1063s Preparing to unpack .../094-r-cran-littler_0.3.19-1_amd64.deb ... 1063s Unpacking r-cran-littler (0.3.19-1) ... 1063s Selecting previously unselected package littler. 1063s Preparing to unpack .../095-littler_0.3.19-1_all.deb ... 1063s Unpacking littler (0.3.19-1) ... 1063s Selecting previously unselected package node-bootstrap-sass. 1063s Preparing to unpack .../096-node-bootstrap-sass_3.4.3-2_all.deb ... 1063s Unpacking node-bootstrap-sass (3.4.3-2) ... 1063s Selecting previously unselected package node-html5shiv. 1063s Preparing to unpack .../097-node-html5shiv_3.7.3+dfsg-5_all.deb ... 1063s Unpacking node-html5shiv (3.7.3+dfsg-5) ... 1063s Selecting previously unselected package node-normalize.css. 1063s Preparing to unpack .../098-node-normalize.css_8.0.1-5_all.deb ... 1063s Unpacking node-normalize.css (8.0.1-5) ... 1063s Selecting previously unselected package pandoc-data. 1063s Preparing to unpack .../099-pandoc-data_3.1.3-1_all.deb ... 1063s Unpacking pandoc-data (3.1.3-1) ... 1063s Selecting previously unselected package pandoc. 1063s Preparing to unpack .../100-pandoc_3.1.3+ds-2_amd64.deb ... 1063s Unpacking pandoc (3.1.3+ds-2) ... 1064s Selecting previously unselected package r-cran-base64enc. 1064s Preparing to unpack .../101-r-cran-base64enc_0.1-3-3_amd64.deb ... 1064s Unpacking r-cran-base64enc (0.1-3-3) ... 1064s Selecting previously unselected package r-cran-rlang. 1064s Preparing to unpack .../102-r-cran-rlang_1.1.3-1_amd64.deb ... 1064s Unpacking r-cran-rlang (1.1.3-1) ... 1065s Selecting previously unselected package r-cran-fastmap. 1065s Preparing to unpack .../103-r-cran-fastmap_1.1.1-1_amd64.deb ... 1065s Unpacking r-cran-fastmap (1.1.1-1) ... 1065s Selecting previously unselected package r-cran-cachem. 1065s Preparing to unpack .../104-r-cran-cachem_1.0.8-1_amd64.deb ... 1065s Unpacking r-cran-cachem (1.0.8-1) ... 1065s Selecting previously unselected package r-cran-digest. 1065s Preparing to unpack .../105-r-cran-digest_0.6.34-1_amd64.deb ... 1065s Unpacking r-cran-digest (0.6.34-1) ... 1065s Selecting previously unselected package r-cran-ellipsis. 1065s Preparing to unpack .../106-r-cran-ellipsis_0.3.2-2_amd64.deb ... 1065s Unpacking r-cran-ellipsis (0.3.2-2) ... 1065s Selecting previously unselected package r-cran-htmltools. 1065s Preparing to unpack .../107-r-cran-htmltools_0.5.7-1_amd64.deb ... 1065s Unpacking r-cran-htmltools (0.5.7-1) ... 1065s Selecting previously unselected package r-cran-jquerylib. 1065s Preparing to unpack .../108-r-cran-jquerylib_0.1.4+dfsg-4_all.deb ... 1065s Unpacking r-cran-jquerylib (0.1.4+dfsg-4) ... 1065s Selecting previously unselected package r-cran-jsonlite. 1065s Preparing to unpack .../109-r-cran-jsonlite_1.8.8+dfsg-1_amd64.deb ... 1065s Unpacking r-cran-jsonlite (1.8.8+dfsg-1) ... 1065s Selecting previously unselected package r-cran-cli. 1065s Preparing to unpack .../110-r-cran-cli_3.6.2-1_amd64.deb ... 1065s Unpacking r-cran-cli (3.6.2-1) ... 1065s Selecting previously unselected package r-cran-glue. 1065s Preparing to unpack .../111-r-cran-glue_1.7.0-1_amd64.deb ... 1065s Unpacking r-cran-glue (1.7.0-1) ... 1065s Selecting previously unselected package r-cran-lifecycle. 1065s Preparing to unpack .../112-r-cran-lifecycle_1.0.4+dfsg-1_all.deb ... 1065s Unpacking r-cran-lifecycle (1.0.4+dfsg-1) ... 1065s Selecting previously unselected package r-cran-memoise. 1065s Preparing to unpack .../113-r-cran-memoise_2.0.1-1_all.deb ... 1065s Unpacking r-cran-memoise (2.0.1-1) ... 1065s Selecting previously unselected package r-cran-mime. 1065s Preparing to unpack .../114-r-cran-mime_0.12-1_amd64.deb ... 1065s Unpacking r-cran-mime (0.12-1) ... 1065s Selecting previously unselected package r-cran-fs. 1065s Preparing to unpack .../115-r-cran-fs_1.6.3+dfsg-1_amd64.deb ... 1065s Unpacking r-cran-fs (1.6.3+dfsg-1) ... 1065s Selecting previously unselected package r-cran-r6. 1065s Preparing to unpack .../116-r-cran-r6_2.5.1-1_all.deb ... 1065s Unpacking r-cran-r6 (2.5.1-1) ... 1065s Selecting previously unselected package r-cran-rappdirs. 1065s Preparing to unpack .../117-r-cran-rappdirs_0.3.3-1_amd64.deb ... 1065s Unpacking r-cran-rappdirs (0.3.3-1) ... 1065s Selecting previously unselected package r-cran-sass. 1065s Preparing to unpack .../118-r-cran-sass_0.4.8+dfsg-1_amd64.deb ... 1065s Unpacking r-cran-sass (0.4.8+dfsg-1) ... 1065s Selecting previously unselected package r-cran-bslib. 1065s Preparing to unpack .../119-r-cran-bslib_0.6.1+dfsg-1_all.deb ... 1065s Unpacking r-cran-bslib (0.6.1+dfsg-1) ... 1065s Selecting previously unselected package r-cran-commonmark. 1065s Preparing to unpack .../120-r-cran-commonmark_1.9.1-1_amd64.deb ... 1065s Unpacking r-cran-commonmark (1.9.1-1) ... 1065s Selecting previously unselected package r-cran-crayon. 1065s Preparing to unpack .../121-r-cran-crayon_1.5.2-1_all.deb ... 1065s Unpacking r-cran-crayon (1.5.2-1) ... 1065s Selecting previously unselected package r-cran-diffobj. 1065s Preparing to unpack .../122-r-cran-diffobj_0.3.5-1_amd64.deb ... 1065s Unpacking r-cran-diffobj (0.3.5-1) ... 1065s Selecting previously unselected package r-cran-evaluate. 1065s Preparing to unpack .../123-r-cran-evaluate_0.23-1_all.deb ... 1065s Unpacking r-cran-evaluate (0.23-1) ... 1065s Selecting previously unselected package r-cran-fontawesome. 1065s Preparing to unpack .../124-r-cran-fontawesome_0.5.2-1_all.deb ... 1065s Unpacking r-cran-fontawesome (0.5.2-1) ... 1065s Selecting previously unselected package r-cran-xfun. 1065s Preparing to unpack .../125-r-cran-xfun_0.41+dfsg-1_amd64.deb ... 1065s Unpacking r-cran-xfun (0.41+dfsg-1) ... 1065s Selecting previously unselected package r-cran-highr. 1065s Preparing to unpack .../126-r-cran-highr_0.10+dfsg-1_all.deb ... 1065s Unpacking r-cran-highr (0.10+dfsg-1) ... 1065s Selecting previously unselected package r-cran-pkgkitten. 1065s Preparing to unpack .../127-r-cran-pkgkitten_0.2.3-1_all.deb ... 1065s Unpacking r-cran-pkgkitten (0.2.3-1) ... 1065s Selecting previously unselected package r-cran-rcpp. 1065s Preparing to unpack .../128-r-cran-rcpp_1.0.12-1_amd64.deb ... 1065s Unpacking r-cran-rcpp (1.0.12-1) ... 1065s Selecting previously unselected package r-cran-later. 1065s Preparing to unpack .../129-r-cran-later_1.3.2+dfsg-1_amd64.deb ... 1065s Unpacking r-cran-later (1.3.2+dfsg-1) ... 1065s Selecting previously unselected package r-cran-magrittr. 1065s Preparing to unpack .../130-r-cran-magrittr_2.0.3-1_amd64.deb ... 1065s Unpacking r-cran-magrittr (2.0.3-1) ... 1065s Selecting previously unselected package r-cran-promises. 1065s Preparing to unpack .../131-r-cran-promises_1.2.1+dfsg-1_amd64.deb ... 1065s Unpacking r-cran-promises (1.2.1+dfsg-1) ... 1066s Selecting previously unselected package r-cran-httpuv. 1066s Preparing to unpack .../132-r-cran-httpuv_1.6.14+dfsg-1_amd64.deb ... 1066s Unpacking r-cran-httpuv (1.6.14+dfsg-1) ... 1066s Selecting previously unselected package r-cran-yaml. 1066s Preparing to unpack .../133-r-cran-yaml_2.3.8-1_amd64.deb ... 1066s Unpacking r-cran-yaml (2.3.8-1) ... 1066s Selecting previously unselected package libjs-mathjax. 1066s Preparing to unpack .../134-libjs-mathjax_2.7.9+dfsg-1_all.deb ... 1066s Unpacking libjs-mathjax (2.7.9+dfsg-1) ... 1066s Selecting previously unselected package r-cran-knitr. 1066s Preparing to unpack .../135-r-cran-knitr_1.45+dfsg-1_all.deb ... 1066s Unpacking r-cran-knitr (1.45+dfsg-1) ... 1066s Selecting previously unselected package r-cran-stringi. 1066s Preparing to unpack .../136-r-cran-stringi_1.8.3-1_amd64.deb ... 1066s Unpacking r-cran-stringi (1.8.3-1) ... 1066s Selecting previously unselected package r-cran-vctrs. 1066s Preparing to unpack .../137-r-cran-vctrs_0.6.5-1_amd64.deb ... 1066s Unpacking r-cran-vctrs (0.6.5-1) ... 1067s Selecting previously unselected package r-cran-stringr. 1067s Preparing to unpack .../138-r-cran-stringr_1.5.1-1_all.deb ... 1067s Unpacking r-cran-stringr (1.5.1-1) ... 1067s Selecting previously unselected package r-cran-tinytex. 1067s Preparing to unpack .../139-r-cran-tinytex_0.49-1_all.deb ... 1067s Unpacking r-cran-tinytex (0.49-1) ... 1067s Selecting previously unselected package libjs-modernizr. 1067s Preparing to unpack .../140-libjs-modernizr_2.6.2+ds1-5_all.deb ... 1067s Unpacking libjs-modernizr (2.6.2+ds1-5) ... 1067s Selecting previously unselected package r-cran-xtable. 1067s Preparing to unpack .../141-r-cran-xtable_1%3a1.8-4-2_all.deb ... 1067s Unpacking r-cran-xtable (1:1.8-4-2) ... 1067s Selecting previously unselected package r-cran-sourcetools. 1067s Preparing to unpack .../142-r-cran-sourcetools_0.1.7-1-1_amd64.deb ... 1067s Unpacking r-cran-sourcetools (0.1.7-1-1) ... 1067s Selecting previously unselected package r-cran-withr. 1067s Preparing to unpack .../143-r-cran-withr_2.5.0-1_all.deb ... 1067s Unpacking r-cran-withr (2.5.0-1) ... 1067s Selecting previously unselected package libjs-twitter-bootstrap-datepicker. 1067s Preparing to unpack .../144-libjs-twitter-bootstrap-datepicker_1.3.1+dfsg1-4.1_all.deb ... 1067s Unpacking libjs-twitter-bootstrap-datepicker (1.3.1+dfsg1-4.1) ... 1067s Selecting previously unselected package r-cran-shiny. 1067s Preparing to unpack .../145-r-cran-shiny_1.8.0+dfsg-1_all.deb ... 1067s Unpacking r-cran-shiny (1.8.0+dfsg-1) ... 1067s Selecting previously unselected package r-cran-rmarkdown. 1067s Preparing to unpack .../146-r-cran-rmarkdown_2.25+dfsg-3_all.deb ... 1067s Unpacking r-cran-rmarkdown (2.25+dfsg-3) ... 1067s Selecting previously unselected package r-cran-unitizer. 1067s Preparing to unpack .../147-r-cran-unitizer_1.4.20-1_all.deb ... 1067s Unpacking r-cran-unitizer (1.4.20-1) ... 1067s Setting up libjs-json (0~20221030+~1.0.8-1) ... 1067s Setting up javascript-common (11+nmu1) ... 1067s Setting up libgraphite2-3:amd64 (1.3.14-2) ... 1067s Setting up libpixman-1-0:amd64 (0.42.2-1) ... 1067s Setting up libsharpyuv0:amd64 (1.3.2-0.4) ... 1067s Setting up libpaper1:amd64 (1.1.29) ... 1067s 1067s Creating config file /etc/papersize with new version 1067s Setting up fonts-mathjax (2.7.9+dfsg-1) ... 1067s Setting up liblerc4:amd64 (4.0.0+ds-4ubuntu1) ... 1067s Setting up libjs-mathjax (2.7.9+dfsg-1) ... 1067s Setting up libxrender1:amd64 (1:0.9.10-1.1) ... 1067s Setting up libdatrie1:amd64 (0.2.13-3) ... 1067s Setting up libjs-popper.js (1.16.1+ds-6) ... 1067s Setting up libxcb-render0:amd64 (1.15-1) ... 1067s Setting up libjs-sifter.js (0.6.0+dfsg-3) ... 1067s Setting up fonts-glyphicons-halflings (1.009~3.4.1+dfsg-3) ... 1067s Setting up unzip (6.0-28ubuntu3) ... 1067s Setting up x11-common (1:7.7+23ubuntu2) ... 1068s Setting up node-html5shiv (3.7.3+dfsg-5) ... 1068s Setting up libdeflate0:amd64 (1.19-1) ... 1068s Setting up linux-libc-dev:amd64 (6.8.0-11.11) ... 1068s Setting up libjs-microplugin.js (0.0.3+dfsg-1.1) ... 1068s Setting up libxcb-shm0:amd64 (1.15-1) ... 1068s Setting up libpaper-utils (1.1.29) ... 1068s Setting up libgomp1:amd64 (14-20240303-1ubuntu1) ... 1068s Setting up libjs-modernizr (2.6.2+ds1-5) ... 1068s Setting up libjbig0:amd64 (2.1-6.1ubuntu1) ... 1068s Setting up libjs-es5-shim (4.6.7-2) ... 1068s Setting up zip (3.0-13) ... 1068s Setting up libblas3:amd64 (3.12.0-3) ... 1068s update-alternatives: using /usr/lib/x86_64-linux-gnu/blas/libblas.so.3 to provide /usr/lib/x86_64-linux-gnu/libblas.so.3 (libblas.so.3-x86_64-linux-gnu) in auto mode 1068s Setting up rpcsvc-proto (1.4.2-0ubuntu6) ... 1068s Setting up libquadmath0:amd64 (14-20240303-1ubuntu1) ... 1068s Setting up libjs-d3 (3.5.17-4) ... 1068s Setting up fonts-dejavu-mono (2.37-8) ... 1068s Setting up libmpc3:amd64 (1.3.1-1) ... 1068s Setting up libatomic1:amd64 (14-20240303-1ubuntu1) ... 1068s Setting up libtcl8.6:amd64 (8.6.13+dfsg-2) ... 1068s Setting up fonts-dejavu-core (2.37-8) ... 1068s Setting up libjpeg-turbo8:amd64 (2.1.5-2ubuntu1) ... 1068s Setting up libgfortran5:amd64 (14-20240303-1ubuntu1) ... 1068s Setting up libwebp7:amd64 (1.3.2-0.4) ... 1068s Setting up libubsan1:amd64 (14-20240303-1ubuntu1) ... 1068s Setting up libjs-highlight.js (9.18.5+dfsg1-2) ... 1068s Setting up libhwasan0:amd64 (14-20240303-1ubuntu1) ... 1068s Setting up libcrypt-dev:amd64 (1:4.4.36-4) ... 1068s Setting up libasan8:amd64 (14-20240303-1ubuntu1) ... 1068s Setting up liblua5.4-0:amd64 (5.4.6-3) ... 1068s Setting up libharfbuzz0b:amd64 (8.3.0-2) ... 1068s Setting up libthai-data (0.1.29-2) ... 1068s Setting up node-bootstrap-sass (3.4.3-2) ... 1068s Setting up libjs-prettify (2015.12.04+dfsg-1.1) ... 1068s Setting up libxss1:amd64 (1:1.2.3-1build2) ... 1068s Setting up libjs-bootstrap4 (4.6.1+dfsg1-4) ... 1068s Setting up pandoc-data (3.1.3-1) ... 1068s Setting up libtsan2:amd64 (14-20240303-1ubuntu1) ... 1068s Setting up libjs-jquery (3.6.1+dfsg+~3.5.14-1) ... 1068s Setting up libisl23:amd64 (0.26-3) ... 1068s Setting up libc-dev-bin (2.39-0ubuntu6) ... 1068s Setting up node-normalize.css (8.0.1-5) ... 1068s Setting up fonts-font-awesome (5.0.10+really4.7.0~dfsg-4.1) ... 1068s Setting up xdg-utils (1.1.3-4.1ubuntu3) ... 1068s update-alternatives: using /usr/bin/xdg-open to provide /usr/bin/open (open) in auto mode 1068s Setting up libcc1-0:amd64 (14-20240303-1ubuntu1) ... 1068s Setting up liblsan0:amd64 (14-20240303-1ubuntu1) ... 1068s Setting up libjs-bootstrap (3.4.1+dfsg-3) ... 1068s Setting up libitm1:amd64 (14-20240303-1ubuntu1) ... 1068s Setting up libjs-jquery-selectize.js (0.12.6+dfsg-1.1) ... 1068s Setting up libjpeg8:amd64 (8c-2ubuntu11) ... 1068s Setting up libice6:amd64 (2:1.0.10-1build2) ... 1068s Setting up liblapack3:amd64 (3.12.0-3) ... 1068s update-alternatives: using /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3 to provide /usr/lib/x86_64-linux-gnu/liblapack.so.3 (liblapack.so.3-x86_64-linux-gnu) in auto mode 1068s Setting up cpp-13-x86-64-linux-gnu (13.2.0-17ubuntu2) ... 1068s Setting up fontconfig-config (2.15.0-1ubuntu1) ... 1068s Setting up libjs-twitter-bootstrap-datepicker (1.3.1+dfsg1-4.1) ... 1068s Setting up libjs-jquery-datatables (1.11.5+dfsg-2) ... 1068s Setting up libthai0:amd64 (0.1.29-2) ... 1068s Setting up libjs-jquery-ui (1.13.2+dfsg-1) ... 1068s Setting up pandoc (3.1.3+ds-2) ... 1068s Setting up libgcc-13-dev:amd64 (13.2.0-17ubuntu2) ... 1068s Setting up libtiff6:amd64 (4.5.1+git230720-3ubuntu1) ... 1068s Setting up libc6-dev:amd64 (2.39-0ubuntu6) ... 1068s Setting up libfontconfig1:amd64 (2.15.0-1ubuntu1) ... 1068s Setting up libsm6:amd64 (2:1.2.3-1build2) ... 1068s Setting up libstdc++-13-dev:amd64 (13.2.0-17ubuntu2) ... 1068s Setting up cpp-x86-64-linux-gnu (4:13.2.0-7ubuntu1) ... 1068s Setting up fontconfig (2.15.0-1ubuntu1) ... 1070s Regenerating fonts cache... done. 1070s Setting up libxft2:amd64 (2.3.6-1) ... 1070s Setting up cpp-13 (13.2.0-17ubuntu2) ... 1070s Setting up gcc-13-x86-64-linux-gnu (13.2.0-17ubuntu2) ... 1070s Setting up libtk8.6:amd64 (8.6.14-1) ... 1070s Setting up libpango-1.0-0:amd64 (1.51.0+ds-4) ... 1070s Setting up libcairo2:amd64 (1.18.0-1) ... 1070s Setting up gcc-13 (13.2.0-17ubuntu2) ... 1070s Setting up libxt6:amd64 (1:1.2.1-1.1) ... 1070s Setting up cpp (4:13.2.0-7ubuntu1) ... 1070s Setting up libpangoft2-1.0-0:amd64 (1.51.0+ds-4) ... 1070s Setting up libpangocairo-1.0-0:amd64 (1.51.0+ds-4) ... 1070s Setting up g++-13-x86-64-linux-gnu (13.2.0-17ubuntu2) ... 1070s Setting up gcc-x86-64-linux-gnu (4:13.2.0-7ubuntu1) ... 1070s Setting up gcc (4:13.2.0-7ubuntu1) ... 1070s Setting up r-base-core (4.3.2-1build1) ... 1070s 1070s Creating config file /etc/R/Renviron with new version 1070s Setting up r-cran-crayon (1.5.2-1) ... 1070s Setting up r-cran-sourcetools (0.1.7-1-1) ... 1070s Setting up g++-x86-64-linux-gnu (4:13.2.0-7ubuntu1) ... 1070s Setting up r-cran-commonmark (1.9.1-1) ... 1070s Setting up r-cran-r6 (2.5.1-1) ... 1070s Setting up r-cran-pkgkitten (0.2.3-1) ... 1070s Setting up r-cran-magrittr (2.0.3-1) ... 1070s Setting up r-cran-rappdirs (0.3.3-1) ... 1070s Setting up r-cran-littler (0.3.19-1) ... 1070s Setting up r-cran-fs (1.6.3+dfsg-1) ... 1070s Setting up r-cran-rcpp (1.0.12-1) ... 1070s Setting up g++-13 (13.2.0-17ubuntu2) ... 1070s Setting up r-cran-diffobj (0.3.5-1) ... 1070s Setting up r-cran-rlang (1.1.3-1) ... 1070s Setting up littler (0.3.19-1) ... 1070s Setting up r-cran-xfun (0.41+dfsg-1) ... 1070s Setting up r-cran-withr (2.5.0-1) ... 1070s Setting up r-cran-mime (0.12-1) ... 1070s Setting up r-cran-base64enc (0.1-3-3) ... 1070s Setting up r-cran-digest (0.6.34-1) ... 1070s Setting up r-cran-yaml (2.3.8-1) ... 1070s Setting up r-cran-evaluate (0.23-1) ... 1070s Setting up r-cran-highr (0.10+dfsg-1) ... 1070s Setting up r-cran-glue (1.7.0-1) ... 1070s Setting up r-cran-xtable (1:1.8-4-2) ... 1070s Setting up r-cran-cli (3.6.2-1) ... 1070s Setting up r-cran-lifecycle (1.0.4+dfsg-1) ... 1070s Setting up r-cran-fastmap (1.1.1-1) ... 1070s Setting up r-cran-jsonlite (1.8.8+dfsg-1) ... 1070s Setting up r-cran-stringi (1.8.3-1) ... 1070s Setting up r-cran-later (1.3.2+dfsg-1) ... 1070s Setting up r-cran-tinytex (0.49-1) ... 1070s Setting up r-cran-knitr (1.45+dfsg-1) ... 1070s Setting up g++ (4:13.2.0-7ubuntu1) ... 1070s update-alternatives: using /usr/bin/g++ to provide /usr/bin/c++ (c++) in auto mode 1070s Setting up r-cran-cachem (1.0.8-1) ... 1070s Setting up build-essential (12.10ubuntu1) ... 1070s Setting up r-cran-unitizer (1.4.20-1) ... 1070s Setting up r-cran-vctrs (0.6.5-1) ... 1070s Setting up r-cran-ellipsis (0.3.2-2) ... 1070s Setting up r-cran-stringr (1.5.1-1) ... 1070s Setting up r-cran-memoise (2.0.1-1) ... 1070s Setting up r-cran-promises (1.2.1+dfsg-1) ... 1070s Setting up r-cran-htmltools (0.5.7-1) ... 1070s Setting up r-cran-sass (0.4.8+dfsg-1) ... 1070s Setting up r-cran-httpuv (1.6.14+dfsg-1) ... 1070s Setting up r-cran-fontawesome (0.5.2-1) ... 1070s Setting up r-cran-jquerylib (0.1.4+dfsg-4) ... 1070s Setting up r-cran-bslib (0.6.1+dfsg-1) ... 1070s Setting up r-cran-shiny (1.8.0+dfsg-1) ... 1070s Setting up r-cran-rmarkdown (2.25+dfsg-3) ... 1070s Processing triggers for libc-bin (2.39-0ubuntu6) ... 1070s Processing triggers for man-db (2.12.0-3) ... 1072s Processing triggers for install-info (7.1-3) ... 1075s Reading package lists... 1076s Building dependency tree... 1076s Reading state information... 1076s Starting pkgProblemResolver with broken count: 0 1076s Starting 2 pkgProblemResolver with broken count: 0 1076s Done 1076s The following NEW packages will be installed: 1076s autopkgtest-satdep 1076s 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. 1076s Need to get 0 B/696 B of archives. 1076s After this operation, 0 B of additional disk space will be used. 1076s Get:1 /tmp/autopkgtest.YT3vEq/2-autopkgtest-satdep.deb autopkgtest-satdep amd64 0 [696 B] 1077s Selecting previously unselected package autopkgtest-satdep. 1077s (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 ... 88182 files and directories currently installed.) 1077s Preparing to unpack .../2-autopkgtest-satdep.deb ... 1077s Unpacking autopkgtest-satdep (0) ... 1077s Setting up autopkgtest-satdep (0) ... 1078s (Reading database ... 88182 files and directories currently installed.) 1078s Removing autopkgtest-satdep (0) ... 1078s autopkgtest [02:42:04]: test run-unit-test: [----------------------- 1078s Begin testing t-browser.R 1078s 1078s R version 4.3.2 (2023-10-31) -- "Eye Holes" 1078s Copyright (C) 2023 The R Foundation for Statistical Computing 1078s Platform: x86_64-pc-linux-gnu (64-bit) 1078s 1078s R is free software and comes with ABSOLUTELY NO WARRANTY. 1078s You are welcome to redistribute it under certain conditions. 1078s Type 'license()' or 'licence()' for distribution details. 1078s 1078s R is a collaborative project with many contributors. 1078s Type 'contributors()' for more information and 1078s 'citation()' on how to cite R or R packages in publications. 1078s 1078s Type 'demo()' for some demos, 'help()' for on-line help, or 1078s 'help.start()' for an HTML browser interface to help. 1078s Type 'q()' to quit R. 1078s 1079s > source(file.path("_helper", "init.R")) 1079s > source(file.path("aammrtf", "ref.R")); make_ref_obj_funs("refobjs") 1079s > 1079s > options(unitizer.color = FALSE) 1079s > zero.env <- parent.env(.GlobalEnv) 1079s > obj.item <- new("unitizerItem", call = quote(1 + 1), env = new.env()) 1079s > obj.item@data@value <- list(2) 1079s > obj.item@data@output <- c("two", "dos", "due") 1079s > obj.item@data@conditions <- new("conditionList", .items = list(simpleError("hello"), 1079s + simpleWarning("What a warning"))) 1079s > obj.item@data@message <- vapply(unitizer:::as.list(obj.item@data@conditions), 1079s + conditionMessage, character(1L)) 1079s > obj.item@data@aborted <- TRUE 1079s > 1079s > # - "unitizerItem accessor functions work" ------------------------------------- 1079s > 1079s > obj.item$value 1079s [1] 2 1079s > obj.item$output 1079s [1] "two" "dos" "due" 1079s > obj.item$conditions 1079s Condition list with 2 conditions: 1079s 1. Error: hello 1079s 2. Warning: What a warning 1079s > 1079s > # Create a bunch of expressions for testing 1079s > 1079s > exps1 <- expression( 1079s + library(stats), 1079s + unitizer_sect("Section 1", { 1079s + 1 + 1 1079s + runif(20) 1079s + stop("woohoo") 1079s + "I'll be removed" 1079s + "I too will be removed" 1079s + }), 1079s + unitizer_sect("Section 2", { 1079s + "I three will be removed" 1079s + sample(20) 1079s + })) 1079s > exps2 <- expression( 1079s + library(stats), 1079s + unitizer_sect("Section 1", { 1079s + 1 + 1 1079s + runif(20) 1079s + stop("woohoo") 1079s + var <- 200 1079s + matrix(1:9, 3) 1079s + }), 1079s + unitizer_sect("Section 2", { 1079s + 1 + 20 1079s + var1 <- list(1, 2, 3) 1079s + sample(20) 1079s + matrix(1:9, ncol = 3) 1079s + lm(x ~ y, data.frame(x = 1:10, y = c(5, 3, 3, 2, 1, 8, 2, 1079s + 1, 4, 1.5))) 1079s + })) 1079s > my.unitizer <- new("unitizer", id = 1, zero.env = zero.env) 1079s > coi(my.unitizer <- my.unitizer + exps1) 1079s > my.unitizer2 <- new("unitizer", id = 2, zero.env = zero.env) 1079s > # make previous items into reference items 1079s > my.unitizer2 <- my.unitizer2 + my.unitizer@items.new 1079s > # now add back items to compare 1079s > coi(my.unitizer2 <- my.unitizer2 + exps2) 1079s > unitizer.prepped <- unitizer:::browsePrep(my.unitizer2, mode = "unitize") 1079s > 1079s > # NOTE: for some reason, changes in between revisions d9619db and a46e941 1079s > # should have caused the tests to fail, but didn't. We did not notice 1079s > # failures until we ran tests quite a bit later at ca9f540364. Not sure why 1079s > # this happened. The failures were due to the order of tests changing because 1079s > # we moved ignored tests to be in the same sub-section as the subsequent non- 1079s > # ignored tests 1079s > 1079s > # - "Can convert to data.frame" ------------------------------------------------ 1079s > 1079s > all.equal(unitizer:::as.data.frame(unitizer.prepped), rds("browse_df1")) 1079s [1] TRUE 1079s > 1079s > # - "unitizerBrowse correctly processes unitizer for display" ------------------ 1079s > 1079s > # force all tests to be reviewed so they will be shown 1079s > unitizer.prepped@mapping@reviewed <- 1079s + rep(TRUE, length(unitizer.prepped@mapping@reviewed)) 1079s > unitizer.prepped@mapping@review.val <- 1079s + rep("Y", length(unitizer.prepped@mapping@reviewed)) 1079s > all.equal(as.character(unitizer.prepped, 60), rds("browse_aschar1")) 1079s [1] TRUE 1079s > 1079s > # Alternating tests 1079s > unitizer.prepped@mapping@reviewed <- 1079s + as.logical(seq(length(unitizer.prepped@mapping@reviewed))%%2) 1079s > all.equal(as.character(unitizer.prepped, 60), rds("browse_aschar2")) 1079s [1] TRUE 1079s > 1079s > # Errors / warnings 1079s > try(as.character(unitizer.prepped, -1)) # positive 1079s Error in .local(x, ...) : 1079s Argument `width` must be a positive scalar numeric. 1079s > prep.narrow <- as.character(unitizer.prepped, 5) # too small 1079s Warning in .local(x, ...) : 1079s Selected display width too small, will be ignored 1079s > 1079s > all.equal(prep.narrow, rds("browse_ascharnarrow")) 1079s [1] TRUE 1079s > 1079s > # Colors work (should be last in this section) since the reference @global 1079s > 1079s > unitizer.prepped@global$unitizer.opts[["unitizer.color"]] <- TRUE 1079s > old.opt <- options(crayon.enabled = TRUE) 1079s > prep.color <- as.character(unitizer.prepped, 60) 1079s > all.equal(prep.color, rds("browse_aschar3")) 1079s [1] TRUE 1079s > unitizer.prepped@global$unitizer.opts[["unitizer.color"]] <- FALSE 1079s > options(old.opt) 1079s > 1079s > # - "processInput generates Correct Item Structure" ---------------------------- 1079s > 1079s > # Here we just test that the calls of each item are what we expect, making 1079s > # sure that different behavior for Y or N depending on sub-section type is 1079s > # observed correctly (e.g. a Y for new test means keep it, where as for 1079s > # removed test means don't keep it) 1079s > # For debugging: 1079s > # cbind(substr(unitizer:::deparseCalls(unitizer.prepped), 1, 15), as.character(unitizer.prepped@mapping@review.type), unitizer.prepped@mapping@review.val, unitizer.prepped@mapping@reviewed) 1079s > # cat(deparse(width=500, 1079s > # lapply( 1079s > # unitizer:::as.list(unitizer:::processInput(unitizer.prepped)), 1079s > # function(x) call("quote", slot(x, "call"))) 1079s > # ) ) 1079s > unitizer.prepped@mapping@reviewed <- 1079s + rep(TRUE, length(unitizer.prepped@mapping@reviewed)) 1079s > unitizer.prepped@mapping@review.val <- 1079s + rep("Y", length(unitizer.prepped@mapping@reviewed)) 1079s > 1079s > # Assume user accepted all tests 1079s > 1079s > lapply( 1079s + unitizer:::as.list(unitizer:::processInput(unitizer.prepped)), slot, "call" 1079s + ) 1079s [[1]] 1079s library(stats) 1079s 1079s [[2]] 1079s runif(20) 1079s 1079s [[3]] 1079s var <- 200 1079s 1079s [[4]] 1079s matrix(1:9, 3) 1079s 1079s [[5]] 1079s 1 + 1 1079s 1079s [[6]] 1079s stop("woohoo") 1079s 1079s [[7]] 1079s var1 <- list(1, 2, 3) 1079s 1079s [[8]] 1079s sample(20) 1079s 1079s [[9]] 1079s 1 + 20 1079s 1079s [[10]] 1079s matrix(1:9, ncol = 3) 1079s 1079s [[11]] 1079s lm(x ~ y, data.frame(x = 1:10, y = c(5, 3, 3, 2, 1, 8, 2, 1, 1079s 4, 1.5))) 1079s 1079s > # Assume user accepted all but 1, 4, 6 and 11, note it isn't completely 1079s > # obvious what should be kept since an N for anything but a new and passed 1079s > # test will result in some object remaining in the list (typically the 1079s > # reference copy thereof) 1079s > unitizer.prepped@mapping@review.val[] <- "N" 1079s > unitizer.prepped@mapping@review.val[c(2, 6, 8, 12)] <- "Y" 1079s > lapply( 1079s + unitizer:::as.list(unitizer:::processInput(unitizer.prepped)), slot, "call" 1079s + ) 1079s [[1]] 1079s runif(20) 1079s 1079s [[2]] 1079s stop("woohoo") 1079s 1079s [[3]] 1079s [1] "I'll be removed" 1079s 1079s [[4]] 1079s sample(20) 1079s 1079s [[5]] 1079s matrix(1:9, ncol = 3) 1079s 1079s [[6]] 1079s [1] "I three will be removed" 1079s 1079s > # - "unitizerBrowse subsetting works" ------------------------------------------ 1079s > 1079s > # note single bracket subsetting for `unitizerBrowse` overrides the `unitizerList` 1079s > # subsetting 1079s > unitizer:::deparseCalls(unitizer:::extractItems(unitizer.prepped[c(4, 8, 10)])) 1079s [1] "matrix(1:9, 3)" "\"I too will be removed\"" 1079s [3] "sample(20)" 1079s > unitizer:::deparseCalls(unitizer:::extractItems(unitizer.prepped[c(2, 3, 11)])) 1079s [1] "runif(20)" "var <- 200" "1 + 20" 1079s > 1079s > # - "Reference section mapping works" ------------------------------------------ 1079s > 1079s > # Copy over just two sections 1079s > my.unitizer3 <- new("unitizer", id = 3, zero.env = zero.env) + 1079s + my.unitizer2@items.new[-(2:6)] 1079s > # Exclude section two tests 1079s > # sections should copy over 1079s > my.unitizer3 <- unitizer:::refSections(my.unitizer3, my.unitizer2) 1079s > # just copy over 1st and 3rd sections 1079s > identical(my.unitizer3@sections.ref, my.unitizer2@sections[-2]) 1079s [1] TRUE 1079s > my.unitizer3@section.ref.map 1079s [1] 1 2 2 2 2 2 1079s > 1079s > # Make sure "removed" sections are NA when kept 1079s > unitizer.prepped@mapping@reviewed <- 1079s + rep(TRUE, length(unitizer.prepped@mapping@reviewed)) 1079s > # don't delete removed 1079s > unitizer.prepped@mapping@review.val <- 1079s + ifelse(unitizer.prepped@mapping@review.type %in% c("Removed"), "N", "Y") 1079s > items.processed <- unitizer:::processInput(unitizer.prepped) 1079s > vapply(unitizer:::as.list(items.processed), slot, 1L, "section.id") 1079s [1] 1 2 2 2 2 2 NA NA 3 3 3 3 3 NA 1079s > 1079s > # Now try to re-establish sections with removed tests 1079s > my.unitizer4 <- 1079s + new("unitizer", id = 4, zero.env = zero.env) + items.processed 1079s > # sections should copy over 1079s > my.unitizer4 <- unitizer:::refSections(my.unitizer4, my.unitizer2) 1079s > is(my.unitizer4@sections.ref[[4L]], "unitizerSectionNA") 1079s [1] TRUE 1079s > my.unitizer4@section.ref.map 1079s [1] 1 2 2 2 2 2 4 4 3 3 3 3 3 4 1079s > 1079s > # - "Item Extraction" ---------------------------------------------------------- 1079s > 1079s > items <- unitizer:::extractItems(unitizer.prepped) 1079s > item.calls <- vapply( 1079s + unitizer:::as.list(items), 1079s + function(x) 1079s + paste0(deparse(x@call, width.cutoff = 500), collapse = ""), character(1L) 1079s + ) 1079s > item.types <- vapply(unitizer:::as.list(items), slot, FALSE, "reference") 1079s > item.ids <- vapply(unitizer:::as.list(items), slot, 1L, "id") 1079s > item.df <- data.frame(item.calls, item.types, item.ids, stringsAsFactors = FALSE) 1079s > 1079s > all.equal(item.df[order(item.types, item.ids),], rds("browse_itemord")) 1079s [1] TRUE 1079s > 1079s PASS 1079s Begin testing t-capture.R 1079s 1079s R version 4.3.2 (2023-10-31) -- "Eye Holes" 1079s Copyright (C) 2023 The R Foundation for Statistical Computing 1079s Platform: x86_64-pc-linux-gnu (64-bit) 1079s 1079s R is free software and comes with ABSOLUTELY NO WARRANTY. 1079s You are welcome to redistribute it under certain conditions. 1079s Type 'license()' or 'licence()' for distribution details. 1079s 1079s R is a collaborative project with many contributors. 1079s Type 'contributors()' for more information and 1079s 'citation()' on how to cite R or R packages in publications. 1079s 1079s Type 'demo()' for some demos, 'help()' for on-line help, or 1079s 'help.start()' for an HTML browser interface to help. 1079s Type 'q()' to quit R. 1079s 1079s > source(file.path("_helper", "init.R")) 1080s > source(file.path("aammrtf", "ref.R")); make_ref_obj_funs("capture") 1080s > 1080s > # # Messing around trying to understand seek... 1080s > # f <- tempfile() 1080s > # con <- file(f, "w+b") 1080s > # writeChar(paste(letters, LETTERS, collapse=" "), con) 1080s > # readChar(con, 20) 1080s > # pos <- seek(con, origin="current") 1080s > # seek(con, pos, rw="write") 1080s > # writeChar("xxxxxxxxx", con) 1080s > # readChar(con, 3) 1080s > # pos <- seek(con, origin="current") 1080s > # seek(con, pos, rw="write") 1080s > # writeChar("yyyyy", con) 1080s > # close(con) 1080s > # readLines(f) 1080s > # unlink(f) 1080s > 1080s > # - "get_capture" -------------------------------------------------------------- 1080s > 1080s > old.max <- options(unitizer.max.capture.chars = 100L) 1080s > cons <- new("unitizerCaptCons") 1080s > base.char <- paste(rep(letters, 10), collapse = " ") 1080s > writeChar(base.char, cons@out.c) 1080s > 1080s > # Error "Argument `chrs.max`" 1080s > try(unitizer:::get_text_capture(cons, "output", TRUE, chrs.max = "howdy")) 1080s Error in unitizer:::get_text_capture(cons, "output", TRUE, chrs.max = "howdy") : 1080s Argument `chrs.max` must be integer(1L) and greater than 100L; using 200000L for nowTRUE 1080s > # Warn max capt 1080s > cpt0 <- unitizer:::get_text_capture(cons, "output", TRUE) 1080s Warning in get_text(slot(cons, if (type == "message") "err.c" else "out.c")) : 1080s Reached maximum text capture characters 100; see `getOption("unitizer.max.capture.chars")` 1080s > nchar(cpt0) 1080s [1] 100 1080s > base.char.2 <- paste(rev(rep(letters, 10)), collapse = " ") 1080s > writeChar(base.char.2, cons@err.c) 1080s > sink(cons@err.c, type = "message") 1080s > 1080s > cpt0.err <- unitizer:::get_text_capture(cons, "message", FALSE) 1080s Warning in get_text(slot(cons, if (type == "message") "err.c" else "out.c")) : 1080s Reached maximum text capture characters 100; see `getOption("unitizer.max.capture.chars")` 1080s > sink(type = "message") 1080s > all.equal(cpt0.err, substr(base.char.2, 1, 100)) 1080s [1] TRUE 1080s > 1080s > ## for some reason this test stopped working; not sure why, need to look into 1080s > ## it; seemingly it messes up the pointer for the next read 1080s > # writeChar("xxxxxx", cons@out.c) 1080s > # cpt2 <- unitizer:::get_text_capture(cons, "output", TRUE) 1080s > # expect_equal("xxxxxx", cpt2) 1080s > writeChar(paste0(rep("yyyyyyy", 20L), collapse = ""), cons@out.c) 1080s > # warn max capt 1080s > cpt1 <- unitizer:::get_text_capture(cons, "output", TRUE) 1080s Warning in get_text(slot(cons, if (type == "message") "err.c" else "out.c")) : 1080s Reached maximum text capture characters 100; see `getOption("unitizer.max.capture.chars")` 1080s > all.equal(cpt1, paste0(rep("y", 100), collapse = "")) 1080s [1] TRUE 1080s > unitizer:::close_and_clear(cons) 1080s > options(old.max) 1080s > 1080s > # - "get_text" ----------------------------------------------------------------- 1080s > 1080s > old.max <- options(unitizer.max.capture.chars = 100L) 1080s > f <- tempfile() 1080s > con <- file(f, "w+b") 1080s > base.char <- paste(letters, collapse = " ") 1080s > sink(con, type = "message") 1080s > cat(base.char, file = stderr()) 1080s > # this needs to temporarily switch the sink to be able to issue the warning 1080s > # Warn: "Reached maximum" 1080s > unitizer:::get_text(con, 10) 1080s Warning in unitizer:::get_text(con, 10) : 1080s Reached maximum text capture characters 10; see `getOption("unitizer.max.capture.chars")` 1080s [1] "a b c d e " 1080s > # should still be to writing to our file, 10 chars in 1080s > cat("boogiewoogy", file = stderr()) 1080s > sink(type = "message") 1080s > suppressWarnings(readLines(f)) # incomplete final line... 1080s [1] "a b c d e boogiewoogy l m n o p q r s t u v w x y z" 1080s > 1080s > options(old.max) 1080s > unlink(f) 1080s > 1080s > # - "connection capture works" ------------------------------------------------- 1080s > 1080s > out.num <- as.integer(stdout()) 1080s > err.num <- as.integer(stderr()) 1080s > err.con <- getConnection(sink.number(type = "message")) 1080s > cons <- new("unitizerCaptCons") 1080s > cons <- unitizer:::set_capture(cons) 1080s > cat("hello there\n") 1080s > cat("goodbye there\n", file = stderr()) 1080s > capt <- unitizer:::get_capture(cons) 1080s > cons <- unitizer:::unsink_cons(cons) 1080s > capt 1080s $output 1080s [1] "hello there\n" 1080s 1080s $message 1080s [1] "goodbye there\n" 1080s 1080s > # expect_identical(as.integer(stdout()), out.num) 1080s > identical(as.integer(stdout()), out.num) 1080s [1] TRUE 1080s > identical(as.integer(stderr()), err.num) 1080s [1] TRUE 1080s > unitizer:::close_and_clear(cons) 1080s > 1080s > # Now, here we add an extra stdout sink. In both cases unsink_cons will not 1080s > # touch the sinks since we're not in an expected state, leaving 1080s > # close_and_clear to cleanup 1080s > err.con <- getConnection(sink.number(type = "message")) 1080s > cons <- new("unitizerCaptCons") 1080s > cons <- unitizer:::set_capture(cons) 1080s > cat("there hello\n") 1080s > # message does not work with testthat 1080s > cat("there goodbye\n", file = stderr()) 1080s > f1 <- tempfile() 1080s > f2 <- tempfile() 1080s > c2 <- file(f2, "w") 1080s > sink(f1) 1080s > sink(c2, type = "message") 1080s > cat("12 there hello\n") 1080s > # message does not work with testthat 1080s > cat("12 there goodbye\n", file = stderr()) 1080s > capt <- unitizer:::get_capture(cons) 1080s > cons <- unitizer:::unsink_cons(cons) 1080s > unitizer:::close_and_clear(cons) 1080s > attr(cons@out.c, "waive") 1080s [1] TRUE 1080s > attr(cons@err.c, "waive") 1080s [1] TRUE 1080s > capt 1080s $output 1080s [1] "there hello\n" 1080s 1080s $message 1080s [1] "there goodbye\n" 1080s 1080s > readLines(f1) 1080s [1] "12 there hello" 1080s > readLines(f2) 1080s [1] "12 there goodbye" 1080s > close(c2) 1080s > unlink(c(f1, f2)) 1080s > 1080s > # Same, but this time close the sinks properly, so the connections should not 1080s > # be waived 1080s > err.con <- getConnection(sink.number(type = "message")) 1080s > cons <- new("unitizerCaptCons") 1080s > cons <- unitizer:::set_capture(cons) 1080s > cat("there hello\n") 1080s > # message does not work with testthat 1080s > cat("there goodbye\n", file = stderr()) 1080s > f1 <- tempfile() 1080s > f2 <- tempfile() 1080s > c2 <- file(f2, "w") 1080s > sink(f1) 1080s > sink(c2, type = "message") 1080s > cat("12 there hello\n") 1080s > # message does not work with testthat 1080s > cat("12 there goodbye\n", file = stderr()) 1080s > sink() 1080s > sink(cons@err.c, type = "message") 1080s > capt <- unitizer:::get_capture(cons) 1080s > cons <- unitizer:::unsink_cons(cons) 1080s > attr(cons@out.c, "waive") # NULL 1080s NULL 1080s > attr(cons@err.c, "waive") # NULL 1080s NULL 1080s > capt 1080s $output 1080s [1] "there hello\n" 1080s 1080s $message 1080s [1] "there goodbye\n" 1080s 1080s > unitizer:::close_and_clear(cons) 1080s > readLines(f1) 1080s [1] "12 there hello" 1080s > readLines(f2) 1080s [1] "12 there goodbye" 1080s > close(c2) 1080s > unlink(c(f1, f2)) 1080s > # Try to mess up sink counter by replacing the real sink with a fake sink 1080s > # should lead to a waived connection 1080s > cons <- new("unitizerCaptCons") 1080s > cons <- unitizer:::set_capture(cons) 1080s > f1 <- tempfile() 1080s > sink() 1080s > sink(f1) 1080s > capt <- unitizer:::get_capture(cons) 1080s > cons <- unitizer:::unsink_cons(cons) 1080s > attr(cons@out.c, "waive") 1080s > attr(cons@err.c, "waive") 1080s > capt 1080s > # Try to fix so that we don't get a full stack release error 1080s > sink() 1080s > sink(cons@out.c) 1080s > unitizer:::close_and_clear(cons) 1080s > unlink(f1) 1080s > # helper function 1080s > f1 <- tempfile() 1080s > f2 <- tempfile() 1080s > c1 <- file(f1, "w+b") 1080s > c2 <- file(f2, "w+b") 1080s > sink(c2) 1080s > unitizer:::is_stdout_sink(f1) 1080s > sink() 1080s > sink(c1) 1080s > unitizer:::is_stdout_sink(f1) 1080s > sink() 1080s > close(c1) 1080s > close(c2) 1080s > unlink(c(f1, f2)) 1080s > 1080s > # - "connection breaking tests" ------------------------------------------------ 1080s > 1080s > # # These tests cannot be run as they blow away the entire sink stack which can 1080s > # # mess up any testing done under capture 1080s > # 1080s > # test_that("connection breaking tests", { 1080s > # # Test the more pernicious error where we substitute the stdout sink 1080s > # 1080s > # cons <- new("unitizerCaptCons") 1080s > # cons <- unitizer:::set_capture(cons) 1080s > # cat("woohoo\n") 1080s > # cat("yohooo\n", file=stderr()) 1080s > # f1 <- tempfile() 1080s > # sink() 1080s > # sink(f1) 1080s > # capt <- unitizer:::get_capture(cons) 1080s > # cons <- unitizer:::unsink_cons(cons) 1080s > # sink() 1080s > # unlink(f1) 1080s > # expect_true(attr(cons@out.c, "waive")) 1080s > # expect_null(attr(cons@err.c, "waive")) 1080s > # expect_identical( 1080s > # capt, list(output = "woohoo\n", message = "yohooo\n") 1080s > # ) 1080s > # expect_identical( 1080s > # unitizer:::close_and_clear(cons), 1080s > # structure(c(FALSE, TRUE), .Names = c("output", "message")) 1080s > # ) 1080s > # }) 1080s > 1080s > # - "close_and_clear" ---------------------------------------------------------- 1080s > 1080s > # need some careful handling to make sure we don't mess up the testthat's 1080s > # sinking (legacy behavior) 1080s > cons <- new("unitizerCaptCons") 1080s > err.con <- cons@stderr.con 1080s > on.exit(sink(err.con, type = "message")) 1080s > # intended to cause an error 1080s > cons@stderr.con <- list() 1080s > # msg: "Unable to restore original " 1080s > cons.txt <- capture.output(status <- unitizer:::close_and_clear(cons), 1080s + type = "message") 1080s | Unable to restore original message sink, setting back to normal stderr 1080s 1080s > any(grepl("connection", cons.txt)) 1080s [1] TRUE 1080s > sink(err.con, type = "message") 1080s > status["message"] 1080s message 1080s FALSE 1080s > 1080s > # - "eval with capt" ----------------------------------------------------------- 1080s > 1080s > suppressWarnings(glob <- unitizer:::unitizerGlobal$new()) 1080s > all.equal( 1080s + (capt <- unitizer:::eval_with_capture(quote(1 + 1), global = glob))[1:8], 1080s + rds(100) 1080s + ) 1080s [1] TRUE 1080s > is(capt[[9]], "unitizerCaptCons") 1080s [1] TRUE 1080s > all.equal( 1080s + ( 1080s + capt <- unitizer:::eval_with_capture( 1080s + cat("wow\n", file = stderr()), global = glob) 1080s + )[1:8], 1080s + rds(200) 1080s + ) 1080s [1] TRUE 1080s > is(capt[[9]], "unitizerCaptCons") 1080s [1] TRUE 1080s > 1080s PASS 1080s Begin testing t-change.R 1080s 1080s R version 4.3.2 (2023-10-31) -- "Eye Holes" 1080s Copyright (C) 2023 The R Foundation for Statistical Computing 1080s Platform: x86_64-pc-linux-gnu (64-bit) 1080s 1080s R is free software and comes with ABSOLUTELY NO WARRANTY. 1080s You are welcome to redistribute it under certain conditions. 1080s Type 'license()' or 'licence()' for distribution details. 1080s 1080s R is a collaborative project with many contributors. 1080s Type 'contributors()' for more information and 1080s 'citation()' on how to cite R or R packages in publications. 1080s 1080s Type 'demo()' for some demos, 'help()' for on-line help, or 1080s 'help.start()' for an HTML browser interface to help. 1080s Type 'q()' to quit R. 1080s 1080s > source(file.path("_helper", "init.R")) 1081s > 1081s > # - "Construction works" ------------------------------------------------------- 1081s > 1081s > # invalid slot 1081s > try(new("unitizerChanges", removed = 1:3)) 1081s Error in validObject(.Object) : 1081s invalid class "unitizerChanges" object: slot `@`removed must be of length 2 1081s > # invalid/ got character 1081s > try(new("unitizerChanges", failed = letters[1:2])) 1081s Error in validObject(.Object) : 1081s invalid class "unitizerChanges" object: invalid object for slot "failed" in class "unitizerChanges": got class "character", should be or extend class "integer" 1081s > 1081s > # - "Output as expected" ------------------------------------------------------- 1081s > 1081s > my.changes <- new("unitizerChanges", failed = c(1L, 10L), new = c(1L, 1081s + 5L), removed = c(2L, 4L), corrupted = c(3L, 8L)) 1081s > show(my.changes) 1081s - Replacing 1 out of 10 failed tests 1081s - Adding 1 out of 5 new tests 1081s - Removing 2 out of 4 removed tests 1081s - Replacing 3 out of 8 tests with errors 1081s > 1081s > # - "Length Works" ------------------------------------------------------------- 1081s > 1081s > length(my.changes) # 7 1081s [1] 7 1081s > 1081s PASS 1081s Begin testing t-demo.R 1081s 1081s R version 4.3.2 (2023-10-31) -- "Eye Holes" 1081s Copyright (C) 2023 The R Foundation for Statistical Computing 1081s Platform: x86_64-pc-linux-gnu (64-bit) 1081s 1081s R is free software and comes with ABSOLUTELY NO WARRANTY. 1081s You are welcome to redistribute it under certain conditions. 1081s Type 'license()' or 'licence()' for distribution details. 1081s 1081s R is a collaborative project with many contributors. 1081s Type 'contributors()' for more information and 1081s 'citation()' on how to cite R or R packages in publications. 1081s 1081s Type 'demo()' for some demos, 'help()' for on-line help, or 1081s 'help.start()' for an HTML browser interface to help. 1081s Type 'q()' to quit R. 1081s 1081s > source(file.path("aammrtf", "mock.R")) 1081s > source(file.path("_helper", "init.R")) 1081s > source(file.path("_helper", "pkgs.R")) 1081s Install Packages 1084s Setup Demos 1084s > 1084s > # Mostly makes sure the demo steps work, but since it is a convenient way of 1084s > # generating a unitizer with actual errors and so forth, we use it to test a few 1084s > # other things as well in the context of those unitizers 1084s > 1084s > # - "in_pkg" ------------------------------------------------------------------- 1084s > 1084s > base.dir <- file.path(FLM, "tests", "extra") 1084s > in.pkg.file <- file.path(base.dir, "inpkg.R") 1084s > 1084s > unitizer:::read_line_set_vals(c("Q")) 1084s > txt1 <- unitizer:::capture_output(unitize(in.pkg.file, interactive.mode = TRUE)) 1085s > # `sub` needed due to inconsistencies in R 3.4 and 3.3 for top level error 1085s > # messages 1085s > txt1$message <- sub("^Error.*:", "", txt1$message) 1085s > txt1 1085s - Output ----------------------------------------------------------------------- 1085s 1085s 1085s +------------------------------------------------------------------------------+ 1085s | unitizer for: extra/inpkg.R | 1085s +------------------------------------------------------------------------------+ 1085s 1085s Pass Fail New 1085s - - 1 1085s ........................... 1085s - - 1 1085s 1085s - New -------------------------------------------------------------------------- 1085s 1085s | The following test is new. Add test to store ([Y]es, [N]o, [P]rev, [B]rowse, 1085s | [R]erun, [Q]uit, [H]elp)? 1085s 1085s # should fail normally, but return TRUE if run in fastlm 1085s 1085s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 1085s > hidden_fun() 1085s 1085s unitizer> Q 1085s 1085s | unitizer unchanged. 1085s 1085s - Message ---------------------------------------------------------------------- 1085s 1085s could not find function "hidden_fun" 1085s | No changes recorded. 1085s > unitizer:::read_line_set_vals(c("Q")) 1085s > unitize(in.pkg.file, state = in_pkg(), interactive.mode = TRUE) 1085s 1085s +------------------------------------------------------------------------------+ 1085s | unitizer for: extra/inpkg.R | 1085s +------------------------------------------------------------------------------+ 1085s 1085s Pass Fail New 1085s - - 1 1085s ........................... 1085s - - 1 1085s 1085s - New -------------------------------------------------------------------------- 1085s 1085s | The following test is new. Add test to store ([Y]es, [N]o, [P]rev, [B]rowse, 1085s | [R]erun, [Q]uit, [H]elp)? 1085s 1085s # should fail normally, but return TRUE if run in fastlm 1085s 1085s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 1085s > hidden_fun() 1085s [1] TRUE 1085s 1085s unitizer> Q 1085s 1085s | No changes recorded. 1085s | unitizer unchanged. 1085s 1085s > unitizer:::read_line_set_vals(c("Q")) 1085s > try(unitize(in.pkg.file, state = in_pkg("ASDFASDFA"), interactive.mode = TRUE)) 1085s 1085s Error in loadNamespace(name) : there is no package called 'ASDFASDFA' 1085s Error in in_pkg_to_env(x.raw@par.env, test.files) : 1085s Unable to load "ASDFASDFA" namespace to use as parent environment; see `? 1085s unitizerState` for instructions on how to specify a package namespace as a 1085s parent environment for tests. 1085s Error in as.state(state, test.files) : 1085s Unable to convert `par.env` value to a namespace environment 1085s Error in unitize_core(test.file.inf, list(store.id.inf), state = state, : 1085s Argument `state` could not be evaluated. 1085s > 1085s > # - "copy fastlm dir works" ---------------------------------------------------- 1085s > 1085s > sort(tolower(list.files("."))) 1085s [1] "description" "man" "namespace" "r" 1085s [5] "tests" "utzflm.rcheck" 1085s > readLines(file.path(".", "DESCRIPTION"))[[5L]] # v0.1.0 1085s [1] "Version: 0.1.0" 1085s > update_fastlm(".", version = "0.1.1") 1085s > readLines(file.path(".", "DESCRIPTION"))[[5L]] 1085s [1] "Version: 0.1.1" 1085s > update_fastlm(".", version = "0.1.2") 1085s > readLines(file.path(".", "DESCRIPTION"))[[5L]] 1085s [1] "Version: 0.1.2" 1085s > 1085s > # - "show_file" ---------------------------------------------------------------- 1085s > 1085s > f <- tempfile() 1085s > cat("this is a\ntest code\nfile\n", file = f) 1085s > file.show <- capture.output(show_file(f)) 1085s > file.show[[1L]] 1085s [1] "+---------------+" 1085s > start.file <- grep("+---+-----------+", file.show, fixed = TRUE) 1085s > length(start.file) # 2 1085s [1] 2 1085s > writeLines(file.show[start.file[[1L]]:start.file[[2L]]]) 1085s +---+-----------+ 1085s | 1 | this is a | 1085s | 2 | test code | 1085s | 3 | file | 1085s +---+-----------+ 1085s > unlink(f) 1085s > 1085s > # Run actual demo bits; note we want to force `interactive.mode=TRUE` so that 1085s > # `read_line_vals` values are used as user input; note that until we fix 1085s > # / rationalize how sinking behaves within unitizer when the standard streams 1085s > # come in sunk, we won't be able to fully test everything, since for example 1085s > # the display of the captured stdout just won't happen. 1085s > 1085s > # - "demo create worked" ------------------------------------------------------- 1085s > 1085s > # In tests, initial version of package should be 0.1.0; the test store 1085s > # does not exist so it doesn't get overwritten with subsequent updates 1085s > # Note the initial install happens in the test running script 1085s > 1085s > unitizer:::update_fastlm(".", version = "0.1.0") 1085s > inst_pak(".") 1086s > unitizer:::read_line_set_vals(c("Y", "Y", "Y", "Y", "Y")) 1086s > untz <- unitize(FLM.TEST.FILE, interactive.mode = TRUE) 1086s 1086s +------------------------------------------------------------------------------+ 1086s | unitizer for: unitizer/fastlm1.R | 1086s +------------------------------------------------------------------------------+ 1086s 1086s Pass Fail New 1086s - - 4 1086s ........................... 1086s - - 4 1086s 1086s - New -------------------------------------------------------------------------- 1086s 1086s | The 4 tests in this section are new. Add tests to store ([Y]es, [N]o, [P]rev, 1086s | [B]rowse, [R]erun, [Q]uit, [H]elp)? 1086s 1086s # Assignments and calls to `library` are not considered tests by 1086s # `unitizer` so you will not need to review them 1086s 1086s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 1086s > dat <- data.frame(x = 1:100, y = (1:100)^2) 1086s > res <- fastlm(dat$x, dat$y) 1086s 1086s # The `unitizer>` prompt is like the standard R prompt. You may 1086s # enter expressions such as `lm(y ~ x, dat)$coefficients`, or 1086s # `str(res)`. 1086s # 1086s # Once you are done reviewing, you need to tell `unitizer` you 1086s # accept the test by typing 'Y' at the prompt. Enter 'H' for help. 1086s 1086s > res 1086s intercept slope rsq 1086s -1717.000 101.000 0.939 1086s attr(,"class") 1086s [1] "fastlm" 1086s 1086s unitizer> Y 1086s 1086s # There are three more tests to review; accept them with 'Y' 1086s 1086s > get_slope(res) 1086s [1] 101 1086s 1086s unitizer> Y 1086s 1086s > get_rsq(res) 1086s [1] 0.939 1086s 1086s unitizer> Y 1086s 1086s # This last test is expected to cause an error; press 'Y' to 1086s # accept it so future checks can confirm the same error persists 1086s 1086s > fastlm(1:100, 1:10) 1086s Error in fastlm(1:100, 1:10) : 1086s Arguments `x` and `y` must be the same length. 1086s 1086s unitizer> Y 1086s 1086s = Finalize Unitizer ============================================================ 1086s 1086s | You will IRREVERSIBLY modify 'unitizer/fastlm1.unitizer' by: 1086s | - Adding 4 out of 4 new tests 1086s 1086s | Update unitizer ([Y]es, [N]o, [P]rev, [B]rowse, [R]erun)? 1086s 1086s unitizer> Y 1086s 1086s | unitizer updated. 1086s 1086s > is(untz, "unitizer_result") 1086s [1] TRUE 1086s > print(untz) 1086s Test File: tests/unitizer/fastlm1.R 1086s Store ID: tests/unitizer/fastlm1.unitizer 1086s 1086s id call ignored status user reviewed 1086s 1 1 library(utzflm, lib.loc = g... * New N FALSE 1086s 2 2 dat <- data.frame(x = 1:100... * New N FALSE 1086s 3 3 res <- fastlm(dat$x, dat$y) * New N FALSE 1086s 4 4 res New Y TRUE 1086s 5 5 get_slope(res) New Y TRUE 1086s 6 6 get_rsq(res) New Y TRUE 1086s 7 7 fastlm(1:100, 1:10) New Y TRUE 1086s > # Re-running doesn't change unitizer 1086s > untz2 <- unitize(FLM.TEST.FILE, interactive.mode = TRUE) 1086s 1087s | 4/4 tests passed; nothing to review. 1087s 1087s > print(untz2) 1087s Test File: tests/unitizer/fastlm1.R 1087s Store ID: tests/unitizer/fastlm1.unitizer 1087s 1087s id call ignored status user reviewed 1087s 1 1 library(utzflm, lib.loc = g... * Passed Y FALSE 1087s 2 2 dat <- data.frame(x = 1:100... * Passed Y FALSE 1087s 3 3 res <- fastlm(dat$x, dat$y) * Passed Y FALSE 1087s 4 4 res Passed Y FALSE 1087s 5 5 get_slope(res) Passed Y FALSE 1087s 6 6 get_rsq(res) Passed Y FALSE 1087s 7 7 fastlm(1:100, 1:10) Passed Y FALSE 1087s 1087s You chose NOT to save these changes to the unitizer store 1087s > # Rejecting failed tests does not change unitizer 1087s > update_fastlm(".", version = "0.1.1") 1087s > inst_pak(".") 1088s > 1088s > unitizer:::read_line_set_vals(c("N", "N", "Y")) 1088s > unitizer:::capture_output( 1088s + untz3 <- unitize(FLM.TEST.FILE, interactive.mode = TRUE) 1088s + ) 1088s > print(untz3) 1088s Test File: tests/unitizer/fastlm1.R 1088s Store ID: tests/unitizer/fastlm1.unitizer 1088s 1088s id call ignored status user reviewed 1088s 1 1 library(utzflm, lib.loc = g... * Failed N FALSE 1088s 2 2 dat <- data.frame(x = 1:100... * Failed N FALSE 1088s 3 3 res <- fastlm(dat$x, dat$y) * Failed N FALSE 1088s 4 4 res Failed N TRUE 1088s 5 5 get_slope(res) Failed N TRUE 1088s 6 6 get_rsq(res) Passed Y FALSE 1088s 7 7 fastlm(1:100, 1:10) Passed Y FALSE 1088s 1088s You chose NOT to save these changes to the unitizer store 1088s > 1088s > # - "demo review" -------------------------------------------------------------- 1088s > 1088s > # review is always in interactive mode 1088s > unitizer:::read_line_set_vals(c("5", "Q")) 1088s > review(FLM.TEST.STORE) 1088s 1088s +------------------------------------------------------------------------------+ 1088s | unitizer for: tests/unitizer/fastlm1.unitizer | 1088s +------------------------------------------------------------------------------+ 1088s 1088s *1. library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) . -:- 1088s *2. dat <- data.frame(x = 1:100, y = (1:100)^2) . . . . . . -:- 1088s *3. res <- fastlm(dat$x, dat$y) . . . . . . . . . . . . -:- 1088s 4. res . . . . . . . . . . . . . . . . . . . . Passed:- 1088s 5. get_slope(res) . . . . . . . . . . . . . . . . Passed:- 1088s 6. get_rsq(res) . . . . . . . . . . . . . . . . . Passed:- 1088s 7. fastlm(1:100, 1:10) . . . . . . . . . . . . . . Passed:- 1088s 1088s | What test do you wish to review (input a test number, [U]nreviewed)? 1088s 1088s unitizer> 5 1088s - Passed ----------------------------------------------------------------------- 1088s 1088s | The 4 tests in this section passed. Keep tests in store ([Y]es, [N]o, [P]rev, 1088s | [B]rowse, [Q]uit, [H]elp)? 1088s 1088s # There are three more tests to review; accept them with 'Y' 1088s 1088s > get_slope(res) 1088s [1] 101 1088s 1088s unitizer> Q 1088s 1088s | No changes recorded. 1088s | unitizer unchanged. 1088s 1088s > 1088s > # - "use.diff" ----------------------------------------------------------------- 1088s > 1088s > # Use this opportunity to make sure `use.diff=FALSE` works as intended 1088s > unitizer:::read_line_set_vals("Q") 1088s > unitize(FLM.TEST.FILE, interactive.mode = TRUE, use.diff = FALSE) 1088s 1088s +------------------------------------------------------------------------------+ 1088s | unitizer for: unitizer/fastlm1.R | 1088s +------------------------------------------------------------------------------+ 1088s 1088s Pass Fail 1088s 2 2 1088s ...................... 1088s 2 2 1088s 1088s - Failed ----------------------------------------------------------------------- 1088s 1088s | The 2 tests in this section failed because the new evaluations do not match 1088s | the reference values from the store. Overwrite with new results ([Y]es, [N]o, 1088s | [P]rev, [B]rowse, [R]erun, [Q]uit, [H]elp)? 1088s 1088s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 1088s > dat <- data.frame(x = 1:100, y = (1:100)^2) 1088s > res <- fastlm(dat$x, dat$y) 1088s 1088s # Our fast computations do not produce the same results as our 1088s # original tests so they fail. If you need more detail than the 1088s # provided diff you may use `.new`/`.NEW` or `.ref`/`.REF`. 1088s # 1088s # You should reject these tests by typing 'N' at the prompt since 1088s # they are incorrect. 1088s 1088s > res 1088s intercept slope rsq 1088s -3.54e+13 7.01e+11 9.39e-01 1088s attr(,"class") 1088s [1] "fastlm" 1088s 1088s | Value mismatch: 1088s 1088s [1] "Mean relative difference: 1.99e+10" 1088s 1088s | State mismatch; see `.NEW$state` and `.REF$state`. 1088s 1088s unitizer> Q 1088s 1088s | No changes recorded. 1088s | unitizer unchanged. 1088s 1088s > unitizer:::read_line_set_vals(c(".DIFF$state", "Q")) 1088s > 1088s > unitize(FLM.TEST.FILE, interactive.mode = TRUE, use.diff = FALSE) 1088s 1088s +------------------------------------------------------------------------------+ 1088s | unitizer for: unitizer/fastlm1.R | 1088s +------------------------------------------------------------------------------+ 1088s 1088s Pass Fail 1088s 2 2 1088s ...................... 1088s 2 2 1088s 1088s - Failed ----------------------------------------------------------------------- 1088s 1088s | The 2 tests in this section failed because the new evaluations do not match 1088s | the reference values from the store. Overwrite with new results ([Y]es, [N]o, 1088s | [P]rev, [B]rowse, [R]erun, [Q]uit, [H]elp)? 1088s 1088s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 1088s > dat <- data.frame(x = 1:100, y = (1:100)^2) 1088s > res <- fastlm(dat$x, dat$y) 1088s 1088s # Our fast computations do not produce the same results as our 1088s # original tests so they fail. If you need more detail than the 1088s # provided diff you may use `.new`/`.NEW` or `.ref`/`.REF`. 1088s # 1088s # You should reject these tests by typing 'N' at the prompt since 1088s # they are incorrect. 1088s 1088s > res 1088s intercept slope rsq 1088s -3.54e+13 7.01e+11 9.39e-01 1088s attr(,"class") 1088s [1] "fastlm" 1088s 1088s | Value mismatch: 1088s 1088s [1] "Mean relative difference: 1.99e+10" 1088s 1088s | State mismatch; see `.NEW$state` and `.REF$state`. 1088s 1088s unitizer> .DIFF$state 1088s | State mismatch: 1088s 1088s Attributes: < Component "search.path": 1 string mismatch > 1088s 1088s unitizer> Q 1088s 1088s | No changes recorded. 1088s | unitizer unchanged. 1088s 1088s > 1088s > # - "failing diff" ------------------------------------------------------------- 1088s > 1088s > unitizer:::read_line_set_vals("Q") 1088s > mock(diffobj::diffObj, quote(stop("A failing diff."))) 1088s > unitize(FLM.TEST.FILE, interactive.mode = TRUE) 1088s 1088s +------------------------------------------------------------------------------+ 1088s | unitizer for: unitizer/fastlm1.R | 1088s +------------------------------------------------------------------------------+ 1088s 1088s Pass Fail 1088s 2 2 1088s ...................... 1088s 2 2 1088s 1088s - Failed ----------------------------------------------------------------------- 1088s 1088s | The 2 tests in this section failed because the new evaluations do not match 1088s | the reference values from the store. Overwrite with new results ([Y]es, [N]o, 1088s | [P]rev, [B]rowse, [R]erun, [Q]uit, [H]elp)? 1088s 1088s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 1088s > dat <- data.frame(x = 1:100, y = (1:100)^2) 1088s > res <- fastlm(dat$x, dat$y) 1088s 1088s # Our fast computations do not produce the same results as our 1088s # original tests so they fail. If you need more detail than the 1088s # provided diff you may use `.new`/`.NEW` or `.ref`/`.REF`. 1088s # 1088s # You should reject these tests by typing 'N' at the prompt since 1088s # they are incorrect. 1088s 1088s > res 1088s intercept slope rsq 1088s -3.54e+13 7.01e+11 9.39e-01 1088s attr(,"class") 1088s [1] "fastlm" 1088s 1088s Error in diffObj(curr.err@.ref, curr.err@.new, tar.banner = make_cont(".ref"), : 1088s A failing diff. 1088s | Value: 1088s 1088s | State mismatch; see `.DIFF$state` for details. 1088s 1088s unitizer> Q 1088s 1088s | No changes recorded. 1088s | unitizer unchanged. 1088s 1088s > unmock(diffobj::diffObj) 1088s > 1088s > # - "multi-accept" ------------------------------------------------------------- 1088s > 1088s > # Test what happens if we back out of a multi-accept 1088s > 1088s > unitizer:::read_line_set_vals(c("YY", "N", "Q")) 1088s > unitize(FLM.TEST.FILE, interactive.mode = TRUE) 1088s 1089s +------------------------------------------------------------------------------+ 1089s | unitizer for: unitizer/fastlm1.R | 1089s +------------------------------------------------------------------------------+ 1089s 1089s Pass Fail 1089s 2 2 1089s ...................... 1089s 2 2 1089s 1089s - Failed ----------------------------------------------------------------------- 1089s 1089s | The 2 tests in this section failed because the new evaluations do not match 1089s | the reference values from the store. Overwrite with new results ([Y]es, [N]o, 1089s | [P]rev, [B]rowse, [R]erun, [Q]uit, [H]elp)? 1089s 1089s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 1089s > dat <- data.frame(x = 1:100, y = (1:100)^2) 1089s > res <- fastlm(dat$x, dat$y) 1089s 1089s # Our fast computations do not produce the same results as our 1089s # original tests so they fail. If you need more detail than the 1089s # provided diff you may use `.new`/`.NEW` or `.ref`/`.REF`. 1089s # 1089s # You should reject these tests by typing 'N' at the prompt since 1089s # they are incorrect. 1089s 1089s > res 1089s intercept slope rsq 1089s -3.54e+13 7.01e+11 9.39e-01 1089s attr(,"class") 1089s [1] "fastlm" 1089s 1089s | Value mismatch: 1089s 1089s < .ref > .new 1089s @@ 1,4 @@ @@ 1,4 @@ 1089s intercept slope rsq intercept slope rsq 1089s < -1717.000 101.000 0.939 > -3.54e+13 7.01e+11 9.39e-01 1089s attr(,"class") attr(,"class") 1089s [1] "fastlm" [1] "fastlm" 1089s 1089s | State mismatch; see `.DIFF$state` for details. 1089s 1089s unitizer> YY 1089s 1089s 4. res . . . . . Failed:- 1089s 5. get_slope(res) . Failed:- 1089s 1089s Choose 'Y' for the 2 tests shown above ([Y]es, [N]o)? 1089s unitizer> N 1089s 1089s 1089s # Our fast computations do not produce the same results as our 1089s # original tests so they fail. If you need more detail than the 1089s # provided diff you may use `.new`/`.NEW` or `.ref`/`.REF`. 1089s # 1089s # You should reject these tests by typing 'N' at the prompt since 1089s # they are incorrect. 1089s 1089s > res 1089s intercept slope rsq 1089s -3.54e+13 7.01e+11 9.39e-01 1089s attr(,"class") 1089s [1] "fastlm" 1089s 1089s | Value mismatch: 1089s 1089s < .ref > .new 1089s @@ 1,4 @@ @@ 1,4 @@ 1089s intercept slope rsq intercept slope rsq 1089s < -1717.000 101.000 0.939 > -3.54e+13 7.01e+11 9.39e-01 1089s attr(,"class") attr(,"class") 1089s [1] "fastlm" [1] "fastlm" 1089s 1089s | State mismatch; see `.DIFF$state` for details. 1089s 1089s unitizer> Q 1089s 1089s | No changes recorded. 1089s | unitizer unchanged. 1089s 1089s > 1089s > # - "multi-input" -------------------------------------------------------------- 1089s > 1089s > # Or if we request to go to unreviewed when there are none 1089s > unitizer:::read_line_set_vals(c("YY", "Y", "B", "U", "Q")) 1089s > unitize(FLM.TEST.FILE, interactive.mode = TRUE) 1089s 1089s +------------------------------------------------------------------------------+ 1089s | unitizer for: unitizer/fastlm1.R | 1089s +------------------------------------------------------------------------------+ 1089s 1089s Pass Fail 1089s 2 2 1089s ...................... 1089s 2 2 1089s 1089s - Failed ----------------------------------------------------------------------- 1089s 1089s | The 2 tests in this section failed because the new evaluations do not match 1089s | the reference values from the store. Overwrite with new results ([Y]es, [N]o, 1089s | [P]rev, [B]rowse, [R]erun, [Q]uit, [H]elp)? 1089s 1089s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 1089s > dat <- data.frame(x = 1:100, y = (1:100)^2) 1089s > res <- fastlm(dat$x, dat$y) 1089s 1089s # Our fast computations do not produce the same results as our 1089s # original tests so they fail. If you need more detail than the 1089s # provided diff you may use `.new`/`.NEW` or `.ref`/`.REF`. 1089s # 1089s # You should reject these tests by typing 'N' at the prompt since 1089s # they are incorrect. 1089s 1089s > res 1089s intercept slope rsq 1089s -3.54e+13 7.01e+11 9.39e-01 1089s attr(,"class") 1089s [1] "fastlm" 1089s 1089s | Value mismatch: 1089s 1089s < .ref > .new 1089s @@ 1,4 @@ @@ 1,4 @@ 1089s intercept slope rsq intercept slope rsq 1089s < -1717.000 101.000 0.939 > -3.54e+13 7.01e+11 9.39e-01 1089s attr(,"class") attr(,"class") 1089s [1] "fastlm" [1] "fastlm" 1089s 1089s | State mismatch; see `.DIFF$state` for details. 1089s 1089s unitizer> YY 1089s 1089s 4. res . . . . . Failed:- 1089s 5. get_slope(res) . Failed:- 1089s 1089s Choose 'Y' for the 2 tests shown above ([Y]es, [N]o)? 1089s unitizer> Y 1089s 1089s = Finalize Unitizer ============================================================ 1089s 1089s | You will IRREVERSIBLY modify 'unitizer/fastlm1.unitizer' by: 1089s | - Replacing 2 out of 2 failed tests 1089s 1089s | Update unitizer ([Y]es, [N]o, [P]rev, [B]rowse, [R]erun)? 1089s 1089s unitizer> B 1089s 1089s *1. library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) . -:- 1089s *2. dat <- data.frame(x = 1:100, y = (1:100)^2) . . . . . . -:- 1089s *3. res <- fastlm(dat$x, dat$y) . . . . . . . . . . . . -:- 1089s 4. res . . . . . . . . . . . . . . . . . . . . Failed:Y 1089s 5. get_slope(res) . . . . . . . . . . . . . . . . Failed:Y 1089s 6. get_rsq(res) . . . . . . . . . . . . . . . . . Passed:- 1089s 7. fastlm(1:100, 1:10) . . . . . . . . . . . . . . Passed:- 1089s 1089s | What test do you wish to review (input a test number, [U]nreviewed)? 1089s 1089s unitizer> U 1089s 1089s | No unreviewed tests. 1089s 1089s = Finalize Unitizer ============================================================ 1089s 1089s | You will IRREVERSIBLY modify 'unitizer/fastlm1.unitizer' by: 1089s | - Replacing 2 out of 2 failed tests 1089s 1089s | Update unitizer ([Y]es, [N]o, [P]rev, [B]rowse, [R]erun)? 1089s 1089s unitizer> Q 1089s 1089s | Changes discarded. 1089s | unitizer unchanged. 1089s 1089s > 1089s > # - "warn in parse" ------------------------------------------------------------ 1089s > 1089s > # Make sure parse warnings are issued 1089s > unitizer:::read_line_set_vals(c("-2147483648L", "Q")) 1089s > txt8 <- unitizer:::capture_output(unitize(FLM.TEST.FILE, 1089s + interactive.mode = TRUE)) 1089s > 1089s > any(grepl("qualified with L", txt8$message)) 1089s [1] TRUE 1089s > 1089s > # - "demo changes" ------------------------------------------------------------- 1089s > # 1089s > # Now actually accept the changes 1089s > unitizer:::read_line_set_vals(c("Y", "Y", "Y")) 1089s > untz5 <- unitize(FLM.TEST.FILE, interactive.mode = TRUE) 1089s 1089s +------------------------------------------------------------------------------+ 1089s | unitizer for: unitizer/fastlm1.R | 1089s +------------------------------------------------------------------------------+ 1089s 1089s Pass Fail 1089s 2 2 1089s ...................... 1089s 2 2 1089s 1089s - Failed ----------------------------------------------------------------------- 1089s 1089s | The 2 tests in this section failed because the new evaluations do not match 1089s | the reference values from the store. Overwrite with new results ([Y]es, [N]o, 1089s | [P]rev, [B]rowse, [R]erun, [Q]uit, [H]elp)? 1089s 1089s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 1089s > dat <- data.frame(x = 1:100, y = (1:100)^2) 1089s > res <- fastlm(dat$x, dat$y) 1089s 1089s # Our fast computations do not produce the same results as our 1089s # original tests so they fail. If you need more detail than the 1089s # provided diff you may use `.new`/`.NEW` or `.ref`/`.REF`. 1089s # 1089s # You should reject these tests by typing 'N' at the prompt since 1089s # they are incorrect. 1089s 1089s > res 1089s intercept slope rsq 1089s -3.54e+13 7.01e+11 9.39e-01 1089s attr(,"class") 1089s [1] "fastlm" 1089s 1090s | Value mismatch: 1090s 1090s < .ref > .new 1090s @@ 1,4 @@ @@ 1,4 @@ 1090s intercept slope rsq intercept slope rsq 1090s < -1717.000 101.000 0.939 > -3.54e+13 7.01e+11 9.39e-01 1090s attr(,"class") attr(,"class") 1090s [1] "fastlm" [1] "fastlm" 1090s 1090s | State mismatch; see `.DIFF$state` for details. 1090s 1090s unitizer> Y 1090s 1090s # This one is also incorrect; reject with 'N' 1090s 1090s > get_slope(res) 1090s [1] 7.01e+11 1090s 1090s | Value mismatch: 1090s 1090s < .ref > .new 1090s @@ 1 @@ @@ 1 @@ 1090s < [1] 101 > [1] 7.01e+11 1090s 1090s | State mismatch; see `.DIFF$state` for details. 1090s 1090s unitizer> Y 1090s 1090s = Finalize Unitizer ============================================================ 1090s 1090s | You will IRREVERSIBLY modify 'unitizer/fastlm1.unitizer' by: 1090s | - Replacing 2 out of 2 failed tests 1090s 1090s | Update unitizer ([Y]es, [N]o, [P]rev, [B]rowse, [R]erun)? 1090s 1090s unitizer> Y 1090s 1090s | unitizer updated. 1090s 1090s > unitizer:::read_line_set_vals(NULL) 1090s > 1090s > # - "get_package_dir" ---------------------------------------------------------- 1090s > 1090s > # These were in t-get but we moved them here to avoid re-loading pkgs.R 1090s > 1090s > unitizer:::get_package_dir(f) # empty 1090s character(0) 1090s > test.dir.1 <- file.path(".", "utzflm.Rcheck", "utzflm", "R") 1090s > identical( 1090s + unitizer:::get_package_dir(test.dir.1), 1090s + normalizePath(dirname(test.dir.1), winslash = "/") 1090s + ) 1090s [1] TRUE 1090s > test.dir.2 <- file.path(".", "utzflm.Rcheck") 1090s > identical( 1090s + unitizer:::get_package_dir(file.path(test.dir.2, "tests", "tests.R")), 1090s + normalizePath(file.path(test.dir.2, "utzflm"), winslash = "/") 1090s + ) 1090s [1] TRUE 1090s > 1090s PASS 1090s Begin testing t-error.R 1090s 1090s R version 4.3.2 (2023-10-31) -- "Eye Holes" 1090s Copyright (C) 2023 The R Foundation for Statistical Computing 1090s Platform: x86_64-pc-linux-gnu (64-bit) 1090s 1090s R is free software and comes with ABSOLUTELY NO WARRANTY. 1090s You are welcome to redistribute it under certain conditions. 1090s Type 'license()' or 'licence()' for distribution details. 1090s 1090s R is a collaborative project with many contributors. 1090s Type 'contributors()' for more information and 1090s 'citation()' on how to cite R or R packages in publications. 1090s 1090s Type 'demo()' for some demos, 'help()' for on-line help, or 1090s 'help.start()' for an HTML browser interface to help. 1090s Type 'q()' to quit R. 1090s 1090s > source(file.path("_helper", "init.R")) 1090s > 1090s > # - "Test Error Diffs" --------------------------------------------------------- 1090s > 1090s > diffs <- new( 1090s + "unitizerItemTestsErrorsDiffs", 1090s + value = new("unitizerItemTestsErrorsDiff", 1090s + txt = "value", err = TRUE, diff = diffobj::diffChr(1, 2)) 1090s + ) 1090s > diffs$value@diff@target 1090s [1] 1 1090s > diffs$value@diff@current 1090s [1] 2 1090s > try(diffs$values) 1090s Error in .local(x, i, j, ...) : 1090s Argument `i` must be one of c("value", "conditions", "output", "message", "aborted", "state") 1090s > try(diffs[[NA]]) 1090s Error in .local(x, i, j, ...) : 1090s Argument `i` must be character(1L) and not NA 1090s > err <- new( 1090s + "unitizerItemTestsErrors", 1090s + value = new( 1090s + "unitizerItemTestError", compare.err = TRUE, value = c("compare", "error") 1090s + ) ) 1090s > # - "Show Test Error" ---------------------------------------------------------- 1090s > 1090s > is(unitizer:::as.Diffs(err)@value, "unitizerItemTestsErrorsDiff") 1090s [1] TRUE 1090s > 1090s PASS 1090s Begin testing t-exec.R 1090s 1090s R version 4.3.2 (2023-10-31) -- "Eye Holes" 1090s Copyright (C) 2023 The R Foundation for Statistical Computing 1090s Platform: x86_64-pc-linux-gnu (64-bit) 1090s 1090s R is free software and comes with ABSOLUTELY NO WARRANTY. 1090s You are welcome to redistribute it under certain conditions. 1090s Type 'license()' or 'licence()' for distribution details. 1090s 1090s R is a collaborative project with many contributors. 1090s Type 'contributors()' for more information and 1090s 'citation()' on how to cite R or R packages in publications. 1090s 1090s Type 'demo()' for some demos, 'help()' for on-line help, or 1090s 'help.start()' for an HTML browser interface to help. 1090s Type 'q()' to quit R. 1090s 1090s > source(file.path("_helper", "init.R")) 1091s > source(file.path("aammrtf", "ref.R")); make_ref_obj_funs("exec") 1091s > 1091s > suppressWarnings(glob <- unitizer:::unitizerGlobal$new()) 1091s > 1091s > # - "Invisible Expression" ----------------------------------------------------- 1091s > 1091s > e <- new.env() 1091s > exp <- quote(x <- 1:30) 1091s > all.equal(1:30, unitizer:::eval_user_exp(exp, e, global = glob)$value) 1091s [1] TRUE 1091s > 1091s > # `eval_user_exp` must be evaluated outside of test_that; also note that by 1091s > # design this will output stuff to stderr and stdout 1091s > out.err <- capture.output(type = "message", out.std <- capture.output({ 1091s + test.obj.s3 <- structure("hello", class = "test_obj") 1091s + setClass("testObj", list(a = "character")) 1091s + test.obj.s4 <- new("testObj", a = "goodday") 1091s + print.test_obj <- function(x, ...) stop("Error in Print") 1091s + setMethod("show", "testObj", function(object) stop("Error in Show")) 1091s + fun_signal <- function() signalCondition(simpleError("Error in Function", 1091s + sys.call())) 1091s + fun_error <- function() stop("Error in function 2") 1091s + fun_error_cond <- function() stop(simpleError("Error in function 2", 1091s + sys.call())) 1091s + fun_error_cond_call <- function() fun_error_cond() 1091s + fun_s3 <- function() test.obj.s3 1091s + fun_s4 <- function() test.obj.s4 1091s + fun_msg <- function() message("This is a Message") 1091s + fun_warn <- function() warning("This is a warning", immediate. = TRUE) 1091s + eval.env <- sys.frame(sys.nframe()) 1091s + ex0 <- unitizer:::eval_user_exp(quote(stop()), eval.env, 1091s + global = glob) 1091s + unitizer:::set_trace(ex0$trace) 1091s + trace0 <- unitizer:::unitizer_traceback() 1091s + ex1 <- unitizer:::eval_user_exp(quote(fun_signal()), eval.env, 1091s + global = glob) 1091s + unitizer:::set_trace(ex1$trace) 1091s + trace1 <- unitizer:::unitizer_traceback() 1091s + ex2 <- unitizer:::eval_user_exp(quote(fun_error()), eval.env, 1091s + global = glob) 1091s + unitizer:::set_trace(ex2$trace) 1091s + trace2 <- unitizer:::unitizer_traceback() 1091s + ex2a <- unitizer:::eval_user_exp(expression(fun_error()), 1091s + eval.env, global = glob) 1091s + unitizer:::set_trace(ex2a$trace) 1091s + trace2a <- unitizer:::unitizer_traceback() 1091s + ex6 <- unitizer:::eval_user_exp(quote(fun_error_cond()), 1091s + eval.env, global = glob) 1091s + unitizer:::set_trace(ex6$trace) 1091s + trace6 <- unitizer:::unitizer_traceback() 1091s + ex7 <- unitizer:::eval_user_exp(quote(fun_error_cond_call()), 1091s + eval.env, global = glob) 1091s + unitizer:::set_trace(ex7$trace) 1091s + trace7 <- unitizer:::unitizer_traceback() 1091s + ex3 <- unitizer:::eval_user_exp(quote(fun_s3()), eval.env, 1091s + global = glob) 1091s + unitizer:::set_trace(ex3$trace) 1091s + trace3 <- unitizer:::unitizer_traceback() 1091s + ex3a <- unitizer:::eval_user_exp(expression(fun_s3()), eval.env, 1091s + global = glob) 1091s + unitizer:::set_trace(ex3a$trace) 1091s + trace3a <- unitizer:::unitizer_traceback() 1091s + ex4 <- unitizer:::eval_user_exp(quote(fun_s4()), eval.env, 1091s + global = glob) 1091s + ex4a <- unitizer:::eval_user_exp(expression(fun_s4()), eval.env, 1091s + global = glob) 1091s + unitizer:::set_trace(ex4a$trace) 1091s + trace4a <- unitizer:::unitizer_traceback() 1091s + ex5 <- unitizer:::eval_user_exp(quote(sum(1:20)), eval.env, 1091s + global = glob) 1091s + ex9 <- unitizer:::eval_user_exp(quote(fun_warn()), eval.env, 1091s + global = glob) 1091s + ex10 <- unitizer:::eval_user_exp(quote(fun_msg()), eval.env, 1091s + global = glob) 1091s + ex11 <- unitizer:::eval_user_exp(quote((function() quote(stop("shouldn't error")))()), 1091s + eval.env, global = glob) 1091s + })) 1091s > # NOTE: deparsed test values generated with unitizer:::deparse_mixed 1091s > 1091s > # - "User Expression Evaluation" ----------------------------------------------- 1091s > 1091s > # a condition error, signaled, not stop (hence no aborted, etc.) 1091s > identical(ex1, rds(100)) 1091s [1] TRUE 1091s > # a stop 1091s > identical(ex2, rds(200)) 1091s [1] TRUE 1091s > # ex3 and ex3a are a total PITA because the calls need to be manually copied 1091s > # b/c they don't deparse properly even with control="all", the trace and 1091s > # call component loose the `structure` part in the quoted portions... 1091s > # a stop in print; 1091s > identical(ex3, rds(300)) 1091s [1] TRUE 1091s > identical(ex3a, rds(400)) 1091s [1] TRUE 1091s > # S4 objects; these originally caused problems since they don't deparse 1091s > identical(ex4, rds(500)) 1091s [1] TRUE 1091s > identical(ex4a, rds(600)) 1091s [1] TRUE 1091s > # a normal expression 1091s > identical(ex5, rds(700)) 1091s [1] TRUE 1091s > identical(ex9, rds(800)) 1091s [1] TRUE 1091s > all.equal(ex10, rds(900)) # not sure why identical doesn't work here 1091s [1] TRUE 1091s > # expect_false(ex11$aborted) 1091s > ex11$aborted # FALSE 1091s [1] FALSE 1091s > 1091s > # - "Trace Setting" ------------------------------------------------------------ 1091s > 1091s > identical(trace0, trace1) 1091s [1] TRUE 1091s > # expect_identical(trace2, list("stop(\"Error in function 2\")", 1091s > # "fun_error()")) 1091s > trace2 1091s [[1]] 1091s [1] "stop(\"Error in function 2\")" 1091s 1091s [[2]] 1091s [1] "fun_error()" 1091s 1091s > trace6 1091s [[1]] 1091s [1] "stop(simpleError(\"Error in function 2\", sys.call()))" 1091s 1091s [[2]] 1091s [1] "fun_error_cond()" 1091s 1091s > trace7 1091s [[1]] 1091s [1] "stop(simpleError(\"Error in function 2\", sys.call()))" 1091s 1091s [[2]] 1091s [1] "fun_error_cond()" 1091s 1091s [[3]] 1091s [1] "fun_error_cond_call()" 1091s 1091s > trace3a 1091s [[1]] 1091s [1] "stop(\"Error in Print\")" 1091s 1091s [[2]] 1091s [1] "print.test_obj(\"hello\")" 1091s 1091s [[3]] 1091s [1] "print(\"hello\")" 1091s 1091s > 1091s > # needed to tweak this one so it would pass in R-devel 3.4.1 1091s > # expect_true(all(mapply(function(x, y) grepl(y, x), trace4a, list("stop\\(\"Error in Show\"\\)", 1091s > # "show\\(.*\"testObj\".*\\)", "show\\(.*\"testObj\".*\\)")))) 1091s > all( 1091s + mapply( 1091s + function(x, y) grepl(y, x), 1091s + trace4a, 1091s + list( 1091s + "stop\\(\"Error in Show\"\\)", 1091s + "show\\(.*\"testObj\".*\\)", "show\\(.*\"testObj\".*\\)") 1091s + ) ) 1091s [1] TRUE 1091s > # - "Clean Top Level Message" -------------------------------------------------- 1091s > 1091s > old.width <- options(width = 80L) 1091s > a <- unitizer:::eval_with_capture( 1091s + expression(stop("short stop message")), global = glob 1091s + ) 1091s > b <- unitizer:::eval_with_capture( 1091s + expression(stop("short stop .* with regex message")), global = glob 1091s + ) 1091s > c <- unitizer:::eval_with_capture( 1091s + expression(stop("this is a long error message that is supposed to cause R to add a new line after the error: part")), 1091s + global = glob 1091s + ) 1091s > d <- unitizer:::eval_with_capture( 1091s + expression(warning("short warning message")), global = glob 1091s + ) 1091s > e <- unitizer:::eval_with_capture( 1091s + expression(warning("short warning message .* with regex")), global = glob 1091s + ) 1091s > f <- unitizer:::eval_with_capture( 1091s + expression( 1091s + warning("this is a long error message that is supposed to cause R to add a new line after the error: part") 1091s + ), 1091s + global = glob 1091s + ) 1091s > g <- unitizer:::eval_with_capture( 1091s + quote(stop("short stop message")), global = glob 1091s + ) 1091s > h <- unitizer:::eval_with_capture( 1091s + quote(stop("short stop .* with regex message")), global = glob 1091s + ) 1091s > i <- unitizer:::eval_with_capture( 1091s + quote(stop("this is a long error message that is supposed to cause R to add a new line after the error: part")), 1091s + global = glob 1091s + ) 1091s > j <- unitizer:::eval_with_capture( 1091s + quote(warning("short warning message")), global = glob 1091s + ) 1091s > k <- unitizer:::eval_with_capture( 1091s + quote(warning("short warning message .* with regex")), global = glob 1091s + ) 1091s > l <- unitizer:::eval_with_capture( 1091s + quote(warning("this is a long error message that is supposed to cause R to add a new line after the error: part")), 1091s + global = glob 1091s + ) 1091s > m <- unitizer:::eval_with_capture(expression("a"/3), global = glob) 1091s > exp.q <- quote({ 1091s + fun <- function() warning("error in fun") 1091s + message("boo hay \n there \n") 1091s + 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") 1091s + warning("ashorter warning blah") 1091s + message("boo hay \n there \n") 1091s + warning() 1091s + fun() 1091s + suppressWarnings(warning("quiet warn")) 1091s + message("boo hay \n there \n") 1091s + error(3) 1091s + }) 1091s > x <- unitizer:::eval_with_capture(exp.q, global = glob) 1091s > exp.exp <- expression({ 1091s + fun <- function() warning("error in fun") 1091s + message("boo hay \n there \n") 1091s + 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") 1091s + warning("ashorter warning blah") 1091s + message("boo hay \n there \n") 1091s + warning() 1091s + fun() 1091s + suppressWarnings(warning("quiet warn")) 1091s + message("boo hay \n there \n") 1091s + error(3) 1091s + }) 1091s > y <- unitizer:::eval_with_capture(exp.exp, global = glob) 1091s > options(old.width) 1091s > 1091s > a$message 1091s [1] "Error: short stop message\n" 1091s > b$message 1091s [1] "Error: short stop .* with regex message\n" 1091s > c$message 1091s [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" 1091s > d$message 1091s [1] "Warning: short warning message\n" 1091s > e$message 1091s [1] "Warning: short warning message .* with regex\n" 1091s > f$message 1091s [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" 1091s > g$message 1091s [1] "Error: short stop message\n" 1091s > h$message 1091s [1] "Error: short stop .* with regex message\n" 1091s > i$message 1091s [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" 1091s > j$message 1091s [1] "Warning: short warning message\n" 1091s > k$message 1091s [1] "Warning: short warning message .* with regex\n" 1091s > l$message 1091s [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" 1091s > m$message 1091s [1] "Error in \"a\"/3 : non-numeric argument to binary operator\n" 1091s > 1091s > # `sub` needed due to inconsistencies in R 3.4 and 3.3 for top level error 1091s > # messages 1091s > writeLines(sub("\\bError.*: ", "", x$message)) 1091s boo hay 1091s there 1091s 1091s Warning: 1091s 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 1091s Warning: ashorter warning blah 1091s boo hay 1091s there 1091s 1091s Warning: 1091s Warning in fun() : error in fun 1091s boo hay 1091s there 1091s 1091s could not find function "error" 1091s 1091s > writeLines(sub("\\bError.*: ", "", y$message)) 1091s boo hay 1091s there 1091s 1091s Warning: 1091s 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 1091s Warning: ashorter warning blah 1091s boo hay 1091s there 1091s 1091s Warning: 1091s Warning in fun() : error in fun 1091s boo hay 1091s there 1091s 1091s could not find function "error" 1091s 1091s > 1091s > 1091s PASS 1091s Begin testing t-get.R 1091s 1091s R version 4.3.2 (2023-10-31) -- "Eye Holes" 1091s Copyright (C) 2023 The R Foundation for Statistical Computing 1091s Platform: x86_64-pc-linux-gnu (64-bit) 1091s 1091s R is free software and comes with ABSOLUTELY NO WARRANTY. 1091s You are welcome to redistribute it under certain conditions. 1091s Type 'license()' or 'licence()' for distribution details. 1091s 1091s R is a collaborative project with many contributors. 1091s Type 'contributors()' for more information and 1091s 'citation()' on how to cite R or R packages in publications. 1091s 1091s Type 'demo()' for some demos, 'help()' for on-line help, or 1091s 'help.start()' for an HTML browser interface to help. 1091s Type 'q()' to quit R. 1091s 1091s > source(file.path("_helper", "init.R")) 1091s > source(file.path("aammrtf", "mock.R")) 1091s > 1091s > toy.path <- file.path("_helper", "unitizers", "misc.unitizer") 1091s > toy.stor <- readRDS(file.path(toy.path, "data.rds")) 1091s > 1091s > # - "Error Cases" -------------------------------------------------------------- 1091s > 1091s > try(get_unitizer(1)) 1091s Error in get_unitizer.default(1) : 1091s 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. 1091s > try(get_unitizer(letters)) 1091s Error in get_unitizer.character(letters) : 1091s Argument `store.id` must be a 1 length character vector 1091s > try(get_unitizer("_helper")) 1091s Error in get_unitizer.character("_helper") : 1091s Argument `store.id` does not appear to refer to a unitizer directory 1091s > try(get_unitizer("t-get.R")) 1091s Error in get_unitizer.character("t-get.R") : 1091s Argument `store.id` does not appear to refer to a unitizer directory 1091s > try(set_unitizer(1)) 1091s Error in set_unitizer.default(1) : 1091s 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. 1091s > try(set_unitizer(letters)) 1091s Error in set_unitizer.character(letters) : 1091s Argument `store.id` must be a 1 length character vector 1091s > # 4.3 changed reporting of missing argument errors 1091s > tryCatch(set_unitizer("a"), error=function(e) conditionMessage(e)) 1091s [1] "argument \"unitizer\" is missing, with no default" 1091s > try(set_unitizer("a", "blergh")) 1091s Error in set_unitizer.character("a", "blergh") : 1091s Argument `unitizer` must be a unitizer 1091s > !file.exists("a") # TRUE 1091s [1] TRUE 1091s > try(suppressWarnings(set_unitizer("tests/# ;!./# \\/", toy.stor))) 1091s Error in set_unitizer.character("tests/# ;!./# \\/", toy.stor) : 1091s Could not create `store.id`; make sure it is a valid file name; see warning for details 1091s > 1091s > # - "Get works as expected" ---------------------------------------------------- 1091s > 1091s > tmp.dir <- tempfile() 1091s > dir.create(tmp.dir) 1091s > tmp.sub.dir <- paste0(tmp.dir, "/get.test.dir") 1091s > tmp.fake.utz <- paste0(tmp.dir, "/fake.unitizer") 1091s > 1091s > # expect_false(get_unitizer("asldkfjskfa")) 1091s > get_unitizer("asldkfjskfa") # FALSE 1091s [1] FALSE 1091s > all.equal(get_unitizer(toy.path), toy.stor) 1091s [1] TRUE 1091s > is(toy.stor, "unitizer") 1091s [1] TRUE 1091s > dir.create(tmp.fake.utz) 1091s > fake.utz <- file.path(tmp.fake.utz, "data.rds") 1091s > cat("# this is not an RDS\n", file = fake.utz) 1091s > # expect_error(capture.output(get_unitizer(tmp.fake.utz), type = "message"), 1091s > # "Failed loading unitizer") 1091s > try(capture.output(get_unitizer(tmp.fake.utz), type = "message")) 1091s Error in get_unitizer.character(tmp.fake.utz) : 1091s Failed loading unitizer; see prior error messages for details 1091s > 1091s > tmp.sub.dir <- paste0(tmp.dir, "/get.test.dir") 1091s > tmp.sub.dir2 <- paste0(tmp.dir, "/get.test.dir2") 1091s > tmp.sub.dir3 <- paste0(tmp.dir, "/load.dirs") 1091s > 1091s > # - "Set works as expected" ---------------------------------------------------- 1091s > 1091s > dir.create(tmp.sub.dir) 1091s > set_unitizer(tmp.sub.dir, toy.stor) 1091s [1] TRUE 1091s > all.equal(readRDS(paste0(tmp.sub.dir, "/data.rds")), toy.stor) 1091s [1] TRUE 1091s > just.a.file <- tempfile() 1091s > on.exit(unlink(just.a.file)) 1091s > cat("just a file\n", file = just.a.file) 1091s > err <- capture.output(try(set_unitizer(just.a.file, toy.stor)), type='message') 1091s > any(grepl('not a directory', err)) 1091s [1] TRUE 1091s > 1091s > # - "load/store_unitizer" ------------------------------------------------------ 1091s > 1091s > # Several different stores in different states (i.e. requiring upgrade, 1091s > # not unitizers, etc.) 1091s > dir.create(tmp.sub.dir3) 1091s > make.path <- lapply(file.path(tmp.sub.dir3, dir("_helper/ref-objs/load/")), 1091s + dir.create) 1091s > if (!all(unlist(make.path))) stop("Failed making paths") 1091s > file.copy(list.files("_helper/ref-objs/load", full.names = TRUE), tmp.sub.dir3, 1091s + recursive = TRUE) 1091s [1] TRUE TRUE TRUE TRUE TRUE TRUE 1091s > par.frame <- new.env() 1091s > store.ids <- as.list(list.files(tmp.sub.dir3, full.names = TRUE)) 1091s > 1091s > # must be upgraded, but cannot 1091s > load.try <- unitizer:::capture_output( 1091s + try( 1091s + unitizer:::load_unitizers(store.ids, rep(NA_character_, 1091s + length(store.ids)), par.frame = par.frame, interactive.mode = FALSE, 1091s + mode = "unitize", force.upgrade = FALSE, show.progress=0L, transcript=FALSE 1091s + ) ) ) 1092s > any(grepl('could not be loaded', load.try$message)) 1092s [1] TRUE 1092s > any(grepl('could not be upgraded', load.try$message)) 1092s [1] TRUE 1092s > any(grepl('Cannot proceed', load.try$message)) 1092s [1] TRUE 1092s > 1092s > # handle failure in store_unitizer, we just try this on one of the store ids 1092s > 1092s > out <- unitizer:::capture_output( 1092s + unitizer:::load_unitizers( 1092s + store.ids[4], rep(NA_character_, length(store.ids))[4], 1092s + par.frame = par.frame, interactive.mode = FALSE, mode = "unitize", 1092s + force.upgrade = TRUE, show.progress=0L, transcript=FALSE 1092s + ) 1092s + ) 1092s > any(grepl('Upgraded test file does not match original', out$message)) 1092s [1] TRUE 1092s > 1092s > # try weird store ids 1092s > out <- unitizer:::capture_output( 1092s + invalid.store <- try( 1092s + unitizer:::load_unitizers( 1092s + list(structure("hello", class = "unitizer_error_store")), 1092s + NA_character_, par.frame = par.frame, 1092s + interactive.mode = FALSE, mode = "unitize", force.upgrade = FALSE, 1092s + show.progress=0L, transcript=FALSE 1092s + ) ) 1092s + ) 1092s > inherits(invalid.store, "try-error") 1092s [1] TRUE 1092s > any(grepl("returned something other than", out$message)) 1092s [1] TRUE 1092s > 1092s > # Load mix of loadable and not loadable objects 1092s > glob <- suppressWarnings(unitizer:::unitizerGlobal$new()) 1092s > # with warning: "does not exist|test file does not") 1092s > out <- unitizer:::capture_output( 1092s + untzs <- try( 1092s + unitizer:::load_unitizers( 1092s + store.ids, rep(NA_character_, length(store.ids)), par.frame = par.frame, 1092s + interactive.mode = FALSE, mode = "unitize", force.upgrade = TRUE, 1092s + global = glob, show.progress=0L, transcript=FALSE 1092s + ) ) ) 1092s > inherits(untzs, "try-error") 1092s [1] TRUE 1092s > any(grepl('could not be loaded', out$message)) 1092s [1] TRUE 1092s > any(grepl('could not be upgraded', out$message)) 1092s [1] TRUE 1092s > any(grepl('Cannot proceed', out$message)) 1092s [1] TRUE 1092s > 1092s > # Test failure of storage of a loaded and upgraded unitizers 1092s > 1092s > untzs <- unitizer:::load_unitizers( 1092s + store.ids[4], NA_character_, par.frame = par.frame, 1092s + interactive.mode = FALSE, mode = "unitize", force.upgrade = TRUE, 1092s + global = glob, show.progress=0L, transcript=FALSE 1092s + ) 1092s Warning in addSlot(object, "cons", NULL) : 1092s Slot `cons` does not exist in current version of `unitizer` so not added to object. 1092s Warning in addSlot(object, "jump.to.test", 0L) : 1092s Slot `jump.to.test` does not exist in current version of `unitizer` so not added to object. 1092s Warning in unitizer:::load_unitizers(store.ids[4], NA_character_, par.frame = par.frame, : 1092s Upgraded test file does not match original test file ('internals.R' vs 'NA'). 1092s > mock(unitizer:::set_unitizer, quote(stop("set fail"))) 1092s > try(unitizer:::store_unitizer(untzs[[1]])) 1092s Error in set_unitizer(unitizer@id, unitizer) : set fail 1092s Error in unitizer:::store_unitizer(untzs[[1]]) : 1092s Error attempting to save unitizer, see previous messages. 1092s > unmock(unitizer:::set_unitizer) 1092s > 1092s > # Try reloading already loaded unitisers 1092s > reload <- unitizer:::as.list(untzs) 1092s > # this creates a global object, hence warning 1092s > untzs1a <- unitizer:::load_unitizers( 1092s + reload, rep(NA_character_, length(reload)), par.frame = par.frame, 1092s + interactive.mode = FALSE, mode = "unitize", force.upgrade = FALSE, 1092s + show.progress=0L, transcript=FALSE 1092s + ) 1092s Warning in .Object$initialize(...) : 1092s Instantiated global object without global namespace registry; you should only see this warning you are using `repair_environments`. 1092s > all(vapply(unitizer:::as.list(untzs1a), is, logical(1L), "unitizer")) 1092s [1] TRUE 1092s > 1092s > # misc tests 1092s > # warning Instantiated global object without 1092s > 1092s > untzs2 <- unitizer:::load_unitizers( 1092s + list(tmp.sub.dir2), NA_character_, par.frame, interactive.mode = FALSE, 1092s + mode = "unitize", force.upgrade = FALSE, show.progress=0L, transcript=FALSE 1092s + ) 1092s Warning in .Object$initialize(...) : 1092s Instantiated global object without global namespace registry; you should only see this warning you are using `repair_environments`. 1092s > is(untzs2[[1L]], "unitizer") 1092s [1] TRUE 1092s > identical(parent.env(untzs2[[1L]]@zero.env), par.frame) 1092s [1] TRUE 1092s > 1092s > # something that won't get reset on load so we can check our re-load 1092s > untzs2[[1L]]@eval.time <- 33 1092s > unitizer:::store_unitizer(untzs2[[1L]]) 1092s | unitizer updated. 1092s 1092s > 1092s > # warning Instantiated global object without 1092s > untzs2.1 <- unitizer:::load_unitizers( 1092s + list(tmp.sub.dir2), NA_character_, par.frame, interactive.mode = FALSE, 1092s + mode = "unitize", force.upgrade = FALSE, show.progress=0L, transcript=FALSE 1092s + ) 1092s Warning in .Object$initialize(...) : 1092s Instantiated global object without global namespace registry; you should only see this warning you are using `repair_environments`. 1092s > untzs2.1[[1L]]@eval.time # 33 1092s [1] 33 1092s > unlink(c(tmp.sub.dir2, tmp.sub.dir3, tmp.sub.dir), recursive = TRUE) 1092s > 1092s > # - "is_package" --------------------------------------------------------------- 1092s > 1092s > unitizer:::is_package_dir(system.file(package = "stats")) 1092s [1] TRUE 1092s > unitizer:::is_package_dir(system.file(package = "methods")) 1092s [1] TRUE 1092s > 1092s > ## Seems like some change now tests no longer installed by default with 1092s > ## packages, at least in the unix distros, so can't easily test with 1092s > ## has.tests==TRUE 1092s > 1092s > unitizer:::pretty_path(file.path(system.file(package = "stats"), 1092s + "DESCRIPTION")) 1092s [1] "package:stats/DESCRIPTION" 1092s > old.wd <- getwd() 1092s > setwd(system.file(package = "stats")) 1092s > unitizer:::pretty_path(file.path(system.file(package = "stats"), "DESCRIPTION")) 1092s [1] "DESCRIPTION" 1092s > unitizer:::pretty_path(file.path(system.file(package = "stats"))) 1092s [1] "." 1092s > setwd(old.wd) 1092s > 1092s > # just picked some folder we know will not work (No Desc) 1092s > unitizer:::is_package_dir(file.path(system.file(package = "stats"), "R")) 1092s [1] "No DESCRIPTION file" 1092s > unitizer:::is_package_dir("ASDFASDF") 1092s [1] "not an existing directory" 1092s > unitizer:::is_package_dir(file.path(system.file(package = "unitizer"), 1092s + "expkg", "baddescription1")) 1092s [1] "DESCRIPTION file did not have a package name entry" 1092s > # *get_*package_dir 1092s > pkg.f <- file.path(system.file(package = "unitizer"), "tests", 1092s + "interactive", "run.R") 1092s > length(unitizer:::get_package_dir(pkg.f)) == 1L 1092s [1] TRUE 1092s > length(unitizer:::get_package_dir(dirname(pkg.f))) == 1L 1092s [1] TRUE 1092s > f <- tempfile() 1092s > cat("helloworld", file = f) 1092s > length(unitizer:::get_package_dir(f)) == 0L 1092s [1] TRUE 1092s > unlink(f) 1092s > 1092s > # some more tests moved to t-demo.R to avoid reloading pkgs 1092s > 1092s > # - "is_unitizer_dir" ---------------------------------------------------------- 1092s > 1092s > base.dir <- file.path(system.file(package = "unitizer"), "expkg", "infer") 1092s > unitizer:::is_unitizer_dir(base.dir) # FALSE 1092s [1] FALSE 1092s > unitizer:::is_unitizer_dir( 1092s + file.path(base.dir, "tests", "unitizer", "infer.unitizer") 1092s + ) 1092s [1] TRUE 1092s > # - "infer_unitizer_location" -------------------------------------------------- 1092s > 1092s > infer <- function(...) infer_unitizer_location(..., interactive.mode = FALSE) 1092s > base.dir <- file.path(system.file(package = "unitizer"), "expkg", "infer") 1092s > 1092s > # Verify package is still in state we built tests on; need to sort b/c 1092s > # different platforms have different lexical sorts 1092s > identical( 1092s + sort(c("aaa.R", "aaa.unitizer", "abc.R", "abc.unitizer", "inf.R", 1092s + "inf.unitizer", "infer.R", "infer.unitizer", "zzz.R", "zzz.unitizer")), 1092s + list.files(file.path(base.dir, "tests", "unitizer")) 1092s + ) 1092s [1] TRUE 1092s > # Package dir 1092s > unitizer:::capture_output(inf <- infer(base.dir)) 1092s > basename(inf) 1092s [1] "infer.R" 1092s > unitizer:::capture_output(inf <- infer(base.dir, type = "d")) 1092s > basename(inf) 1092s [1] "unitizer" 1092s > unitizer:::capture_output(inf <- infer(base.dir, type = "u")) 1092s > basename(inf) 1092s [1] "infer.unitizer" 1092s > 1092s > inf.dir <- infer(file.path(base.dir, "*")) # warn 1092s Warning in infer_unitizer_location.character(..., interactive.mode = FALSE) : 1092s 5 possible targets; too many to unambiguously infer desired file 1092s > identical(file.path(base.dir, "*"), inf.dir) 1092s [1] TRUE 1092s > 1092s > unitizer:::capture_output(inf <- infer(file.path(base.dir, "z"))) 1092s > basename(inf) 1092s [1] "zzz.R" 1092s > unitizer:::capture_output(inf <- infer(file.path(base.dir, "z"), type = "u")) 1092s > basename(inf) 1092s [1] "zzz.unitizer" 1092s > 1092s > # Normal dir 1092s > base.dir2 <- file.path(base.dir, "tests", "unitizer") 1092s > # note don't need * to generate warning 1092s > out <- unitizer:::capture_output(inf.dir2 <- infer(base.dir2)) # warn 1092s > any(grepl("5 possible targets", out$message)) 1092s [1] TRUE 1092s > identical(base.dir2, inf.dir2) 1092s [1] TRUE 1092s > out <- unitizer:::capture_output(infer(file.path(base.dir2, "a"))) 1092s > any(grepl("2 possible targets", out$message)) 1092s [1] TRUE 1092s > out <- unitizer:::capture_output(infer(file.path(base.dir2, "a"), type = "u")) 1092s > any(grepl("2 possible targets", out$message)) 1092s [1] TRUE 1092s > out <- 1092s + unitizer:::capture_output(fname <- basename(infer(file.path(base.dir2, "z")))) 1092s > fname 1092s [1] "zzz.R" 1092s > any(grepl('Inferred test file location:', out)) 1092s [1] TRUE 1092s > out <- unitizer:::capture_output( 1092s + fname <- basename(infer(file.path(base.dir2, "z"), type="u")) 1092s + ) 1092s > fname 1092s [1] "zzz.unitizer" 1092s > any(grepl('Inferred unitizer location:', out)) 1092s [1] TRUE 1092s > 1092s > # Random file without setting working dir first, in order for this to work 1092s > # non-interactivel we need it to work with the R CMD check dir structure, 1092s > # and possibly with the covr dir structure 1092s > if (interactive()) infer("tests2") 1092s > 1092s > # Interactive mode 1092s > unitizer:::read_line_set_vals(c("26", "Q")) 1092s > # warn/output 1092s > select <- unitizer:::infer_unitizer_location( 1092s + file.path(base.dir, "*"), type = "f", interactive.mode = TRUE 1092s + ) 1092s Possible matching files from "tests/unitizer": 1092s 1: aaa.R 1092s 2: abc.R 1092s 3: inf.R 1092s 4: infer.R 1092s 5: zzz.R 1092s unitizer> 26 1092s | Type a number in `1:5` at the prompt 1092s [1] 26 1092s unitizer> Q 1092s 1092s No file selected 1092s Warning in infer_unitizer_location.character(file.path(base.dir, "*"), type = "f", : 1092s Invalid user selection 1092s > identical(select, file.path(base.dir, "*")) 1092s [1] TRUE 1092s > 1092s > unitizer:::read_line_set_vals(c("5")) 1092s > # output 1092s > sel.loc <- unitizer:::infer_unitizer_location(file.path(base.dir, 1092s + "*"), type = "f", interactive.mode = TRUE) 1092s Possible matching files from "tests/unitizer": 1092s 1: aaa.R 1092s 2: abc.R 1092s 3: inf.R 1092s 4: infer.R 1092s 5: zzz.R 1092s unitizer> 5 1092s Selected file: zzz.R 1092s > basename(sel.loc) 1092s [1] "zzz.R" 1092s > unitizer:::read_line_set_vals(NULL) 1092s > 1092s > # Non standard inferences 1092s > # warn 1092s > out <- unitizer:::capture_output( 1092s + unitizer:::infer_unitizer_location(NULL, interactive = FALSE) 1092s + ) 1092s > any(grepl("too many to unambiguously", out$message)) 1092s [1] TRUE 1092s > 1092s > fake.class <- structure(list(), class = "thisclassdoesn'texist") 1092s > identical(infer(fake.class), fake.class) 1092s [1] TRUE 1092s > 1092s > # no match since file can't exist (warn) 1092s > f <- tempfile() 1092s > out <- capture.output( 1092s + invisible(unitizer:::infer_unitizer_location(f)), type='message' 1092s + ) 1092s > any(grepl("No possible matching files", out)) 1092s [1] TRUE 1092s > 1092s > 1092s > unlink(tmp.dir, recursive = TRUE) 1092s > 1092s > 1092s PASS 1092s Begin testing t-global.R 1092s 1092s R version 4.3.2 (2023-10-31) -- "Eye Holes" 1092s Copyright (C) 2023 The R Foundation for Statistical Computing 1092s Platform: x86_64-pc-linux-gnu (64-bit) 1092s 1092s R is free software and comes with ABSOLUTELY NO WARRANTY. 1092s You are welcome to redistribute it under certain conditions. 1092s Type 'license()' or 'licence()' for distribution details. 1092s 1092s R is a collaborative project with many contributors. 1092s Type 'contributors()' for more information and 1092s 'citation()' on how to cite R or R packages in publications. 1092s 1092s Type 'demo()' for some demos, 'help()' for on-line help, or 1092s 'help.start()' for an HTML browser interface to help. 1092s Type 'q()' to quit R. 1092s 1092s > source(file.path("_helper", "init.R")) 1093s > 1093s > # Most tests involving global are scattered all over the place, just putting a 1093s > # few extra ones that are very specifically about global here 1093s > # 1093s > # - "Singleton Implementation Working" ----------------------------------------- 1093s > 1093s > invisible(unitizer:::unitizerGlobal$new()) # warn 1093s Warning in .Object$initialize(...) : 1093s Instantiated global object without global namespace registry; you should only see this warning you are using `repair_environments`. 1093s > glob.first <- unitizer:::unitizerGlobal$new(set.global = TRUE) 1093s > try(unitizer:::unitizerGlobal$new(set.global = TRUE)) 1093s Error in .Object$initialize(...) : 1093s Internal Error: global tracking object already exists; this should never happen; contact maintainer 1093s > try(unitizer:::unitizerGlobal$new()) 1093s Error in .Object$initialize(...) : 1093s Internal Error: global tracking object already exists; this should never happen; contact maintainer 1093s > glob.first$release() 1093s > 1093s > # - "Dummy Display" ------------------------------------------------------------ 1093s > 1093s > show(new("unitizerDummy")) # not recorded 1093s 1093s > 1093s > # - "Disable / Enable" --------------------------------------------------------- 1093s > 1093s > suppressWarnings(glob <- unitizer:::unitizerGlobal$new()) 1093s > glob$disable() 1093s An object of class "unitizerGlobalStatus" 1093s Slot "search.path": 1093s [1] 0 1093s 1093s Slot "options": 1093s [1] 0 1093s 1093s Slot "working.directory": 1093s [1] 0 1093s 1093s Slot "random.seed": 1093s [1] 0 1093s 1093s Slot "namespaces": 1093s [1] 0 1093s 1093s > glob$enable(c(search.path = 2L)) # warn state setting 1093s Warning in glob$enable(c(search.path = 2L)) : 1093s State setting for `search.path` has already been disabled and cannot be re-enabled 1093s An object of class "unitizerGlobalStatus" 1093s Slot "search.path": 1093s [1] 0 1093s 1093s Slot "options": 1093s [1] 0 1093s 1093s Slot "working.directory": 1093s [1] 0 1093s 1093s Slot "random.seed": 1093s [1] 0 1093s 1093s Slot "namespaces": 1093s [1] 0 1093s 1093s > 1093s > 1093s PASS 1093s Begin testing t-handledruns.R 1093s 1093s R version 4.3.2 (2023-10-31) -- "Eye Holes" 1093s Copyright (C) 2023 The R Foundation for Statistical Computing 1093s Platform: x86_64-pc-linux-gnu (64-bit) 1093s 1093s R is free software and comes with ABSOLUTELY NO WARRANTY. 1093s You are welcome to redistribute it under certain conditions. 1093s Type 'license()' or 'licence()' for distribution details. 1093s 1093s R is a collaborative project with many contributors. 1093s Type 'contributors()' for more information and 1093s 'citation()' on how to cite R or R packages in publications. 1093s 1093s Type 'demo()' for some demos, 'help()' for on-line help, or 1093s 'help.start()' for an HTML browser interface to help. 1093s Type 'q()' to quit R. 1093s 1093s > source(file.path("_helper", "init.R")) 1093s > 1093s > # - "Ensure we get warning if we try to run in handlers" ----------------------- 1093s > 1093s > try(unitize("_helper/unitizers/trivial.R")) 1093s 1093s Warning in check_call_stack() : 1093s It appears you are running unitizer inside an error handling function such as 1093s `withCallingHanlders`, `tryCatch`, or `withRestarts`. This is strongly dis- 1093s couraged as it may cause unpredictable behavior from unitizer in the event tests 1093s produce conditions / errors. We strongly recommend you re-run your tests 1093s outside of such handling functions. 1094s Warning in history_capt(history, interactive.mode) : 1094s Unable to capture history in non-interactive mode. 1094s | 4/4 tests passed; nothing to review. 1094s 1094s > tryCatch(unitize("_helper/unitizers/trivial.R")) 1094s 1094s Warning in check_call_stack() : 1094s It appears you are running unitizer inside an error handling function such as 1094s `withCallingHanlders`, `tryCatch`, or `withRestarts`. This is strongly dis- 1094s couraged as it may cause unpredictable behavior from unitizer in the event tests 1094s produce conditions / errors. We strongly recommend you re-run your tests 1094s outside of such handling functions. 1094s Warning in history_capt(history, interactive.mode) : 1094s Unable to capture history in non-interactive mode. 1094s | 4/4 tests passed; nothing to review. 1094s 1094s > withRestarts(unitize("_helper/unitizers/trivial.R")) 1094s 1094s Warning in check_call_stack() : 1094s It appears you are running unitizer inside an error handling function such as 1094s `withCallingHanlders`, `tryCatch`, or `withRestarts`. This is strongly dis- 1094s couraged as it may cause unpredictable behavior from unitizer in the event tests 1094s produce conditions / errors. We strongly recommend you re-run your tests 1094s outside of such handling functions. 1094s Warning in history_capt(history, interactive.mode) : 1094s Unable to capture history in non-interactive mode. 1094s | 4/4 tests passed; nothing to review. 1094s 1094s > 1094s > # need to figure out why running this without `try` in covr causes cover to 1094s > # fail with 1094s > # Error in aggregate.data.frame(mf[1L], mf[-1L], FUN = FUN, ...) : 1094s > # no rows to aggregate 1094s > 1094s > # - "Ensure we get error if we try to do something stupid..." ------------------ 1094s > 1094s > try( 1094s + withRestarts( 1094s + unitize("_helper/unitizers/trivial.R"), 1094s + unitizerInteractiveFail = function() NULL 1094s + ) 1094s + ) 1094s 1094s Warning in check_call_stack() : 1094s It appears you are running unitizer inside an error handling function such as 1094s `withCallingHanlders`, `tryCatch`, or `withRestarts`. This is strongly dis- 1094s couraged as it may cause unpredictable behavior from unitizer in the event tests 1094s produce conditions / errors. We strongly recommend you re-run your tests 1094s outside of such handling functions. 1094s Error in check_call_stack() : 1094s "unitizerInteractiveFail" restart is already defined; unitizer relies on this 1094s restart to manage evaluation so unitizer will not run if it is defined outside 1094s of `unitize`. If you did not define this restart contact maintainer. 1094s > 1094s > 1094s PASS 1094s Begin testing t-ischecks.R 1094s 1094s R version 4.3.2 (2023-10-31) -- "Eye Holes" 1094s Copyright (C) 2023 The R Foundation for Statistical Computing 1094s Platform: x86_64-pc-linux-gnu (64-bit) 1094s 1094s R is free software and comes with ABSOLUTELY NO WARRANTY. 1094s You are welcome to redistribute it under certain conditions. 1094s Type 'license()' or 'licence()' for distribution details. 1094s 1094s R is a collaborative project with many contributors. 1094s Type 'contributors()' for more information and 1094s 'citation()' on how to cite R or R packages in publications. 1094s 1094s Type 'demo()' for some demos, 'help()' for on-line help, or 1094s 'help.start()' for an HTML browser interface to help. 1094s Type 'q()' to quit R. 1094s 1094s > source(file.path("_helper", "init.R")) 1094s > # - "int.pos" ------------------------------------------------------------------ 1094s > 1094s > unitizer:::is.int.pos.1L(c(1, 2, 3)) # FALSE 1094s [1] FALSE 1094s > unitizer:::is.int.pos.1L(1) 1094s [1] TRUE 1094s > unitizer:::is.int.pos.1L(1) 1094s [1] TRUE 1094s > unitizer:::is.int.pos.1L(-1) # FALSE 1094s [1] FALSE 1094s > unitizer:::is.int.pos.1L(NA_integer_) # FALSE 1094s [1] FALSE 1094s > unitizer:::is.int.pos.2L(1:2) 1094s [1] TRUE 1094s > unitizer:::is.int.pos.2L(c(1, 2)) 1094s [1] TRUE 1094s > 1094s > # - "is.valid_two_arg" --------------------------------------------------------- 1094s > 1094s > f1 <- function(x, y) NULL 1094s > f2 <- function(...) NULL 1094s > f3 <- function(x, ...) NULL 1094s > f4 <- function(x, y, z) NULL 1094s > f5 <- function(x, y, z = 3) NULL 1094s > f6 <- function(x) NULL 1094s > unitizer:::is.two_arg_fun(f1) 1094s [1] TRUE 1094s > unitizer:::is.two_arg_fun(f2) 1094s [1] TRUE 1094s > unitizer:::is.two_arg_fun(f3) 1094s [1] TRUE 1094s > unitizer:::is.two_arg_fun(f4) 1094s [1] "cannot have any non-optional arguments other than first two" 1094s > unitizer:::is.two_arg_fun(f5) 1094s [1] TRUE 1094s > unitizer:::is.two_arg_fun(f6) 1094s [1] "does not have at least two arguments" 1094s > unitizer:::is.two_arg_fun(1) 1094s [1] "is not a function" 1094s > 1094s > # - "is.valid_capt_setting" ---------------------------------------------------- 1094s > 1094s > capt.test <- unitizer:::is.valid_capt_setting(c(T, T)) 1094s | value must be logical(2L) containing TRUE 1094s | / FALSE and with names `c("output", "message") 1094s 1094s > capt.test 1094s [1] FALSE 1094s > 1094s PASS 1094s Begin testing t-item.R 1095s 1095s R version 4.3.2 (2023-10-31) -- "Eye Holes" 1095s Copyright (C) 2023 The R Foundation for Statistical Computing 1095s Platform: x86_64-pc-linux-gnu (64-bit) 1095s 1095s R is free software and comes with ABSOLUTELY NO WARRANTY. 1095s You are welcome to redistribute it under certain conditions. 1095s Type 'license()' or 'licence()' for distribution details. 1095s 1095s R is a collaborative project with many contributors. 1095s Type 'contributors()' for more information and 1095s 'citation()' on how to cite R or R packages in publications. 1095s 1095s Type 'demo()' for some demos, 'help()' for on-line help, or 1095s 'help.start()' for an HTML browser interface to help. 1095s Type 'q()' to quit R. 1095s 1095s > source(file.path("_helper", "init.R")) 1095s > source(file.path("aammrtf", "ref.R")); make_ref_obj_funs("item") 1095s > 1095s > options(unitizer.color = FALSE) 1095s > 1095s > # These tests are intended to cover all the functions/classes/methods in: 1095s > # - item.R 1095s > # - item.sub.R 1095s > # - test_eval.R # indirectly 1095s > # - heal.R 1095s > # - unitizer.R 1095s > # Basically everything that can be tested non-interactively 1095s > # Helper funs 1095s > 1095s > callDep <- function(x) paste0(deparse(x@call, width.cutoff = 500), 1095s + collapse = "") 1095s > lsObjs <- function(x) paste0(x@ls$names, x@ls$status, collapse = ", ") 1095s > lsStat <- function(x) x@ls$status 1095s > lsInv <- function(x) isTRUE(attr(x@ls, "invalid")) 1095s > # Get started 1095s > 1095s > new.exps <- expression( 1095s + 1 + 1, 1095s + a <- 54, # keep 1095s + b <- 38, # keep 1095s + a + b, 1095s + e <- 5 * a, # keep 1095s + a ^ 2, # Keep 1095s + f <- e * a, 1095s + matrix(rep(f, 20)) # keep 1095s + ) 1095s > ref.exps <- expression( 1095s + 1 + 1, 1095s + a <- 54, 1095s + b <- 38, 1095s + a + b, 1095s + e <- 5 * a, 1095s + e ^ 3 1095s + ) 1095s > 1095s > Sys.sleep(0.2) 1095s > my.unitizer <- new("unitizer", id = 1, zero.env = new.env()) 1095s > # add ref.exps as new items 1095s > coi(my.unitizer <- my.unitizer + ref.exps) 1095s > my.unitizer2 <- new("unitizer", id = 2, zero.env = new.env()) 1095s > # now convert them to reference items 1095s > coi(my.unitizer2 <- my.unitizer2 + my.unitizer@items.new) 1095s > # now test against new.exps 1095s > coi(my.unitizer2 <- my.unitizer2 + new.exps) 1095s > 1095s > # - "item funs" ---------------------------------------------------------------- 1095s > 1095s > item <- my.unitizer@items.new[[1L]] 1095s > unitizer:::itemType(item) 1095s [1] "new" 1095s > try(unitizer:::itemType(item) <- "asdfasd") 1095s Error in unitizer:::`itemType<-`(`*tmp*`, value = "asdfasd") : 1095s Argument `value` must be in c("new", "reference") 1095s > unitizer:::itemType(item) <- "reference" 1095s > unitizer:::itemType(item) 1095s [1] "reference" 1095s > try(unitizer:::itemsType(my.unitizer@items.new) <- as.character(1:1000)) 1095s Error in unitizer:::`itemsType<-`(`*tmp*`, value = c("1", "2", "3", "4", : 1095s Argument `value` must be length 1L or have same length as argument `x` 1095s > try(item$booboo) 1095s Error in .local(x, i, j, ...) : 1095s Argument `name` must be in c("call", "state", "value", "conditions", "output", "message", "aborted") 1095s > 1095s > # - "unitizer creation worked as expected" ------------------------------------- 1095s > 1095s > validObject(my.unitizer, complete = TRUE) 1095s [1] TRUE 1095s > all.equal(capture.output(show(my.unitizer@items.new[[1L]])), rds(100)) 1095s [1] TRUE 1095s > identical(length(my.unitizer2), length(new.exps)) 1095s [1] TRUE 1095s > identical(length(my.unitizer2@items.new), length(new.exps)) 1095s [1] TRUE 1095s > identical(length(my.unitizer2@items.ref), length(ref.exps)) 1095s [1] TRUE 1095s > all.equal( 1095s + as.expression( 1095s + lapply(unitizer:::as.list(my.unitizer2@items.new), slot, "call") 1095s + ), 1095s + new.exps 1095s + ) 1095s [1] TRUE 1095s > all.equal( 1095s + as.expression( 1095s + lapply(unitizer:::as.list(my.unitizer2@items.ref), slot, "call") 1095s + ), 1095s + ref.exps 1095s + ) 1095s [1] TRUE 1095s > vals <- lapply( 1095s + unitizer:::as.list(my.unitizer2@items.new), function(x) x@data@value[[1L]] 1095s + ) 1095s > vals.ign <- unitizer:::ignored(my.unitizer2@items.new) 1095s > all.equal(vals[!vals.ign], lapply(new.exps, eval)[!vals.ign]) 1095s [1] TRUE 1095s > all(vapply(vals[vals.ign], is, logical(1L), "unitizerDummy")) 1095s [1] TRUE 1095s > 1095s > vals <- lapply( 1095s + unitizer:::as.list(my.unitizer2@items.ref), function(x) x@data@value[[1L]] 1095s + ) 1095s > vals.ign <- unitizer:::ignored(my.unitizer2@items.ref) 1095s > all.equal(vals[!vals.ign], lapply(ref.exps, eval)[!vals.ign]) 1095s [1] TRUE 1095s > all(vapply(vals[vals.ign], is, logical(1L), "unitizerDummy")) 1095s [1] TRUE 1095s > my.unitizer2@items.new.map 1095s [1] 1 2 3 4 5 NA NA NA 1095s > my.unitizer2@items.ref.map 1095s [1] 1 2 3 4 5 NA 1095s > my.unitizer2@tests.fail 1095s [1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE 1095s > my.unitizer2@tests.status 1095s [1] Pass Pass Pass Pass Pass New New New 1095s Levels: Pass Fail New Deleted Error 1095s > my.unitizer2@section.map 1095s [1] 1 1 1 1 1 1 1 1 1095s > unitizer:::ignored(my.unitizer2@items.new) 1095s [1] FALSE TRUE TRUE FALSE TRUE FALSE TRUE FALSE 1095s > unitizer:::ignored(my.unitizer2@items.ref) 1095s [1] FALSE TRUE TRUE FALSE TRUE FALSE 1095s > 1095s > # - "Size Measurement works" --------------------------------------------------- 1095s > 1095s > # Used to produce warnings because the same base.env was used for every 1095s > # unitizer because it was created on package load as part of the S4 class 1095s > # definition instead of in "initialize", so any time we instantiated more 1095s > # than one object they all shared the same environment, causing issues with 1095s > # saveRDS 1095s > x <- unitizer:::sizeUntz(my.unitizer2) 1095s > is.matrix(x) && is.numeric(x) 1095s [1] TRUE 1095s > colnames(x) 1095s [1] "size" "rds" 1095s > 1095s > # - "Environment healing works" ------------------------------------------------ 1095s > 1095s > items.mixed <- my.unitizer2@items.new[4:5] + my.unitizer2@items.ref[[1]] + 1095s + my.unitizer2@items.new[c(2, 6, 8)] 1095s > items.sorted <- unitizer:::healEnvs(items.mixed, my.unitizer2) 1096s > env.anc <- lapply(unitizer:::as.list(items.sorted), function(x) rev(unitizer:::env_ancestry(x@env, 1096s + my.unitizer2@base.env))) 1096s > max.len <- max(vapply(env.anc, length, 1L)) 1096s > env.anc.2 <- lapply(env.anc, function(x) { 1096s + length(x) <- max.len 1096s + x 1096s + }) 1096s > env.anc.df <- as.data.frame(env.anc.2, stringsAsFactors = FALSE) 1096s > # Here only the first item is reference, all others 1096s > length(unique(unlist(env.anc.df[2, ]))) 1096s [1] 1 1096s > all( 1096s + apply( 1096s + env.anc.df[-(1:2), -1], 1, 1096s + function(x) length(unique(Filter(Negate(is.na), x))) 1096s + ) == 1L 1096s + ) 1096s [1] TRUE 1096s > # First item is reference, all others are new 1096s > unitizer:::itemsType(items.sorted) 1096s [1] "reference" "new" "new" "new" "new" "new" 1096s [7] "new" "new" 1096s > # Expected order of ids 1096s > vapply(unitizer:::as.list(items.sorted), function(x) x@id, integer(1L)) 1096s [1] 1 2 3 4 5 6 7 8 1096s > lapply(unitizer:::as.list(items.sorted), function(x) x@ls$names) 1096s [[1]] 1096s character(0) 1096s 1096s [[2]] 1096s character(0) 1096s 1096s [[3]] 1096s character(0) 1096s 1096s [[4]] 1096s [1] "a" "b" 1096s 1096s [[5]] 1096s character(0) 1096s 1096s [[6]] 1096s [1] "a" "b" "e" 1096s 1096s [[7]] 1096s character(0) 1096s 1096s [[8]] 1096s [1] "a" "b" "e" "f" 1096s 1096s > unique(unlist(lapply(unitizer:::as.list(items.sorted), function(x) x@ls$status))) 1096s [1] "" 1096s > # Tests with conditions 1096s > 1096s > # - "Items with conditions" ---------------------------------------------------- 1096s > 1096s > my_fun <- function() { 1096s + warning("hello") 1096s + 25 1096s + } 1096s > ref.exps1a <- expression(stop("boom"), my_fun()) 1096s > my.unitizer1a <- new("unitizer", id = 100, zero.env = new.env()) 1096s > # add ref.exps as new items 1096s > coi(my.unitizer1a <- my.unitizer1a + ref.exps1a) 1096s > 1096s > all.equal(capture.output(show(my.unitizer1a@items.new[[1L]])), rds(200)) 1096s [1] TRUE 1096s > all.equal(capture.output(show(my.unitizer1a@items.new[[2L]])), rds(300)) 1096s [1] TRUE 1096s > all.equal( 1096s + capture.output(show(my.unitizer1a@items.new[[1L]]@data@conditions)), rds(400) 1096s + ) 1096s [1] TRUE 1096s > # - "Environment healing works 2" ---------------------------------------------- 1096s > 1096s > # Stars highlight items we are selecting, but keep in mind that unitizer only 1096s > # cares about non ignored tests, and that the selection status of ignored test 1096s > # has nothing to do with what we end up with wrt to ignored tests 1096s > 1096s > new.exps2 <- expression( 1096s + 1 + 1, # 1 * 1096s + a <- 54, # 2 1096s + b <- runif(5), # 3 1096s + howdy <- "yowser", # 4 * 1096s + a + b, # 5 * 1096s + e <- 5 * a, # 6 1096s + a ^ 2, # 7 1096s + f <- e * a, # 8 1096s + matrix(rep(f, 20)) # 9 * 1096s + ) 1096s > ref.exps2 <- expression( 1096s + 1 + 1, # 1 1096s + a <- 54, # 2 1096s + b <- runif(5), # 3 * 1096s + 25 + 3, # 4 1096s + q <- b ^ 2 / a, # 5 * 1096s + a + b, # 6 1096s + z <- w <- list(1, 2, 3), # 7 1096s + Reduce(`+`, z), # 8 * Doesn't exist, should connect back to `a + b` 1096s + e <- 5 * a, # 9 1096s + e ^ 3, # 10 * 1096s + e * a # 11 * 1096s + ) 1096s > 1096s > # Note that healEnvs modifies objects that contain environments, and as such 1096s > # you won't get the same result if you run this function twice, so don't be 1096s > # surprised if tests fail in those circumstances 1096s > my.unitizer3 <- new("unitizer", id = 1, zero.env = new.env()) 1096s > # add ref.exps as new items 1096s > coi(my.unitizer3 <- my.unitizer3 + ref.exps2) 1096s > my.unitizer4 <- new("unitizer", id = 2, zero.env = new.env()) 1096s > # now convert them to reference items 1096s > coi(my.unitizer4 <- my.unitizer4 + my.unitizer3@items.new) 1096s > # now test against new.exps 1096s > coi(my.unitizer4 <- my.unitizer4 + new.exps2) 1096s > coi( 1096s + items.mixed2 <- my.unitizer4@items.ref[c(8, 10, 3, 5, 11)] + 1096s + my.unitizer4@items.new[c(1, 4, 5, 9)] 1096s + ) 1096s > items.sorted2 <- unitizer:::healEnvs(items.mixed2, my.unitizer4) 1096s > 1096s > env.anc <- lapply(unitizer:::as.list(items.sorted2), function(x) rev(unitizer:::env_ancestry(x@env, 1096s + my.unitizer4@base.env))) 1096s > max.len <- max(vapply(env.anc, length, 1L)) 1096s > env.anc.2 <- lapply(env.anc, function(x) { 1096s + length(x) <- max.len 1096s + x 1096s + }) 1096s > # oldest ancestor the same 1096s > env.anc.df <- as.data.frame(env.anc.2, stringsAsFactors = FALSE) 1096s > length(unique(unname(unlist(env.anc.df[1, ])))) # 1 1096s [1] 1 1096s > # "base.env should be unitizer env") 1096s > identical( 1096s + env.anc.df[1, 1], unitizer:::env_name(my.unitizer4@base.env) 1096s + ) 1096s [1] TRUE 1096s > # "all tests should also have another sub base.env") 1096s > length(unique(unlist(env.anc.df[2, ]))) == 1L 1096s [1] TRUE 1096s > # "and it should be the items.ref here") 1096s > identical( 1096s + env.anc.df[2, 1], unitizer:::env_name(my.unitizer4@items.ref@base.env) 1096s + ) 1096s [1] TRUE 1096s > items <- items.sorted2 1096s > items.lst <- unitizer:::as.list(items) 1096s > # "new items should all have normal status", 1096s > heal.info <- cbind( 1096s + type = unitizer:::itemsType(items), ignored = unitizer:::ignored(items), 1096s + id = vapply(items.lst, slot, 1L, "id"), 1096s + call = vapply(items.lst, callDep, ""), 1096s + ls = vapply(items.lst, lsObjs, ""), 1096s + ls.invalid = vapply(items.lst, lsInv, TRUE) 1096s + ) 1096s > # "" 1096s > unique(unlist(lapply(items.lst[unitizer:::itemsType(items) == "new"], lsStat))) 1096s [1] "" 1096s > # "Reference tests should have no ls data", 1096s > unique(vapply(items.lst[unitizer:::ignored(items)], lsObjs, "")) 1096s [1] "" 1096s > all(vapply(items.lst[unitizer:::ignored(items)], lsInv, logical(1L))) 1096s [1] TRUE 1096s > 1096s > # - "ls works" ----------------------------------------------------------------- 1096s > 1096s > my.unitizer5 <- new("unitizer", id = 2, zero.env = new.env()) 1096s > # now add back our composite elements as references 1096s > coi(my.unitizer5 <- my.unitizer5 + items.sorted2) 1096s > # and new items 1096s > coi(my.unitizer5 <- my.unitizer5 + new.exps2) 1096s > 1096s > # This is an ignored test, so there will be some problems 1096s > env.val <- new.env(parent = my.unitizer5@items.new[[3]]@env) 1096s > env.eval <- new.env(parent = env.val) 1096s > assign(".NEW", my.unitizer5@items.new[[3]], env.val) 1096s > assign(".new", my.unitizer5@items.new[[3]]@data@value[[1L]], 1096s + env.val) 1096s > assign(".REF", my.unitizer5@items.ref[[my.unitizer5@items.new.map[[3]]]], 1096s + env.val) 1096s > assign(".ref", my.unitizer5@items.ref[[my.unitizer5@items.new.map[[3]]]]@data@value[[1L]], 1096s + env.val) 1096s > ls.res <- evalq(unitizer:::unitizer_ls(), env.eval) # warn 1096s Warning in unitizer:::unitizer_ls() : 1096s 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. 1096s > # Reference tests won't show up since they were nuked by `healEnvs` 1096s > all.equal(ls.res, rds(500)) 1096s [1] TRUE 1096s > # These are normal tests so should work 1096s > env.val <- new.env(parent = my.unitizer5@items.new[[9]]@env) 1096s > env.eval <- new.env(parent = env.val) 1096s > assign(".NEW", my.unitizer5@items.new[[9]], env.val) 1096s > assign(".new", my.unitizer5@items.new[[9]]@data@value[[1L]], 1096s + env.val) 1096s > assign(".REF", my.unitizer5@items.ref[[my.unitizer5@items.new.map[[9]]]], 1096s + env.val) 1096s > assign(".ref", my.unitizer5@items.ref[[my.unitizer5@items.new.map[[9]]]]@data@value[[1L]], 1096s + env.val) 1096s > all.equal(evalq(unitizer:::unitizer_ls(), env.eval), 1096s + rds(600)) 1096s [1] TRUE 1096s > all.equal(capture.output(print(evalq(unitizer:::unitizer_ls(), 1096s + env.eval))), rds(700)) 1096s [1] TRUE 1096s > 1096s > # - "Environment Healing Works #3" --------------------------------------------- 1096s > # 1096s > # Main difference to previous versions is that we're testing that moving the 1096s > # order of tests around between ref and new still works 1096s > # 1096s > # Test that reference tests moving around doesn't cause major issues 1096s > 1096s > new.exps6 <- expression( 1096s + 1 + 1, # 1 * 1096s + a <- 54, # 2 1096s + b <- runif(5), # 3 1096s + howdy <- "yowser", # 4 1096s + a + b, # 5 1096s + e <- 5 * a, # 6 1096s + a ^ 2, # 7 * 1096s + f <- 25, # 8 * 1096s + matrix(rep(f, 20)) # 9 1096s + ) 1096s > ref.exps6 <- expression( 1096s + 1 + 1, # 1 1096s + a <- 54, # 2 1096s + f <- 25, # 3 1096s + matrix(rep(f, 20)), # 4 * 1096s + b <- runif(5), # 5 1096s + boomboom <- "boo", # 6 1096s + a + b, # 7 * 1096s + a + b + f, # 8 1096s + e <- 5 * a, # 9 1096s + a ^ 2 # 10 1096s + ) 1096s > my.unitizer10 <- new("unitizer", id = 1, zero.env = new.env()) 1096s > # add ref.exps as new items 1096s > coi(my.unitizer10 <- my.unitizer10 + ref.exps6) 1096s > my.unitizer11 <- new("unitizer", id = 2, zero.env = new.env()) 1096s > # now convert them to reference items 1096s > coi(my.unitizer11 <- my.unitizer11 + my.unitizer10@items.new) 1096s > # now test against new.exps 1096s > coi(my.unitizer11 <- my.unitizer11 + new.exps6) 1096s > items.mixed3 <- my.unitizer11@items.ref[c(4, 7)] + 1096s + my.unitizer11@items.new[c(1, 7, 8)] 1096s > items.sorted3 <- unitizer:::healEnvs(items.mixed3, my.unitizer11) 1096s > 1096s > # Both reference tests get appended to item #1, which means among other things 1096s > # that for the second refernce test, the `a` object is absent (but `b` is 1096s > # present because it gets sucked in by virtue of being an ignored test just 1096s > # ahead of it) 1096s > items <- items.sorted3 1096s > items.lst <- unitizer:::as.list(items) 1096s > cbind( 1096s + type = unitizer:::itemsType(items), ignored = unitizer:::ignored(items), 1096s + id = vapply(items.lst, slot, 1L, "id"), 1096s + call = vapply(items.lst, callDep, ""), 1096s + ls = vapply(items.lst, lsObjs, ""), 1096s + ls.invalid = vapply(items.lst, lsInv, TRUE) 1096s + ) 1096s type ignored id call ls 1096s [1,] "new" "FALSE" "1" "1 + 1" "" 1096s [2,] "reference" "TRUE" "2" "a <- 54" "" 1096s [3,] "reference" "TRUE" "3" "f <- 25" "" 1096s [4,] "reference" "FALSE" "4" "matrix(rep(f, 20))" "a, f" 1096s [5,] "reference" "TRUE" "5" "b <- runif(5)" "" 1096s [6,] "reference" "TRUE" "6" "boomboom <- \"boo\"" "" 1096s [7,] "reference" "FALSE" "7" "a + b" "a*, b, boomboom, f*" 1096s [8,] "new" "TRUE" "6" "e <- 5 * a" "" 1096s [9,] "new" "FALSE" "7" "a^2" "a, b, e, howdy" 1096s ls.invalid 1096s [1,] "FALSE" 1096s [2,] "TRUE" 1096s [3,] "TRUE" 1096s [4,] "FALSE" 1096s [5,] "TRUE" 1096s [6,] "TRUE" 1096s [7,] "FALSE" 1096s [8,] "TRUE" 1096s [9,] "FALSE" 1096s > # - "No circular environment references" --------------------------------------- 1096s > 1096s > # This is to test for issue #2, which resulted in a self referential environment 1096s > # in the stored items. The following code used to fail: 1096s > new.exps3 <- expression(1 + 1, a <- 54, b <- 5, 2 + 2, runif(1)) 1096s > ref.exps3 <- expression(1 + 1, a <- 54, 2 + 2, runif(1)) 1096s > my.unitizer6 <- new("unitizer", id = 1, zero.env = new.env()) 1096s > # add ref.exps as new items 1096s > coi(my.unitizer6 <- my.unitizer6 + ref.exps3) 1096s > my.unitizer7 <- new("unitizer", id = 2, zero.env = new.env()) 1096s > # now convert them to reference items 1096s > coi(my.unitizer7 <- my.unitizer7 + my.unitizer6@items.new) 1096s > # now test against new.exps 1096s > coi(my.unitizer7 <- my.unitizer7 + new.exps3) 1096s > # Note this doesn't test that there are no circular references, only that what 1096s > # used to fail no longer fails. 1096s > 1096s > cbind(my.unitizer7@tests.new, my.unitizer7@tests.result) 1096s value conditions output message aborted 1096s [1,] FALSE TRUE TRUE TRUE TRUE TRUE 1096s [2,] FALSE TRUE TRUE TRUE TRUE TRUE 1096s [3,] TRUE FALSE FALSE FALSE FALSE FALSE 1096s [4,] FALSE TRUE TRUE TRUE TRUE TRUE 1096s [5,] FALSE FALSE TRUE TRUE TRUE TRUE 1096s > 1096s > # - "testFuns" ----------------------------------------------------------------- 1096s > 1096s > # Error objects 1096s > 1096s > # these two should just work fine 1096s > is(new("testFuns", output = all.equal, value = function(x, y) TRUE), "testFuns") 1096s [1] TRUE 1096s > is(new("testFuns"), "testFuns") 1096s [1] TRUE 1096s > try(new("testFuns", output = all.equal, value = function(x, y, z) TRUE)) 1096s Error in validObject(.Object) : 1096s 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). 1096s > # this should work too now, since technically has two args 1096s > is( 1096s + new("testFuns", output = all.equal, value = function(x, y = 1, z = 1) TRUE), 1096s + "testFuns" 1096s + ) 1096s [1] TRUE 1096s > try(new("testFuns", cabbage = all.equal)) 1096s Error in initialize(value, ...) : 1096s Can't initialize invalid slots "cabbage" 1096s > 1096s > # - "Misc" --------------------------------------------------------------------- 1096s > 1096s > new.exps4 <- expression(a <- function() b(), b <- function() TRUE, a()) 1096s > my.unitizer8 <- new("unitizer", id = 3, zero.env = new.env()) 1096s > new.exps5 <- expression(a <- function() b(), NULL, b <- function() TRUE, a()) 1096s > my.unitizer9 <- new("unitizer", id = 4, zero.env = new.env()) 1096s > coi(x <- my.unitizer9 + new.exps5) 1096s > 1096s > local({ 1096s + fun <- function() quote(stop("This error should not be thrown")) 1096s + is( 1096s + new( 1096s + "unitizerItem", value = fun(), call = quote(fun()), 1096s + env = sys.frame(sys.parent() + 1L) 1096s + ), 1096s + "unitizerItem" 1096s + ) 1096s + }) 1096s [1] TRUE 1096s > # Nested environment hand waving can break down under certain circumstances 1096s > # this first one should work because there are no tests until after all 1096s > # the pieces necessary to run `a()` are defined: 1096s > coi(res <- my.unitizer8 + new.exps4) 1096s > is(res, "unitizer") 1096s [1] TRUE 1096s > # this should break because the NULL forces `b` to be stored in a different 1096s > # environment to `a`; note: funky error message matching because in 1096s > # at least some versions of rdevel reported fun name seems to change 1096s > # (possibly related to level 3 bytecode) 1096s > # could not find fun 1096s > x@items.new[[4]]@data@message[[1]] 1096s [1] "Error in b() : could not find function \"b\"\n" 1096s > 1096s > # - "Comparison Function Errors" ----------------------------------------------- 1096s > 1096s > exps <- expression(fun <- function(x, y) warning("not gonna work"), 1096s + unitizer_sect(compare = fun, expr = { 1096s + 1 + 1 1096s + })) 1096s > my.unitizer <- new("unitizer", id = 25, zero.env = new.env()) 1096s > # add ref.exps as new items 1096s > coi(my.unitizer <- my.unitizer + exps) 1096s > coi(my.unitizer2 <- new("unitizer", id = 26, zero.env = new.env()) + 1096s + my.unitizer@items.new) 1096s > # warn: not gonna work 1096s > coi(my.unitizer2 <- my.unitizer2 + exps) 1096s Warning in close_and_clear(e1@global$cons) : 1096s 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: 1096s Warning in fun(2, 2) : not gonna work 1096s 1096s > as.character(my.unitizer2@tests.status) 1096s [1] "Pass" "Error" 1096s > my.unitizer2@tests.errorDetails[[2]]@value@value 1096s [1] "comparison function `fun` signaled a condition of class `c(\"simpleWarning\", \"warning\", \"condition\")`, with message \"not gonna work\" and call `fun(2, 2)`." 1096s > 1096s > # - "Language Objects Tested Properly" ----------------------------------------- 1096s > 1096s > exps <- expression(quote(x), quote(x + y), quote(identity(x)), 1096s + expression(1 + y), quote(expression(1 + y))) 1096s > my.unitizer <- new("unitizer", id = 27, zero.env = new.env()) 1096s > # add ref.exps as new items 1096s > coi(my.unitizer <- my.unitizer + exps) 1096s > coi(my.unitizer2 <- new("unitizer", id = 28, zero.env = new.env()) + 1096s + my.unitizer@items.new) 1096s > coi(my.unitizer2 <- my.unitizer2 + exps) 1096s > # This used to error b/c expressions returning unevaluated calls/symbols were 1096s > # not compared as such (they were evaluated) 1096s > as.character(my.unitizer2@tests.status) 1096s [1] "Pass" "Pass" "Pass" "Pass" "Pass" 1096s > 1096s > # - "Test Fun Captured Properly" ----------------------------------------------- 1096s > 1096s > new("unitizerItemTestFun", fun = identical)@fun.name 1096s [1] "identical" 1096s > 1096s > 1096s PASS 1096s Begin testing t-list.R 1096s 1096s R version 4.3.2 (2023-10-31) -- "Eye Holes" 1096s Copyright (C) 2023 The R Foundation for Statistical Computing 1096s Platform: x86_64-pc-linux-gnu (64-bit) 1096s 1096s R is free software and comes with ABSOLUTELY NO WARRANTY. 1096s You are welcome to redistribute it under certain conditions. 1096s Type 'license()' or 'licence()' for distribution details. 1096s 1096s R is a collaborative project with many contributors. 1096s Type 'contributors()' for more information and 1096s 'citation()' on how to cite R or R packages in publications. 1096s 1096s Type 'demo()' for some demos, 'help()' for on-line help, or 1096s 'help.start()' for an HTML browser interface to help. 1096s Type 'q()' to quit R. 1096s 1096s > source(file.path("_helper", "init.R")) 1096s > 1096s > lst <- new("unitizerList") 1096s > 1096s > # - "unitizerList basic tests" ------------------------------------------------- 1096s > 1096s > length(lst) == 0L 1096s [1] TRUE 1096s > is(lst <- unitizer:::append(lst, 5), "unitizerList") 1096s [1] TRUE 1096s > length(lst) == 1L 1096s [1] TRUE 1096s > is( 1096s + lst <- unitizer:::append( 1096s + lst, list("booyah", list(1:3), matrix(1:9, nrow = 3)) 1096s + ), "unitizerList" 1096s + ) 1096s [1] TRUE 1096s > length(lst) == 4L 1096s [1] TRUE 1096s > is(lst[3L], "unitizerList") 1096s [1] TRUE 1096s > is(lst[[3L]], "list") 1096s [1] TRUE 1096s > lst <- unitizer:::append(lst, list(data.frame(a = letters[1:3])), 2L) 1096s > is(lst[[3L]], "data.frame") 1096s [1] TRUE 1096s > length(lst[1:4]) == 4L 1096s [1] TRUE 1096s > lst[[4L]] <- "boo" 1096s > is(lst[[4L]], "character") 1096s [1] TRUE 1096s > lst[4L:5L] <- letters[1:2] 1096s > 1096s > c(lst[[4L]], lst[[5L]]) 1096s [1] "a" "b" 1096s > lst[[4L]] 1096s [1] "a" 1096s > 1096s > is(unitizer:::as.list(lst), "list") 1096s [1] TRUE 1096s > length(unitizer:::as.list(lst)) == 5L 1096s [1] TRUE 1096s > is(unitizer:::as.expression(lst), "expression") 1096s [1] TRUE 1096s > 1096s > try(unitizer:::getItem(lst)) # error 1096s Error in .local(x, ...) : 1096s Internal pointer for `x` not initialized; initialize with `nextItem` 1096s > lst <- unitizer:::nextItem(lst) 1096s > unitizer:::getItem(lst) 1096s [1] 5 1096s > lst <- unitizer:::nextItem(lst) 1096s > unitizer:::getItem(lst) 1096s [1] "booyah" 1096s > lst <- unitizer:::prevItem(lst) 1096s > unitizer:::getItem(lst) 1096s [1] 5 1096s > lst <<- lst # leftover from testthat testing? 1096s > 1096s > # - "unitizerList pointer seeking" --------------------------------------------- 1096s > 1096s > for (i in 1:10) lst <- unitizer:::nextItem(lst) 1096s > try(unitizer:::getItem(lst)) 1096s Error in .local(x, ...) : Internal pointer for `x` is corrupted 1096s > unitizer:::done(lst) 1096s [1] TRUE 1096s > is(lst <- unitizer:::reset(lst, "back"), "unitizerList") 1096s [1] TRUE 1096s > try(unitizer:::reset(lst, letters)) 1096s Error in .local(x, ...) : 1096s Argument `position` must be `NULL`, or "front" or "back" 1096s > try(unitizer:::reset(lst, NA_character_)) 1096s Error in .local(x, ...) : 1096s Argument `position` must be `NULL`, or "front" or "back" 1096s > try(unitizer:::getItem(lst)) 1096s Error in .local(x, ...) : 1096s Internal pointer for `x` not initialized; initialize with `prevItem` 1096s > lst <- unitizer:::prevItem(lst) 1096s > unitizer:::getItem(lst) == "b" 1096s [1] TRUE 1096s > while (!unitizer:::done(lst)) { 1096s + item <- unitizer:::getItem(lst) 1096s + lst <- unitizer:::prevItem(lst) 1096s + } 1096s > item == 5L 1096s [1] TRUE 1096s > try(unitizer:::getItem(lst)) 1096s Error in .local(x, ...) : 1096s Internal pointer for `x` outside of range for `x`; test for this condition with `done`, or reset with `reset` 1096s > withCallingHandlers( 1096s + lst[[4]] <- "new value", 1096s + warning = function() stop("A Warning!") 1096s + ) 1096s > 1096s > for (i in 1:5) lst <- unitizer:::nextItem(lst) 1096s > lst@.pointer 1096s [1] 5 1096s > 1096s > # - "unitizerList value replacement and pointer adjustments" ------------------- 1096s > 1096s > lst[[4]] <- NULL 1096s > lst@.pointer 1096s [1] 4 1096s > unitizer:::reset(lst, "back") 1096s An object of class "unitizerList" 1096s Slot ".items": 1096s [[1]] 1096s [1] 5 1096s 1096s [[2]] 1096s [1] "booyah" 1096s 1096s [[3]] 1096s a 1096s 1 a 1096s 2 b 1096s 3 c 1096s 1096s [[4]] 1096s [1] "b" 1096s 1096s 1096s Slot ".pointer": 1096s [1] 5 1096s 1096s Slot ".seek.fwd": 1096s [1] FALSE 1096s 1096s > lst.len <- length(lst) 1096s > identical(lst@.pointer, lst.len) 1096s [1] TRUE 1096s > lst[2:3] <- letters[1:2] 1096s > identical(lst@.pointer, lst.len) 1096s [1] TRUE 1096s > lst[2:3] <- list(NULL, NULL) 1096s > identical(lst@.pointer, lst.len) 1096s [1] TRUE 1096s > lst[2:3] <- NULL 1096s > identical(lst@.pointer, lst.len - 2L) 1096s [1] TRUE 1096s > 1096s > lst <- unitizer:::reset(lst, "front") 1096s > for (i in 1:2) lst <- unitizer:::nextItem(lst) 1096s > curr.point <- lst@.pointer 1096s > lst[[3]] <- NULL 1096s > identical(curr.point, lst@.pointer) 1096s [1] TRUE 1096s > lst <- unitizer:::append(lst, list(5, 6, "blaskdjf"), 1L) 1096s > identical(curr.point + 3L, lst@.pointer) 1096s [1] TRUE 1096s > lst <- unitizer:::append(lst, list(matrix(1:9, nrow = 3)), 5L) 1096s > identical(curr.point + 3L, lst@.pointer) 1096s [1] TRUE 1096s > 1096s > # - "Append Factors Works" ----------------------------------------------------- 1096s > 1096s > vec <- factor(letters[1:3], levels = letters) 1096s > vec2 <- factor(letters[10:15], levels = letters) 1096s > 1096s > all.equal(structure(c(1L, 2L, 3L, 10L, 11L, 12L, 13L, 14L, 1096s + 15L), .Label = c("a", "b", "c", "d", "e", "f", "g", "h", 1096s + "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", 1096s + "u", "v", "w", "x", "y", "z"), class = "factor"), append(vec, 1096s + vec2)) 1096s [1] TRUE 1096s > all.equal(structure(c(1L, 2L, 10L, 11L, 12L, 13L, 14L, 15L, 1096s + 3L), .Label = c("a", "b", "c", "d", "e", "f", "g", "h", "i", 1096s + "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", 1096s + "v", "w", "x", "y", "z"), class = "factor"), append(vec, 1096s + vec2, 2)) 1096s [1] TRUE 1096s > 1096s > all.equal(structure(c(10L, 11L, 12L, 13L, 1L, 2L, 3L, 14L, 1096s + 15L), .Label = c("a", "b", "c", "d", "e", "f", "g", "h", 1096s + "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", 1096s + "u", "v", "w", "x", "y", "z"), class = "factor"), append(vec2, 1096s + vec, 4)) 1096s [1] TRUE 1096s > try(append(vec2, vec, 20)) 1096s Error in append(vec2, vec, 20) : 1096s Argument after must be integer like between 0 and length(x) 1096s > try(append(vec2, vec, -5)) 1096s Error in append(vec2, vec, -5) : 1096s Argument after must be integer like between 0 and length(x) 1096s > 1096s > # - "List coersion works even inside apply functions" -------------------------- 1096s > 1096s > ulist <- new("unitizerList", .items = list("a", 1, 2, "b")) 1096s > identical(lapply(ulist, identity), ulist@.items) 1096s [1] TRUE 1096s > 1096s > # - "Errors" ------------------------------------------------------------------- 1096s > 1096s > setClass("uhtsdfoqiuerhzb", slots = c(a = "integer")) 1096s > dummy <- new("uhtsdfoqiuerhzb", a = 1L) 1096s > lst2 <- new("unitizerList", .items = list(1, 2, 3)) 1096s > try(append(lst2, 5, after = -1)) 1096s Error in append(lst2, 5, after = -1) : 1096s Argument `after` must be a length 1 numeric greater than zero 1096s > try(append(lst2, dummy)) 1096s Error in as.list.default(values) : 1096s no method for coercing this S4 class to a vector 1096s Error in append(lst2, dummy) : 1096s Unable to coerce argument `values` to appropriate type; see previous errors for details. 1096s > 1096s > lst3 <- new("unitizerList", .items = expression(1, 2, 3)) 1096s > try(append(lst3, dummy)) 1096s Error in as.expression.default(values) : 1096s no method for coercing this S4 class to a vector 1096s Error in append(lst3, dummy) : 1096s Unable to coerce argument `values` to appropriate type; see previous errors for details. 1096s > 1096s > # - "Set Names" ---------------------------------------------------------------- 1096s > 1096s > nlst <- new("unitizerList", .items = list(a = "a", b = "b")) 1096s > names(nlst) <- toupper(names(nlst)) 1096s > as.list(nlst) 1096s $A 1096s [1] "a" 1096s 1096s $B 1096s [1] "b" 1096s 1096s > 1096s > 1096s PASS 1096s Begin testing t-misc.R 1097s 1097s R version 4.3.2 (2023-10-31) -- "Eye Holes" 1097s Copyright (C) 2023 The R Foundation for Statistical Computing 1097s Platform: x86_64-pc-linux-gnu (64-bit) 1097s 1097s R is free software and comes with ABSOLUTELY NO WARRANTY. 1097s You are welcome to redistribute it under certain conditions. 1097s Type 'license()' or 'licence()' for distribution details. 1097s 1097s R is a collaborative project with many contributors. 1097s Type 'contributors()' for more information and 1097s 'citation()' on how to cite R or R packages in publications. 1097s 1097s Type 'demo()' for some demos, 'help()' for on-line help, or 1097s 'help.start()' for an HTML browser interface to help. 1097s Type 'q()' to quit R. 1097s 1097s > source(file.path("_helper", "init.R")) 1097s > source(file.path("aammrtf", "ref.R")); make_ref_obj_funs("refobjs") 1097s > 1097s > # - "Text wrapping" ------------------------------------------------------------ 1097s > 1097s > var <- "humpty dumpty sat on a truck and had a big dump" 1097s > # expect_true(all(nchar(unlist(unitizer:::text_wrap(var, 10))) <= 1097s > writeLines(unlist(unitizer:::text_wrap(var, 10))) 1097s humpty dum 1097s pty sat on 1097s a truck a 1097s nd had a b 1097s ig dump 1097s > all(nchar(unlist(unitizer:::text_wrap(var, 10))) <= 10) 1097s [1] TRUE 1097s > 1097s > var2 <- rep(var, 4) 1097s > # expect_true(all(nchar(wrp <- unlist(unitizer:::text_wrap(var2, 1097s > # c(20, 15)))) <= 20) && length(wrp) == 14) 1097s > writeLines(unlist(unitizer:::text_wrap(var2, c(20, 15)))) 1097s humpty dumpty sat on 1097s a truck and had a b 1097s ig dump 1097s humpty dumpty s 1097s at on a truck a 1097s nd had a big du 1097s mp 1097s humpty dumpty sat on 1097s a truck and had a b 1097s ig dump 1097s humpty dumpty s 1097s at on a truck a 1097s nd had a big du 1097s mp 1097s > all(nchar(wrp <- unlist(unitizer:::text_wrap(var2, c(20, 15)))) <= 1097s + 20) && length(wrp) == 14 1097s [1] TRUE 1097s > 1097s > # - "Headers" ------------------------------------------------------------------ 1097s > 1097s > # these basically require visual inspection 1097s > 1097s > unitizer:::H1("hello world") 1097s +------------------------------------------------------------------------------+ 1097s | hello world | 1097s +------------------------------------------------------------------------------+ 1097s 1097s > unitizer:::H2("hello world") 1097s = hello world ================================================================== 1097s 1097s > unitizer:::H3("hello world") 1097s - hello world ------------------------------------------------------------------ 1097s 1097s > 1097s > # cause an error 1097s > try(print(unitizer:::H1(rep_len("hello world", 10)))) 1097s Error in header(x, 1L) : 1097s Argument `x` must be a one length character vector 1097s > 1097s > h.w.long <- paste0(rep_len("hello world", 10), collapse = " ") 1097s > unitizer:::H1(h.w.long) 1097s +------------------------------------------------------------------------------+ 1097s | hello world hello world hello world hello world hello world hello world | 1097s | hello world hello world hello world hello world | 1097s +------------------------------------------------------------------------------+ 1097s 1097s > unitizer:::H2(h.w.long) 1097s = hello world hello world hello world hello world hello world hello world h... = 1097s 1097s > print(unitizer:::H2("No margin"), margin = "none") # no extra line below 1097s = No margin ==================================================================== 1097s > 1097s > # - "Valid Names convert names to valid" --------------------------------------- 1097s > 1097s > # expect_equal(unitizer:::valid_names("hello"), "hello") 1097s > unitizer:::valid_names("hello") 1097s [1] "hello" 1097s > # expect_equal(unitizer:::valid_names(".hello"), ".hello") 1097s > unitizer:::valid_names(".hello") 1097s [1] ".hello" 1097s > # expect_equal(unitizer:::valid_names("1hello"), "`1hello`") 1097s > unitizer:::valid_names("1hello") 1097s [1] "`1hello`" 1097s > # expect_equal(unitizer:::valid_names("hello kitty"), "`hello kitty`") 1097s > unitizer:::valid_names("hello kitty") 1097s [1] "`hello kitty`" 1097s > # expect_equal(unitizer:::valid_names("h3llo"), "`h3llo`") 1097s > unitizer:::valid_names("h3llo") 1097s [1] "`h3llo`" 1097s > # expect_equal(unitizer:::valid_names("h_llo"), "h_llo") 1097s > unitizer:::valid_names("h_llo") 1097s [1] "h_llo" 1097s > # expect_equal(unitizer:::valid_names("$hot"), "`$hot`") 1097s > unitizer:::valid_names("$hot") 1097s [1] "`$hot`" 1097s > # expect_equal(unitizer:::valid_names("HELLO"), "HELLO") 1097s > unitizer:::valid_names("HELLO") 1097s [1] "HELLO" 1097s > 1097s > # - "strtrunc" ----------------------------------------------------------------- 1097s > 1097s > # expect_equal(unitizer:::strtrunc("hollywood is for starlets", 1097s > # 5), "ho...") 1097s > unitizer:::strtrunc("hollywood is for starlets", 5) 1097s [1] "ho..." 1097s > # expect_error(unitizer:::strtrunc(5, "hollywood is for starlets")) 1097s > try(unitizer:::strtrunc(5, "hollywood is for starlets")) 1097s Error in unitizer:::strtrunc(5, "hollywood is for starlets") : 1097s Argument `x` must be character 1097s > 1097s > # - "environment name tools" --------------------------------------------------- 1097s > 1097s > env1 <- new.env(parent = globalenv()) 1097s > env2 <- new.env(parent = env1) 1097s > env3 <- new.env(parent = env2) 1097s > env4 <- new.env(parent = env3) 1097s > # expect_true(is.character(ename <- unitizer:::env_name(env3)) && 1097s > # identical(length(ename), 1L)) 1097s > is.character(ename <- unitizer:::env_name(env3)) && identical(length(ename), 1L) 1097s [1] TRUE 1097s > # expect_true(is.character(envanc <- unitizer:::env_ancestry(env4)) && 1097s > # identical(length(envanc), 5L) && identical(envanc[[5L]], 1097s > # "R_GlobalEnv")) 1097s > is.character(envanc <- unitizer:::env_ancestry(env4)) && 1097s + identical(length(envanc), 5L) && identical(envanc[[5L]], "R_GlobalEnv") 1097s [1] TRUE 1097s > 1097s > # - "deparse peek" ------------------------------------------------------------- 1097s > 1097s > expr1 <- quote(1 + 1 + 3) 1097s > expr2 <- quote(for (i in 1:100) { 1097s + loop.val <- sample(1:1000, 200, replace = TRUE) 1097s + loop.val <- loop.val * 200/3000 * mean(runif(20000)) 1097s + }) 1097s > # expect_equal("1 + 1 + 3", unitizer:::deparse_peek(expr1, 20L)) 1097s > unitizer:::deparse_peek(expr1, 20L) 1097s [1] "1 + 1 + 3" 1097s > 1097s > # expect_error(unitizer:::deparse_peek(expr1, 3L)) 1097s > try(unitizer:::deparse_peek(expr1, 3L)) 1097s Error in unitizer:::deparse_peek(expr1, 3L) : 1097s Argument `len` must be an integer greater than four 1097s > # expect_equal("1 ...", unitizer:::deparse_peek(expr1, 5L)) 1097s > unitizer:::deparse_peek(expr1, 5L) 1097s [1] "1 ..." 1097s > 1097s > # expect_equal("for (i in 1:100) { loop.val <- sam...", unitizer:::deparse_peek(expr2, 1097s > # 40L)) 1097s > unitizer:::deparse_peek(expr2, 40L) 1097s [1] "for (i in 1:100) { loop.val <- sam..." 1097s > 1097s > # - "deparse fun" -------------------------------------------------------------- 1097s > 1097s > # expect_identical(unitizer:::deparse_fun(quote(fun)), "fun") 1097s > unitizer:::deparse_fun(quote(fun)) 1097s [1] "fun" 1097s > # expect_identical(unitizer:::deparse_fun(quote(function(x) NULL)), 1097s > # NA_character_) 1097s > unitizer:::deparse_fun(quote(function(x) NULL)) 1097s [1] NA 1097s > # expect_identical(unitizer:::deparse_fun("hello"), character(0L)) 1097s > unitizer:::deparse_fun("hello") 1097s character(0) 1097s > 1097s > # - "deparse_prompt" ----------------------------------------------------------- 1097s > 1097s > suppressWarnings(glob <- unitizer:::unitizerGlobal$new()) 1097s > item <- unitizer:::exec(quote(if (TRUE) { 1097s + 25 1097s + } else { 1097s + 42 1097s + }), new.env(), glob) 1097s > unitizer:::deparse_prompt(item) 1097s [1] "> if (TRUE) {" "+ 25" "+ } else {" "+ 42" 1097s [5] "+ }" 1097s > 1097s > # - "deparse_mixed" ------------------------------------------------------------ 1097s > 1097s > b <- setNames(1:3, letters[1:3]) 1097s > x <- quote(1 + b) 1097s > x[[3]] <- b 1097s > # expect_equal(unitizer:::deparse_mixed(x), "quote(1 + 1:3)") 1097s > unitizer:::deparse_mixed(x) 1097s [1] "quote(1 + 1:3)" 1097s > y <- quote(1 + 3 + b) 1097s > y[[3]] <- b 1097s > # expect_equal(unitizer:::deparse_mixed(y), "quote(1 + 3 + 1:3)") 1097s > unitizer:::deparse_mixed(y) 1097s [1] "quote(1 + 3 + 1:3)" 1097s > 1097s > # - "(Un)ordered Lists" -------------------------------------------------------- 1097s > 1097s > vec <- c("hello htere how are you blah blah blah blah blah", 1097s + "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.", 1097s + letters[1:10]) 1097s > 1097s > # expect_equal(as.character(unitizer:::OL(vec), width = 100L), 1097s > # c(" 1. hello htere how are you blah blah blah blah blah", 1097s > # " 2. this is helpful you know", " 3. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut ", 1097s > # " labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco ", 1097s > # " laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in ", 1097s > # " voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat ", 1097s > # " non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.", 1097s > # " 4. a", " 5. b", " 6. c", " 7. d", " 8. e", " 9. f", 1097s > # "10. g", "11. h", "12. i", "13. j")) 1097s > writeLines(as.character(unitizer:::OL(vec), width = 100L)) 1097s 1. hello htere how are you blah blah blah blah blah 1097s 2. this is helpful you know 1097s 3. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut 1097s labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco 1097s laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in 1097s voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat 1097s non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 1097s 4. a 1097s 5. b 1097s 6. c 1097s 7. d 1097s 8. e 1097s 9. f 1097s 10. g 1097s 11. h 1097s 12. i 1097s 13. j 1097s > 1097s > # expect_equal(as.character(unitizer:::UL(vec), width = 20L), c("- hello htere how ", 1097s > # " are you blah blah ", " blah blah blah", "- this is helpful ", 1097s > # " you know", "- Lorem ipsum dolor ", " sit amet, consec-", 1097s > # " tetur adipisicing ", " elit, sed do ", " eiusmod tempor ", 1097s > # " incididunt ut ", " labore et dolore ", " magna aliqua. Ut ", 1097s > # " enim ad minim ", " veniam, quis ", " nostrud exer-", 1097s > # " citation ullamco ", " laboris nisi ut ", " aliquip ex ea ", 1097s > # " commodo consequat.", " Duis aute irure ", " dolor in reprehen-", 1097s > # " derit in voluptate", " velit esse cillum ", " dolore eu fugiat ", 1097s > # " nulla pariatur. ", " Excepteur sint ", " occaecat cupidatat", 1097s > # " non proident, sunt", " in culpa qui ", " officia deserunt ", 1097s > # " mollit anim id est", " laborum.", "- a", "- b", "- c", 1097s > # "- d", "- e", "- f", "- g", "- h", "- i", "- j")) 1097s > 1097s > writeLines(as.character(unitizer:::UL(vec), width = 20L)) 1097s - hello htere how 1097s are you blah blah 1097s blah blah blah 1097s - this is helpful 1097s you know 1097s - Lorem ipsum dolor 1097s sit amet, consec- 1097s tetur adipisicing 1097s elit, sed do 1097s eiusmod tempor 1097s incididunt ut 1097s labore et dolore 1097s magna aliqua. Ut 1097s enim ad minim 1097s veniam, quis 1097s nostrud exer- 1097s citation ullamco 1097s laboris nisi ut 1097s aliquip ex ea 1097s commodo consequat. 1097s Duis aute irure 1097s dolor in reprehen- 1097s derit in voluptate 1097s velit esse cillum 1097s dolore eu fugiat 1097s nulla pariatur. 1097s Excepteur sint 1097s occaecat cupidatat 1097s non proident, sunt 1097s in culpa qui 1097s officia deserunt 1097s mollit anim id est 1097s laborum. 1097s - a 1097s - b 1097s - c 1097s - d 1097s - e 1097s - f 1097s - g 1097s - h 1097s - i 1097s - j 1097s > 1097s > # test_that("Messing with traceback", { 1097s > # warning("Missing traceback tests") 1097s > # # Main problem with this is that there may not be a good way to cause a trace 1097s > # # back to register while not also stopping execution of this file, so not 1097s > # # sure if this can be tested 1097s > # } ) 1097s > 1097s > # - "Compare Conditions" ------------------------------------------------------- 1097s > 1097s > lst1 <- new("conditionList", .items = list(simpleWarning("warning", 1097s + quote(yo + yo)), simpleWarning("warning2", quote(yo2 + yo)), 1097s + simpleWarning("warning3", quote(yo3 + yo)), simpleError("error1", 1097s + quote(make_an_error())))) 1097s > lst2 <- new("conditionList", .items = list(simpleWarning("warning", 1097s + quote(yo + yo)), simpleWarning("warning2", quote(yo2 + yo)), 1097s + simpleError("error1", quote(make_an_error())))) 1097s > 1097s > all.equal(lst1, lst1) 1097s [1] TRUE 1097s > # expect_equal("Condition count mismatch; expected 4 (got 3)", 1097s > # all.equal(lst1, lst2)) 1097s > all.equal(lst1, lst2)# 1097s [1] "Condition count mismatch; expected 4 (got 3)" 1097s > # expect_equal("There is one condition mismatch at index [[3]]", 1097s > # all.equal(lst2, lst1[1L:3L])) 1097s > all.equal(lst2, lst1[1L:3L]) 1097s [1] "There is one condition mismatch at index [[3]]" 1097s > # expect_equal("There are 2 condition mismatches, first one at index [[1]]", 1097s > # all.equal(lst2, lst1[2L:4L])) 1097s > all.equal(lst2, lst1[2L:4L]) 1097s [1] "There are 2 condition mismatches, first one at index [[1]]" 1097s > attr(lst1[[3L]], "unitizer.printed") <- TRUE 1097s > # expect_equal("There is one condition mismatch at index [[3]]", 1097s > # all.equal(lst2, lst1[1L:3L])) 1097s > all.equal(lst2, lst1[1L:3L]) 1097s [1] "There is one condition mismatch at index [[3]]" 1097s > # expect_equal(c("Condition type mismatch, `target` is 'Error', but `current` is 'Warning'", 1097s > # "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"), 1097s > # all.equal(lst2[[3]], lst1[[3]])) 1097s > all.equal(lst2[[3]], lst1[[3]]) 1097s [1] "Condition type mismatch, `target` is 'Error', but `current` is 'Warning'" 1097s [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" 1097s > 1097s > attr(lst1[[3L]], "unitizer.printed") <- NULL 1097s > lst1[[2L]] <- simpleWarning("warning2", quote(yo2 + yoyo)) 1097s > # This used to produce "one condition mismatch at index [[2]]", but with the 1097s > # relation of condition call comparison, no longer fails. Arguably this one 1097s > # should still fail as none of the parameters are named. 1097s > all.equal(lst2, lst1[c(1L:2L, 4L)]) 1097s [1] TRUE 1097s > 1097s > # single condition display with a more complex condition 1097s > large.cond <- simpleWarning(paste0(collapse = "\n", c("This is a complicated warning:", 1097s + as.character(unitizer:::UL(c("one warning", "two warning", 1097s + "three warning"))))), quote(make_a_warning())) 1097s > lst3 <- new("conditionList", .items = list(large.cond)) 1097s > show1 <- capture.output(show(lst3)) 1097s > all.equal(show1, rds("misc_cndlistshow1")) 1097s [1] TRUE 1097s > 1097s > attr(lst3[[1L]], "unitizer.printed") <- TRUE 1097s > lst3[[2L]] <- simpleWarning("warning2", quote(yo2 + yoyo)) 1097s > lst3 1097s Condition list with 2 conditions: 1097s 1. [print] Warning in make_a_warning() : This is a complicated warning: 1097s - one warning 1097s - two warning 1097s - three warning 1097s 2. Warning in yo2 + yoyo : warning2 1097s 1097s [print] means condition was issued by a print or show method for an auto-printed 1097s result. 1097s > 1097s > # empty condition 1097s > lst3[0] 1097s Empty condition list 1097s > 1097s > # Conditions with mismatched calls (due to instability in call generation for C 1097s > # errors issue285) 1097s > lst4a <- new("conditionList", 1097s + .items = list( 1097s + simpleWarning("A", quote(fun(a=b, c=d))), 1097s + simpleWarning("B", quote(fun(a=b, c=d))), 1097s + simpleWarning("C", quote(fun(a=b, c=d))), 1097s + simpleWarning("D", quote(fun(a, c=d))), 1097s + simpleWarning("E", quote(fun())), 1097s + simpleWarning("F"), 1097s + simpleWarning("G", quote(fun(a=b, c=d))), 1097s + simpleWarning("H", quote(fun(a=b, c=d))), 1097s + simpleWarning("I", quote(foo(a=b, c=d))) 1097s + )) 1097s > lst4b <- new("conditionList", 1097s + .items = list( 1097s + simpleWarning("A", quote(fun(a=b, c=d))), 1097s + simpleWarning("B", quote(fun(a=B, c=d))), 1097s + simpleWarning("C", quote(fun(b, c=d))), 1097s + simpleWarning("D", quote(fun(a=b, c=d))), 1097s + simpleWarning("E", quote(fun(a=b, c=d))), 1097s + simpleWarning("F", quote(fun(a=b, c=d))), 1097s + simpleWarning("G"), 1097s + simpleWarning("H", quote(fun())), 1097s + simpleWarning("I", quote(bar(a=b, c=d))) 1097s + )) 1097s > all.equal(lst4a, lst4b) 1097s [1] "There are 2 condition mismatches, first one at index [[2]]" 1097s > all.equal(lst4a[c(2, 9)], lst4b[c(2, 9)]) 1097s [1] "There are 2 condition mismatches, first one at index [[1]]" 1097s > 1097s > # - "Compare Functions With Traces" -------------------------------------------- 1097s > 1097s > fun.a <- base::library 1097s > identical(fun.a, base::library) 1097s [1] TRUE 1097s > trace(library, where = .BaseNamespaceEnv) 1097s Tracing function "library" in package "namespace:base" 1097s [1] "library" 1097s > identical(fun.a, base::library) # FALSE 1097s [1] FALSE 1097s > unitizer:::identical_fun(fun.a, base::library) 1097s [1] TRUE 1097s > unitizer:::identical_fun(base::library, fun.a) # FALSE 1097s [1] FALSE 1097s > untrace(library, where = .BaseNamespaceEnv) 1097s Untracing function "library" in package "namespace:base" 1097s > # expect_error(unitizer:::identical_fun(1, base::library)) 1097s > try(unitizer:::identical_fun(1, base::library)) 1097s Error in unitizer:::identical_fun(1, base::library) : 1097s Arguments `x` and `y` must both be functions. 1097s > # expect_error(unitizer:::identical_fun(base::library, 1)) 1097s > try(unitizer:::identical_fun(base::library, 1)) 1097s Error in unitizer:::identical_fun(base::library, 1) : 1097s Arguments `x` and `y` must both be functions. 1097s > unitizer:::identical_fun(base::print, base::print) 1097s [1] TRUE 1097s > # make sure all.equal dispatches properly out of namespace 1097s > 1097s > # expect_equal(evalq(all.equal(new("conditionList", .items = list(simpleWarning("warning", 1097s > # quote(yo + yo)), simpleWarning("warning2", quote(yo2 + yo)), 1097s > # simpleWarning("warning3", quote(yo3 + yo)), simpleError("error1", 1097s > # quote(make_an_error())))), new("conditionList", .items = list(simpleWarning("warning", 1097s > # quote(yo + yo)), simpleWarning("warning2", quote(yo2 + yo)), 1097s > # simpleError("error1", quote(make_an_error()))))), envir = getNamespace("stats")), 1097s > # "Condition count mismatch; expected 4 (got 3)") 1097s > evalq(all.equal(new("conditionList", .items = list(simpleWarning("warning", 1097s + quote(yo + yo)), simpleWarning("warning2", quote(yo2 + yo)), 1097s + simpleWarning("warning3", quote(yo3 + yo)), simpleError("error1", 1097s + quote(make_an_error())))), new("conditionList", .items = list(simpleWarning("warning", 1097s + quote(yo + yo)), simpleWarning("warning2", quote(yo2 + yo)), 1097s + simpleError("error1", quote(make_an_error()))))), envir = getNamespace("stats")) 1097s [1] "Condition count mismatch; expected 4 (got 3)" 1097s > 1097s > # - "word_cat" ----------------------------------------------------------------- 1097s > 1097s > 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" 1097s > # expect_equal(capture.output(unitizer:::word_cat(str, width = 20L)), 1097s > # c("Humpty dumpty sat on", "a wall and took a ", "big fall. All the ", 1097s > # "kings horses and men", "couldn't put humpty ", "dumpty together ", 1097s > # "again")) 1097s > unitizer:::word_cat(str, width = 20L) 1097s Humpty dumpty sat on 1097s a wall and took a 1097s big fall. All the 1097s kings horses and men 1097s couldn't put humpty 1097s dumpty together 1097s again 1097s > # expect_error(unitizer:::word_cat(stop("boom"), width = 20L, sep = " "), 1097s > # "boom") 1097s > try(unitizer:::word_cat(stop("boom"), width = 20L, sep = " ")) 1097s Error in word_wrap_split(..., width = width, tolerance = tolerance, sep = sep) : 1097s boom 1097s > str2 <- rep("goodbye goodbye") 1097s > str1 <- rep("hello hello hello", 2) 1097s > # expect_equal(c("hello hello ", "hello hello ", "hello hello ", 1097s > # "goodbye ", "goodbye"), capture.output()) 1097s > unitizer:::word_cat(str1, str2, width = 14L) 1097s hello hello 1097s hello hello 1097s hello hello 1097s goodbye 1097s goodbye 1097s > 1097s > # Make sure default works 1097s > old.width <- options(width = 20L) 1097s > # expect_equal(capture.output(unitizer:::word_cat(str)), c("Humpty dumpty sat on", 1097s > # "a wall and took a ", "big fall. All the ", "kings horses and men", 1097s > # "couldn't put humpty ", "dumpty together ", "again")) 1097s > unitizer:::word_cat(str) 1097s Humpty dumpty sat on 1097s a wall and took a 1097s big fall. All the 1097s kings horses and men 1097s couldn't put humpty 1097s dumpty together 1097s again 1097s > options(old.width) 1097s > 1097s > # - "relativize_path" ---------------------------------------------------------- 1097s > 1097s > base <- file.path(system.file(package = "unitizer"), "expkg") 1097s > wd <- file.path(base, "infer") 1097s > p1 <- file.path(wd, "R") 1097s > p2 <- file.path(base, "unitizerdummypkg1") 1097s > # expect_equal(unitizer:::relativize_path(p1, wd), "R") 1097s > unitizer:::relativize_path(p1, wd) 1097s [1] "R" 1097s > # expect_equal(unitizer:::relativize_path(p2, wd), "../unitizerdummypkg1") 1097s > unitizer:::relativize_path(p2, wd) 1097s [1] "../unitizerdummypkg1" 1097s > # expect_equal(unitizer:::relativize_path(c(p1, p2), wd), c("R", 1097s > # "../unitizerdummypkg1")) 1097s > unitizer:::relativize_path(c(p1, p2), wd) 1097s [1] "R" "../unitizerdummypkg1" 1097s > # expect_equal(unitizer:::relativize_path(c(p1, p2), wd), c("R", 1097s > # "../unitizerdummypkg1")) 1097s > unitizer:::relativize_path(c(p1, p2), wd) 1097s [1] "R" "../unitizerdummypkg1" 1097s > # expect_equal(unitizer:::relativize_path(c(p1, p2, file.path("notarealpath", 1097s > # "foo")), wd), c("R", "../unitizerdummypkg1", file.path("notarealpath", 1097s > # "foo"))) 1097s > unitizer:::relativize_path( 1097s + c(p1, p2, file.path("notarealpath", "foo")), wd 1097s + ) 1097s [1] "R" "../unitizerdummypkg1" "notarealpath/foo" 1097s > # expect_equal(unitizer:::relativize_path("/a/b/c/d/e/x.txt"), 1097s > # "/a/b/c/d/e/x.txt") 1097s > unitizer:::relativize_path("/a/b/c/d/e/x.txt", exists = TRUE) 1097s [1] "/a/b/c/d/e/x.txt" 1097s > # ## This was too difficult to get to behave consistently across windows and 1097s > # ## other platforms (see docs) 1097s > # wd <- sub("^[a-zA-Z]:", "", getwd()) 1097s > # all.equal( 1097s > # unitizer:::relativize_path( 1097s > # "/a/b/c/d/e/x.txt", only.if.shorter = FALSE, exists = TRUE 1097s > # ), 1097s > # do.call( 1097s > # file.path, 1097s > # c( 1097s > # as.list( 1097s > # rep( 1097s > # "..", 1097s > # length(unlist(strsplit(wd, .Platform$file.sep, fixed = TRUE))) - 1097s > # 1L 1097s > # ) ), 1097s > # list("a/b/c/d/e/x.txt") 1097s > # ) ) ) 1097s > 1097s > # - "path_clean" --------------------------------------------------------------- 1097s > 1097s > try(unitizer:::path_clean(list())) 1097s Error in unitizer:::path_clean(list()) : 1097s Argument `path` must be character 1097s > unitizer:::path_clean(file.path("a", "", "b", "c")) 1097s [1] "a/b/c" 1097s > 1097s > # - "unitizer:::merge_lists" --------------------------------------------------- 1097s > 1097s > unitizer:::merge_lists(list(a = 1, b = 2), list(c = 3)) 1097s $a 1097s [1] 1 1097s 1097s $b 1097s [1] 2 1097s 1097s $c 1097s [1] 3 1097s 1097s > unitizer:::merge_lists(list(a = 1, b = 2, c = 3), list(d = 5, c = 5)) 1097s $a 1097s [1] 1 1097s 1097s $b 1097s [1] 2 1097s 1097s $c 1097s [1] 5 1097s 1097s $d 1097s [1] 5 1097s 1097s > unitizer:::merge_lists(list(a = 1, b = 2, c = 3), list(a = NULL, d = 5, c = 5)) 1097s $a 1097s NULL 1097s 1097s $b 1097s [1] 2 1097s 1097s $c 1097s [1] 5 1097s 1097s $d 1097s [1] 5 1097s 1097s > 1097s > # - "filename to storeid" ------------------------------------------------------ 1097s > 1097s > filename_to_storeid("tests.R") 1097s [1] "tests.unitizer" 1097s > filename_to_storeid("tests.rock") 1097s Warning in filename_to_storeid("tests.rock") : 1097s 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`. 1097s NULL 1097s > 1097s > # - "pretty_path" -------------------------------------------------------------- 1097s > # not supposed to exist 1097s > res <- unitizer:::pretty_path("xadfasdfxcfasdfasd") # warn 1097s > 1097s > if(FALSE) { 1097s + # "fails CRAN" 1097s + # expect_identical(res, "xadfasdfxcfasdfasd") 1097s + res 1097s + unitizer:::pretty_path(normalizePath(".")) 1097s + unitizer:::pretty_path(file.path(system.file(package = "stats"), 1097s + "DESCRIPTION")) 1097s + } 1097s > # - "quit" --------------------------------------------------------------------- 1097s > 1097s > # for some reason cover tests run via travis can't handle the with_mock, 1097s > # so we just use truly-quit=FALSE; UPDATE (mabye du to compiler?) 1097s > # with_mock( 1097s > # quit=function(...) stop("quit!\n"), { 1097s > # unitizer:::read_line_set_vals("y") 1097s > # expect_error(capture.output(unitizer:::unitizer_quit()), "quit!") 1097s > # unitizer:::read_line_set_vals("n") 1097s > # capture.output(uq2 <- unitizer:::unitizer_quit()) 1097s > # expect_equal(uq2, NULL) 1097s > # unitizer:::read_line_set_vals(c("q", "q", "q", "q", "q", "q")) 1097s > # expect_error(capture.output(unitizer:::unitizer_quit()), "quit!") 1097s > # } 1097s > # ) 1097s > unitizer:::read_line_set_vals("y") 1097s > capture.output(q.res.1 <- unitizer:::unitizer_quit(truly.quit = FALSE)) 1097s | You are attempting to quit R from within `unitizer`. If you do so 1097s | you will lose any unsaved `unitizers`. Use `Q` to quit `unitizer` 1097s | gracefully. Are you sure you want to exit R? 1097s 1097s [1] "Quit R? [y/n]: y" 1097s > q.res.1 1097s [1] TRUE 1097s > unitizer:::read_line_set_vals("n") 1097s > capture.output(q.res.2 <- unitizer:::unitizer_quit(truly.quit = FALSE)) 1097s | You are attempting to quit R from within `unitizer`. If you do so 1097s | you will lose any unsaved `unitizers`. Use `Q` to quit `unitizer` 1097s | gracefully. Are you sure you want to exit R? 1097s 1097s [1] "Quit R? [y/n]: n" 1097s > q.res.2 # FALSE 1097s [1] FALSE 1097s > unitizer:::read_line_set_vals(c("q", "q", "q", "q", "q", "q")) 1097s > capture.output(q.res.3 <- unitizer:::unitizer_quit(truly.quit = FALSE)) 1097s | You are attempting to quit R from within `unitizer`. If you do so 1097s | you will lose any unsaved `unitizers`. Use `Q` to quit `unitizer` 1097s | gracefully. Are you sure you want to exit R? 1097s 1097s | Sorry, could not understand you, quitting then. 1097s 1097s [1] "Quit R? [y/n]: q" "Quit R? [y/n]: q" "Quit R? [y/n]: q" "Quit R? [y/n]: q" 1097s [5] "Quit R? [y/n]: q" "Quit R? [y/n]: q" 1097s > q.res.3 1097s [1] TRUE 1097s > unitizer:::read_line_set_vals(NULL) 1097s > 1097s > # - "mock_item" ---------------------------------------------------------------- 1097s > 1097s > is(mock_item(), "unitizerItem") 1097s [1] TRUE 1097s > 1097s > # - "diff conditionList" ------------------------------------------------------- 1097s > 1097s > cond1 <- new("conditionList", .items = list(simpleWarning("hello", 1097s + call = quote(fun())), simpleWarning("goodbye", call = quote(fun())))) 1097s > is(diffobj::diffObj(cond1, cond1), "Diff") 1097s [1] TRUE 1097s > 1097s > # - "Condition object structure" ----------------------------------------------- 1097s > 1097s > # We're assuming a particular structure for the condition object in 1097s > # `faux_prompt` and `unitizer_prompt` so we put in a test here to make sure it 1097s > # doesn't change 1097s > cond <- simpleError("hello") 1097s > is.list(cond) 1097s [1] TRUE 1097s > identical(names(cond), c("message", "call")) 1097s [1] TRUE 1097s > identical(class(cond), c("simpleError", "error", "condition")) 1097s [1] TRUE 1097s > 1097s > # - "options" ------------------------------------------------------------------ 1097s > 1097s > # not great tests... 1097s > 1097s > old.opts <- options() 1097s > new.opts <- unitizer:::options_zero() 1097s > 1097s > all(names(new.opts) %in% names(old.opts)) 1097s [1] TRUE 1097s > length(new.opts) <= length(old.opts) 1097s [1] TRUE 1097s > options(old.opts) 1097s > 1097s > 1097s PASS 1097s Begin testing t-nav.R 1097s 1097s R version 4.3.2 (2023-10-31) -- "Eye Holes" 1097s Copyright (C) 2023 The R Foundation for Statistical Computing 1097s Platform: x86_64-pc-linux-gnu (64-bit) 1097s 1097s R is free software and comes with ABSOLUTELY NO WARRANTY. 1097s You are welcome to redistribute it under certain conditions. 1097s Type 'license()' or 'licence()' for distribution details. 1097s 1097s R is a collaborative project with many contributors. 1097s Type 'contributors()' for more information and 1097s 'citation()' on how to cite R or R packages in publications. 1097s 1097s Type 'demo()' for some demos, 'help()' for on-line help, or 1097s 'help.start()' for an HTML browser interface to help. 1097s Type 'q()' to quit R. 1097s 1097s > source(file.path("_helper", "init.R")) 1098s > nav <- file.path("_helper", "unitizers", "nav.R") 1098s > 1098s > # Simple navigation tests that don't require complex unitizers 1098s > 1098s > # - "Re-run bookmark" -----=---------------------------------------------------- 1098s > 1098s > # Relates to #278. Tests both Review and Browse 1098s > 1098s > unitizer:::read_line_set_vals( 1098s + c("R", "Y", "B", "7", "R", "Y", "B", "9", "R", "Y", "Q") 1098s + ) 1098s > unitize(nav, interactive.mode=TRUE) 1098s 1098s +------------------------------------------------------------------------------+ 1098s | unitizer for: nav.R | 1098s +------------------------------------------------------------------------------+ 1098s 1098s Pass Fail New 1098s A - - 2 1098s B - - 2 1098s .................. 1098s - - 4 1098s 1098s = A ============================================================================ 1098s 1098s - New -------------------------------------------------------------------------- 1098s 1098s | The 2 tests in this section are new. Add tests to store ([Y]es, [N]o, [P]rev, 1098s | [B]rowse, [R]erun, [Q]uit, [H]elp)? 1098s 1098s > a <- 42 1098s > a + 1 1098s [1] 43 1098s 1098s unitizer> R 1098s 1098s | Toggling re-run mode ON for this unitizer 1098s 1099s = Finalize Unitizer ============================================================ 1099s 1099s | You have 4 unreviewed tests; press `B` to browse tests, `U` to go to first 1099s | unreviewed test. 1099s 1099s | You made no changes to the unitizer so there is no need to update it. While 1099s | unnecessary, you can force an update by typing O at the prompt. 1099s 1099s | Re-run unitizer ([Y]es, [P]rev, [B]rowse, [U]nreviewed, [R]erun, f[O]rce)? 1099s 1099s unitizer> Y 1099s 1099s | unitizer unchanged. 1099s 1099s +------------------------------------------------------------------------------+ 1099s | unitizer for: nav.R | 1099s +------------------------------------------------------------------------------+ 1099s 1099s Pass Fail New 1099s A - - 2 1099s B - - 2 1099s .................. 1099s - - 4 1099s 1099s = A ============================================================================ 1099s 1099s - New -------------------------------------------------------------------------- 1099s 1099s | The 2 tests in this section are new. Add tests to store ([Y]es, [N]o, [P]rev, 1099s | [B]rowse, [R]erun, [Q]uit, [H]elp)? 1099s 1099s | Jumping to test #3 because that was the test under review when test re-run was 1099s | requested. 1099s 1099s > a <- 42 1099s > a + 1 1099s [1] 43 1099s 1099s unitizer> B 1099s 1099s = ============== 1099s *1. z <- 24 . . -:- 1099s = A ======================= 1099s *2. a <- 42 . . -:- 1099s 3. a + 1 . . . New:- 1099s 4. a + 2 . . . New:- 1099s = B ======================= 1099s *5. b <- 25 . . -:- 1099s *6. bb <- 26 . . -:- 1099s 7. b + 1 . . . New:- 1099s *8. bbb <- 27 . . -:- 1099s 9. b + 2 . . . New:- 1099s 1099s | What test do you wish to review (input a test number, [U]nreviewed)? 1099s 1099s unitizer> 7 1099s = B ============================================================================ 1099s 1099s - New -------------------------------------------------------------------------- 1099s 1099s | The 2 tests in this section are new. Add tests to store ([Y]es, [N]o, [P]rev, 1099s | [B]rowse, [R]erun, [Q]uit, [H]elp)? 1099s 1099s > b <- 25 1099s > bb <- 26 1099s > b + 1 1099s [1] 26 1099s 1099s unitizer> R 1099s 1099s | Toggling re-run mode ON for this unitizer 1099s 1099s = Finalize Unitizer ============================================================ 1099s 1099s | You have 4 unreviewed tests; press `B` to browse tests, `U` to go to first 1099s | unreviewed test. 1099s 1099s | You made no changes to the unitizer so there is no need to update it. While 1099s | unnecessary, you can force an update by typing O at the prompt. 1099s 1099s | Re-run unitizer ([Y]es, [P]rev, [B]rowse, [U]nreviewed, [R]erun, f[O]rce)? 1099s 1099s unitizer> Y 1099s 1099s | unitizer unchanged. 1099s 1099s +------------------------------------------------------------------------------+ 1099s | unitizer for: nav.R | 1099s +------------------------------------------------------------------------------+ 1099s 1099s Pass Fail New 1099s A - - 2 1099s B - - 2 1099s .................. 1099s - - 4 1099s 1099s = B ============================================================================ 1099s 1099s - New -------------------------------------------------------------------------- 1099s 1099s | The 2 tests in this section are new. Add tests to store ([Y]es, [N]o, [P]rev, 1099s | [B]rowse, [R]erun, [Q]uit, [H]elp)? 1099s 1099s | Jumping to test #7 because that was the test under review when test re-run was 1099s | requested. 1099s 1099s > b <- 25 1099s > bb <- 26 1099s > b + 1 1099s [1] 26 1099s 1099s unitizer> B 1099s 1099s = ============== 1099s *1. z <- 24 . . -:- 1099s = A ======================= 1099s *2. a <- 42 . . -:- 1099s 3. a + 1 . . . New:- 1099s 4. a + 2 . . . New:- 1099s = B ======================= 1099s *5. b <- 25 . . -:- 1099s *6. bb <- 26 . . -:- 1099s 7. b + 1 . . . New:- 1099s *8. bbb <- 27 . . -:- 1099s 9. b + 2 . . . New:- 1099s 1099s | What test do you wish to review (input a test number, [U]nreviewed)? 1099s 1099s unitizer> 9 1099s = B ============================================================================ 1099s 1099s - New -------------------------------------------------------------------------- 1099s 1099s | The 2 tests in this section are new. Add tests to store ([Y]es, [N]o, [P]rev, 1099s | [B]rowse, [R]erun, [Q]uit, [H]elp)? 1099s 1099s > bbb <- 27 1099s > b + 2 1099s [1] 27 1099s 1099s unitizer> R 1099s 1099s | Toggling re-run mode ON for this unitizer 1099s 1100s = Finalize Unitizer ============================================================ 1100s 1100s | You have 4 unreviewed tests; press `B` to browse tests, `U` to go to first 1100s | unreviewed test. 1100s 1100s | You made no changes to the unitizer so there is no need to update it. While 1100s | unnecessary, you can force an update by typing O at the prompt. 1100s 1100s | Re-run unitizer ([Y]es, [P]rev, [B]rowse, [U]nreviewed, [R]erun, f[O]rce)? 1100s 1100s unitizer> Y 1100s 1100s | unitizer unchanged. 1100s 1100s +------------------------------------------------------------------------------+ 1100s | unitizer for: nav.R | 1100s +------------------------------------------------------------------------------+ 1100s 1100s Pass Fail New 1100s A - - 2 1100s B - - 2 1100s .................. 1100s - - 4 1100s 1100s = B ============================================================================ 1100s 1100s - New -------------------------------------------------------------------------- 1100s 1100s | The 2 tests in this section are new. Add tests to store ([Y]es, [N]o, [P]rev, 1100s | [B]rowse, [R]erun, [Q]uit, [H]elp)? 1100s 1100s | Jumping to test #9 because that was the test under review when test re-run was 1100s | requested. 1100s 1100s > bbb <- 27 1100s > b + 2 1100s [1] 27 1100s 1100s unitizer> Q 1100s 1100s | No changes recorded. 1100s | unitizer unchanged. 1100s 1100s > 1100s > 1100s PASS 1100s Begin testing t-parse.R 1100s 1100s R version 4.3.2 (2023-10-31) -- "Eye Holes" 1100s Copyright (C) 2023 The R Foundation for Statistical Computing 1100s Platform: x86_64-pc-linux-gnu (64-bit) 1100s 1100s R is free software and comes with ABSOLUTELY NO WARRANTY. 1100s You are welcome to redistribute it under certain conditions. 1100s Type 'license()' or 'licence()' for distribution details. 1100s 1100s R is a collaborative project with many contributors. 1100s Type 'contributors()' for more information and 1100s 'citation()' on how to cite R or R packages in publications. 1100s 1100s Type 'demo()' for some demos, 'help()' for on-line help, or 1100s 'help.start()' for an HTML browser interface to help. 1100s Type 'q()' to quit R. 1100s 1100s > source(file.path("_helper", "init.R")) 1100s > source(file.path("aammrtf", "ref.R")); make_ref_obj_funs("refobjs") 1100s > 1100s > 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 " 1100s > all <- unitizer:::parse_dat_get(text = txt) 1100s > prs <- all$expr 1100s > dat <- all$dat 1100s > dat$parent <- pmax(0L, dat$parent) 1100s > # With R4.0 some of the ids started changing 1100s > normalize_id <- function(dat) { 1100s + idu <- sort(unique(dat[["id"]])) 1100s + id <- with(dat, match(id, idu)) 1100s + parent <- with(dat, ifelse(parent == 0L, 0L, match(parent, 1100s + idu))) 1100s + dat[["id"]] <- id 1100s + dat[["parent"]] <- parent 1100s + dat 1100s + } 1100s > dat <- normalize_id(dat) 1100s > dat.split <- dat.split.2 <- par.ids.3 <- NULL 1100s > if.text <- "if # IFFY\n(x > 3 # ifcond\n){ hello\n #whome to attach?\n} else #final\ngoodbye" 1100s > 1100s > # - "Top Level Parents Identified Correctly" ----------------------------------- 1100s > 1100s > # "Identified top level parents?" 1100s > par.ids <- with(dat, unitizer:::top_level_parse_parents(id, parent)) 1100s > par.ids 1100s [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 1100s [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 1100s [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 1100s [76] 0 0 83 83 83 83 83 83 0 90 90 90 90 90 90 0 1100s > dat.split <- split(dat, par.ids) 1100s > 1100s > # "Identified sub-level top level parents correctly" 1100s > par.ids.2 <- with(dat.split$`64`, unitizer:::top_level_parse_parents(id, 1100s + parent, 64L)) 1100s > par.ids.2 1100s [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 1100s [26] 62 62 62 62 62 62 62 62 62 62 62 62 64 1100s > dat.split.2 <- split(dat.split$`64`, par.ids.2) 1100s > 1100s > # "Parent relationships in `unitizer_sect` piece." 1100s > 1100s > par.ids.3 <- with(dat.split.2$`62`, unitizer:::top_level_parse_parents(id, 1100s + parent, 62L)) 1100s > par.ids.3 1100s [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 1100s [26] 59 59 59 62 62 1100s > 1100s > # - "Comments Are Assigned" ---------------------------------------------------- 1100s > 1100s > # "Did we assign comments correctly to topmost level?" 1100s > lapply(unitizer:::comments_assign(prs, dat.split$`0`), attr, "comment") 1100s [[1]] 1100s [1] "# This is an early comment" 1100s 1100s [[2]] 1100s [1] "# multi" "# line" "# comment" "# and another!" 1100s 1100s [[3]] 1100s NULL 1100s 1100s [[4]] 1100s NULL 1100s 1100s [[5]] 1100s [1] "# and this comment belongs to whom?" 1100s 1100s [[6]] 1100s [1] "# and I?" 1100s 1100s > 1100s > # "No comments here so no changes should occur" 1100s > all.equal(unitizer:::comments_assign(prs[[3]], dat.split.2$`64`), prs[[3]]) 1100s [1] TRUE 1100s > 1100s > # "Comments in `unitizer_sect` body assigned correctly" 1100s > lapply(unitizer:::comments_assign(prs[[3]][[3]], split(dat.split.2$`62`, 1100s + par.ids.3)$`62`), attr, "comment") 1100s [[1]] 1100s NULL 1100s 1100s [[2]] 1100s [1] "# test that were not crazy" "# TRUE hopefully" 1100s 1100s [[3]] 1100s [1] "# Still not crazy" 1100s 1100s > 1100s > # - "Ancestry Descend" --------------------------------------------------------- 1100s > 1100s > x <- unitizer:::parse_dat_get(text = "1 + 1; fun(x, fun(y + z))")$dat 1100s > x <- normalize_id(x) 1100s > 1100s > unitizer:::ancestry_descend(x$id, x$parent, 0) 1100s children level 1100s [1,] 7 0 1100s [2,] 6 0 1100s [3,] 26 0 1100s [4,] 2 1 1100s [5,] 3 1 1100s [6,] 5 1 1100s [7,] 10 1 1100s [8,] 9 1 1100s [9,] 13 1 1100s [10,] 12 1 1100s [11,] 24 1 1100s [12,] 25 1 1100s [13,] 1 2 1100s [14,] 4 2 1100s [15,] 8 2 1100s [16,] 11 2 1100s [17,] 16 2 1100s [18,] 15 2 1100s [19,] 23 2 1100s [20,] 21 2 1100s [21,] 14 3 1100s [22,] 19 3 1100s [23,] 18 3 1100s [24,] 22 3 1100s [25,] 17 4 1100s [26,] 20 4 1100s > 1100s > # - "Clean up Parse Data" ------------------------------------------------------ 1100s > 1100s > dat <- unitizer:::parse_dat_get(text = "{function(x) NULL;; #comment\n}")$dat 1100s > # set negative ids to be top level parents 1100s > dat <- transform(dat, parent = ifelse(parent < 0, 0L, parent)) 1100s > dat <- normalize_id(dat) 1100s > 1100s > # "Ancestry Descend" 1100s > dat.anc <- unitizer:::ancestry_descend(dat$id, dat$parent, 0L) 1100s > dat.anc 1100s children level 1100s [1,] 15 0 1100s [2,] 1 1 1100s [3,] 13 1 1100s [4,] 12 1 1100s [5,] 14 1 1100s [6,] 11 2 1100s [7,] 10 2 1100s [8,] 9 3 1100s [9,] 8 3 1100s [10,] 2 4 1100s [11,] 3 4 1100s [12,] 4 4 1100s [13,] 5 4 1100s [14,] 7 4 1100s [15,] 6 5 1100s > 1100s > # "Excise `exprlist`" 1100s > unitizer:::prsdat_fix_exprlist(dat, dat.anc)$token 1100s [1] "expr" "'{'" "expr" "FUNCTION" 1100s [5] "'('" "SYMBOL_FORMALS" "')'" "NULL_CONST" 1100s [9] "expr" "COMMENT" "'}'" 1100s > 1100s > dat.1 <- unitizer:::parse_dat_get(text = "{1 ; ; ;2;}")$dat 1100s > # set negative ids to be top level parents 1100s > dat.1 <- transform(dat.1, parent = ifelse(parent < 0, 0L, parent)) 1100s > dat.1 <- normalize_id(dat.1) 1100s > 1100s > # "Another `exprlist` test" 1100s > unname( 1100s + as.list( 1100s + unitizer:::prsdat_fix_exprlist( 1100s + dat.1, 1100s + unitizer:::ancestry_descend(dat.1$id, dat.1$parent, 0L) 1100s + )[c("parent", "token")] 1100s + ) ) 1100s [[1]] 1100s [1] 0 14 3 14 10 14 14 1100s 1100s [[2]] 1100s [1] "expr" "'{'" "NUM_CONST" "expr" "NUM_CONST" "expr" 1100s [7] "'}'" 1100s 1100s > dat.2 <- unitizer:::parse_dat_get(text = "{NULL; yowza; #comment\nhello\n}")$dat 1100s > # set negative ids to be top level parents 1100s > dat.2 <- transform(dat.2, parent = ifelse(parent < 0, 0L, parent)) 1100s > dat.2 <- normalize_id(dat.2) 1100s > 1100s > # "Yet another `exprlist`" 1100s > unname( 1100s + as.list( 1100s + unitizer:::prsdat_fix_exprlist( 1100s + dat.2, unitizer:::ancestry_descend(dat.2$id, dat.2$parent, 0L) 1100s + )[c("parent", "token")] 1100s + ) ) 1100s [[1]] 1100s [1] 0 13 3 13 7 13 13 11 13 13 1100s 1100s [[2]] 1100s [1] "expr" "'{'" "NULL_CONST" "expr" "SYMBOL" 1100s [6] "expr" "COMMENT" "SYMBOL" "expr" "'}'" 1100s 1100s > 1100s > dat.2a <- normalize_id( 1100s + unitizer:::parse_dat_get(text = "for(i in x) {if(x) break else next}")$dat 1100s + ) 1100s > # "`for` cleanup" 1100s > 1100s > as.list(unitizer:::prsdat_fix_for(dat.2a[-1L, ])) 1100s $line1 1100s [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1100s 1100s $col1 1100s [1] 1 5 10 10 13 13 14 14 16 17 17 18 20 20 26 31 31 35 1100s 1100s $line2 1100s [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1100s 1100s $col2 1100s [1] 3 5 10 10 35 13 34 15 16 17 17 18 24 24 29 34 34 35 1100s 1100s $id 1100s [1] 1 3 5 7 22 9 21 10 11 12 14 13 15 16 17 18 19 20 1100s 1100s $parent 1100s [1] 23 23 7 23 23 22 22 21 21 14 21 21 16 21 21 19 21 22 1100s 1100s $token 1100s [1] "FOR" "SYMBOL" "SYMBOL" "expr" "expr" "'{'" "expr" "IF" 1100s [9] "'('" "SYMBOL" "expr" "')'" "BREAK" "expr" "ELSE" "NEXT" 1100s [17] "expr" "'}'" 1100s 1100s $terminal 1100s [1] TRUE TRUE TRUE FALSE FALSE TRUE FALSE TRUE TRUE TRUE FALSE TRUE 1100s [13] TRUE FALSE TRUE TRUE FALSE TRUE 1100s 1100s $text 1100s [1] "for" "i" "x" "" "" "{" "" "if" "(" 1100s [10] "x" "" ")" "break" "" "else" "next" "" "}" 1100s 1100s > 1100s > dat.3 <- normalize_id(unitizer:::parse_dat_get(text = if.text)$dat) 1100s > 1100s > # "`if` cleanup" 1100s > 1100s > unname(as.list(unitizer:::prsdat_fix_if(dat.3[-1, ])[c("id", "token")])) 1100s [[1]] 1100s [1] 1 2 11 4 6 5 7 8 9 17 12 13 14 15 16 19 20 21 1100s 1100s [[2]] 1100s [1] "IF" "COMMENT" "expr" "SYMBOL" "expr" "GT" 1100s [7] "NUM_CONST" "expr" "COMMENT" "expr" "'{'" "SYMBOL" 1100s [13] "expr" "COMMENT" "'}'" "COMMENT" "SYMBOL" "expr" 1100s 1100s > 1100s > # - "Full Parse Works Properly" ------------------------------------------------ 1100s > 1100s > # "Full Comment Parse" 1100s > unitizer:::comm_extract(unitizer:::parse_with_comments(text = txt)) 1100s [[1]] 1100s NULL 1100s 1100s [[2]] 1100s [[2]][[1]] 1100s [1] "# This is an early comment" 1100s 1100s [[2]][[2]] 1100s [[2]][[2]][[1]] 1100s NULL 1100s 1100s 1100s [[2]][[3]] 1100s [[2]][[3]][[1]] 1100s NULL 1100s 1100s 1100s [[2]][[4]] 1100s [[2]][[4]][[1]] 1100s NULL 1100s 1100s 1100s 1100s [[3]] 1100s [[3]][[1]] 1100s [1] "# multi" "# line" "# comment" "# and another!" 1100s 1100s [[3]][[2]] 1100s [[3]][[2]][[1]] 1100s NULL 1100s 1100s 1100s [[3]][[3]] 1100s [[3]][[3]][[1]] 1100s NULL 1100s 1100s [[3]][[3]][[2]] 1100s [[3]][[3]][[2]][[1]] 1100s NULL 1100s 1100s 1100s [[3]][[3]][[3]] 1100s [[3]][[3]][[3]][[1]] 1100s NULL 1100s 1100s 1100s [[3]][[3]][[4]] 1100s [[3]][[3]][[4]][[1]] 1100s NULL 1100s 1100s 1100s 1100s [[3]][[4]] 1100s [[3]][[4]][[1]] 1100s NULL 1100s 1100s 1100s 1100s [[4]] 1100s [[4]][[1]] 1100s NULL 1100s 1100s [[4]][[2]] 1100s [[4]][[2]][[1]] 1100s NULL 1100s 1100s 1100s [[4]][[3]] 1100s [[4]][[3]][[1]] 1100s NULL 1100s 1100s 1100s [[4]][[4]] 1100s [[4]][[4]][[1]] 1100s NULL 1100s 1100s [[4]][[4]][[2]] 1100s [[4]][[4]][[2]][[1]] 1100s NULL 1100s 1100s 1100s [[4]][[4]][[3]] 1100s [[4]][[4]][[3]][[1]] 1100s [1] "# test that were not crazy" "# TRUE hopefully" 1100s 1100s [[4]][[4]][[3]][[2]] 1100s [[4]][[4]][[3]][[2]][[1]] 1100s NULL 1100s 1100s 1100s [[4]][[4]][[3]][[3]] 1100s [[4]][[4]][[3]][[3]][[1]] 1100s NULL 1100s 1100s [[4]][[4]][[3]][[3]][[2]] 1100s [[4]][[4]][[3]][[3]][[2]][[1]] 1100s NULL 1100s 1100s 1100s [[4]][[4]][[3]][[3]][[3]] 1100s [[4]][[4]][[3]][[3]][[3]][[1]] 1100s NULL 1100s 1100s 1100s [[4]][[4]][[3]][[3]][[4]] 1100s [[4]][[4]][[3]][[3]][[4]][[1]] 1100s NULL 1100s 1100s 1100s 1100s [[4]][[4]][[3]][[4]] 1100s [[4]][[4]][[3]][[4]][[1]] 1100s NULL 1100s 1100s 1100s 1100s [[4]][[4]][[4]] 1100s [[4]][[4]][[4]][[1]] 1100s [1] "# Still not crazy" 1100s 1100s [[4]][[4]][[4]][[2]] 1100s [[4]][[4]][[4]][[2]][[1]] 1100s NULL 1100s 1100s 1100s [[4]][[4]][[4]][[3]] 1100s [[4]][[4]][[4]][[3]][[1]] 1100s NULL 1100s 1100s [[4]][[4]][[4]][[3]][[2]] 1100s [[4]][[4]][[4]][[3]][[2]][[1]] 1100s NULL 1100s 1100s 1100s [[4]][[4]][[4]][[3]][[3]] 1100s [[4]][[4]][[4]][[3]][[3]][[1]] 1100s NULL 1100s 1100s 1100s [[4]][[4]][[4]][[3]][[4]] 1100s [[4]][[4]][[4]][[3]][[4]][[1]] 1100s NULL 1100s 1100s 1100s 1100s [[4]][[4]][[4]][[4]] 1100s [[4]][[4]][[4]][[4]][[1]] 1100s NULL 1100s 1100s [[4]][[4]][[4]][[4]][[2]] 1100s [[4]][[4]][[4]][[4]][[2]][[1]] 1100s NULL 1100s 1100s 1100s [[4]][[4]][[4]][[4]][[3]] 1100s [[4]][[4]][[4]][[4]][[3]][[1]] 1100s NULL 1100s 1100s 1100s [[4]][[4]][[4]][[4]][[4]] 1100s [[4]][[4]][[4]][[4]][[4]][[1]] 1100s NULL 1100s 1100s 1100s 1100s 1100s 1100s 1100s [[5]] 1100s [[5]][[1]] 1100s NULL 1100s 1100s [[5]][[2]] 1100s [[5]][[2]][[1]] 1100s NULL 1100s 1100s 1100s [[5]][[3]] 1100s [[5]][[3]][[1]] 1100s NULL 1100s 1100s [[5]][[3]][[2]] 1100s [[5]][[3]][[2]][[1]] 1100s NULL 1100s 1100s 1100s [[5]][[3]][[3]] 1100s [[5]][[3]][[3]][[1]] 1100s NULL 1100s 1100s 1100s [[5]][[3]][[4]] 1100s [[5]][[3]][[4]][[1]] 1100s NULL 1100s 1100s 1100s 1100s 1100s [[6]] 1100s [[6]][[1]] 1100s [1] "# and this comment belongs to whom?" 1100s 1100s [[6]][[2]] 1100s [[6]][[2]][[1]] 1100s NULL 1100s 1100s 1100s [[6]][[3]] 1100s [[6]][[3]][[1]] 1100s NULL 1100s 1100s 1100s 1100s [[7]] 1100s [[7]][[1]] 1100s [1] "# and I?" 1100s 1100s [[7]][[2]] 1100s [[7]][[2]][[1]] 1100s NULL 1100s 1100s 1100s [[7]][[3]] 1100s [[7]][[3]][[1]] 1100s NULL 1100s 1100s 1100s 1100s > 1100s > # "EQ_SUB and SYMBOL_SUB test" 1100s > unitizer:::comm_extract( 1100s + unitizer:::parse_with_comments( 1100s + text = "structure(1:3, # the data\nclass # the label\n=#the equal sign\n'hello' # the class\n)" 1100s + ) ) 1100s [[1]] 1100s NULL 1100s 1100s [[2]] 1100s [[2]][[1]] 1100s NULL 1100s 1100s [[2]][[2]] 1100s [[2]][[2]][[1]] 1100s NULL 1100s 1100s 1100s [[2]][[3]] 1100s [[2]][[3]][[1]] 1100s [1] "# the data" 1100s 1100s [[2]][[3]][[2]] 1100s [[2]][[3]][[2]][[1]] 1100s NULL 1100s 1100s 1100s [[2]][[3]][[3]] 1100s [[2]][[3]][[3]][[1]] 1100s NULL 1100s 1100s 1100s [[2]][[3]][[4]] 1100s [[2]][[3]][[4]][[1]] 1100s NULL 1100s 1100s 1100s 1100s [[2]]$class 1100s [[2]]$class[[1]] 1100s [1] "# the label" "#the equal sign" "# the class" 1100s 1100s 1100s 1100s > 1100s > # "Function with `exprlist`" 1100s > 1100s > unitizer:::comm_extract( 1100s + unitizer:::parse_with_comments( 1100s + 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;}" 1100s + ) ) 1100s [[1]] 1100s NULL 1100s 1100s [[2]] 1100s [[2]][[1]] 1100s NULL 1100s 1100s [[2]][[2]] 1100s [[2]][[2]][[1]] 1100s [1] "#first arg" 1100s 1100s 1100s [[2]][[3]] 1100s [[2]][[3]][[1]] 1100s NULL 1100s 1100s [[2]][[3]]$x 1100s [[2]][[3]]$x[[1]] 1100s NULL 1100s 1100s 1100s [[2]][[3]]$y 1100s [[2]][[3]]$y[[1]] 1100s NULL 1100s 1100s 1100s 1100s [[2]][[4]] 1100s [[2]][[4]][[1]] 1100s [1] "#second arg with default" 1100s 1100s [[2]][[4]][[2]] 1100s [[2]][[4]][[2]][[1]] 1100s NULL 1100s 1100s 1100s [[2]][[4]][[3]] 1100s [[2]][[4]][[3]][[1]] 1100s [1] "# first comment" 1100s 1100s [[2]][[4]][[3]][[2]] 1100s [[2]][[4]][[3]][[2]][[1]] 1100s NULL 1100s 1100s 1100s [[2]][[4]][[3]][[3]] 1100s [[2]][[4]][[3]][[3]][[1]] 1100s NULL 1100s 1100s 1100s [[2]][[4]][[3]][[4]] 1100s [[2]][[4]][[3]][[4]][[1]] 1100s NULL 1100s 1100s 1100s 1100s [[2]][[4]][[4]] 1100s [[2]][[4]][[4]][[1]] 1100s [1] "#second comment" 1100s 1100s 1100s [[2]][[4]][[5]] 1100s [[2]][[4]][[5]][[1]] 1100s [1] "#lastcomment " 1100s 1100s [[2]][[4]][[5]][[2]] 1100s [[2]][[4]][[5]][[2]][[1]] 1100s NULL 1100s 1100s 1100s [[2]][[4]][[5]][[3]] 1100s [[2]][[4]][[5]][[3]][[1]] 1100s NULL 1100s 1100s 1100s [[2]][[4]][[5]][[4]] 1100s [[2]][[4]][[5]][[4]][[1]] 1100s NULL 1100s 1100s 1100s 1100s 1100s [[2]][[5]] 1100s [[2]][[5]][[1]] 1100s NULL 1100s 1100s [[2]][[5]][[2]] 1100s [[2]][[5]][[2]][[1]] 1100s NULL 1100s 1100s 1100s [[2]][[5]][[3]] 1100s [[2]][[5]][[3]][[1]] 1100s NULL 1100s 1100s 1100s [[2]][[5]][[4]] 1100s [[2]][[5]][[4]][[1]] 1100s NULL 1100s 1100s 1100s [[2]][[5]][[5]] 1100s [[2]][[5]][[5]][[1]] 1100s NULL 1100s 1100s 1100s [[2]][[5]][[6]] 1100s [[2]][[5]][[6]][[1]] 1100s NULL 1100s 1100s 1100s [[2]][[5]][[7]] 1100s [[2]][[5]][[7]][[1]] 1100s NULL 1100s 1100s 1100s [[2]][[5]][[8]] 1100s [[2]][[5]][[8]][[1]] 1100s NULL 1100s 1100s 1100s [[2]][[5]][[9]] 1100s [[2]][[5]][[9]][[1]] 1100s NULL 1100s 1100s 1100s 1100s 1100s > 1100s > # "`for` loop" 1100s > unitizer:::comm_extract( 1100s + unitizer:::parse_with_comments( 1100s + 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;}" 1100s + ) ) 1100s [[1]] 1100s NULL 1100s 1100s [[2]] 1100s [[2]][[1]] 1100s NULL 1100s 1100s [[2]][[2]] 1100s [[2]][[2]][[1]] 1100s NULL 1100s 1100s 1100s [[2]][[3]] 1100s [[2]][[3]][[1]] 1100s [1] "#in counter" 1100s 1100s 1100s [[2]][[4]] 1100s [[2]][[4]][[1]] 1100s [1] "#incounter again" 1100s 1100s [[2]][[4]][[2]] 1100s [[2]][[4]][[2]][[1]] 1100s NULL 1100s 1100s 1100s [[2]][[4]][[3]] 1100s [[2]][[4]][[3]][[1]] 1100s NULL 1100s 1100s 1100s [[2]][[4]][[4]] 1100s [[2]][[4]][[4]][[1]] 1100s NULL 1100s 1100s 1100s 1100s [[2]][[5]] 1100s [[2]][[5]][[1]] 1100s NULL 1100s 1100s [[2]][[5]][[2]] 1100s [[2]][[5]][[2]][[1]] 1100s NULL 1100s 1100s 1100s [[2]][[5]][[3]] 1100s [[2]][[5]][[3]][[1]] 1100s [1] "# first comment" 1100s 1100s [[2]][[5]][[3]][[2]] 1100s [[2]][[5]][[3]][[2]][[1]] 1100s NULL 1100s 1100s 1100s [[2]][[5]][[3]][[3]] 1100s [[2]][[5]][[3]][[3]][[1]] 1100s NULL 1100s 1100s 1100s [[2]][[5]][[3]][[4]] 1100s [[2]][[5]][[3]][[4]][[1]] 1100s NULL 1100s 1100s 1100s 1100s [[2]][[5]][[4]] 1100s [[2]][[5]][[4]][[1]] 1100s NULL 1100s 1100s 1100s [[2]][[5]][[5]] 1100s [[2]][[5]][[5]][[1]] 1100s [1] "#second comment" 1100s 1100s 1100s [[2]][[5]][[6]] 1100s [[2]][[5]][[6]][[1]] 1100s NULL 1100s 1100s [[2]][[5]][[6]][[2]] 1100s [[2]][[5]][[6]][[2]][[1]] 1100s NULL 1100s 1100s 1100s [[2]][[5]][[6]][[3]] 1100s [[2]][[5]][[6]][[3]][[1]] 1100s NULL 1100s 1100s 1100s [[2]][[5]][[6]][[4]] 1100s [[2]][[5]][[6]][[4]][[1]] 1100s NULL 1100s 1100s 1100s 1100s [[2]][[5]][[7]] 1100s [[2]][[5]][[7]][[1]] 1100s [1] "#lastcomment " 1100s 1100s 1100s 1100s 1100s > 1100s > # "`if` statement" 1100s > unitizer:::comm_extract(unitizer:::parse_with_comments(text = if.text)) 1100s [[1]] 1100s NULL 1100s 1100s [[2]] 1100s [[2]][[1]] 1100s NULL 1100s 1100s [[2]][[2]] 1100s [[2]][[2]][[1]] 1100s [1] "# IFFY" 1100s 1100s 1100s [[2]][[3]] 1100s [[2]][[3]][[1]] 1100s [1] "# ifcond" 1100s 1100s [[2]][[3]][[2]] 1100s [[2]][[3]][[2]][[1]] 1100s NULL 1100s 1100s 1100s [[2]][[3]][[3]] 1100s [[2]][[3]][[3]][[1]] 1100s NULL 1100s 1100s 1100s [[2]][[3]][[4]] 1100s [[2]][[3]][[4]][[1]] 1100s NULL 1100s 1100s 1100s 1100s [[2]][[4]] 1100s [[2]][[4]][[1]] 1100s NULL 1100s 1100s [[2]][[4]][[2]] 1100s [[2]][[4]][[2]][[1]] 1100s NULL 1100s 1100s 1100s [[2]][[4]][[3]] 1100s [[2]][[4]][[3]][[1]] 1100s NULL 1100s 1100s 1100s 1100s [[2]][[5]] 1100s [[2]][[5]][[1]] 1100s [1] "#final" 1100s 1100s 1100s 1100s > 1100s > # "formula" 1100s > unitizer:::comm_extract( 1100s + unitizer:::parse_with_comments( 1100s + text = ". + x # hello\n#yowza\n~#bust a move\ny" 1100s + ) ) 1100s [[1]] 1100s NULL 1100s 1100s [[2]] 1100s [[2]][[1]] 1100s [1] "# hello" 1100s 1100s [[2]][[2]] 1100s [[2]][[2]][[1]] 1100s NULL 1100s 1100s 1100s [[2]][[3]] 1100s [[2]][[3]][[1]] 1100s NULL 1100s 1100s 1100s [[2]][[4]] 1100s [[2]][[4]][[1]] 1100s NULL 1100s 1100s 1100s 1100s [[3]] 1100s [[3]][[1]] 1100s [1] "#yowza" 1100s 1100s [[3]][[2]] 1100s [[3]][[2]][[1]] 1100s [1] "#bust a move" 1100s 1100s 1100s [[3]][[3]] 1100s [[3]][[3]][[1]] 1100s NULL 1100s 1100s 1100s 1100s > 1100s > # "`repeat`" 1100s > unitizer:::comm_extract( 1100s + unitizer:::parse_with_comments( 1100s + text = "repeat #first\n{runif(10); #comm\nbreak;}" 1100s + ) ) 1100s [[1]] 1100s NULL 1100s 1100s [[2]] 1100s [[2]][[1]] 1100s NULL 1100s 1100s [[2]][[2]] 1100s [[2]][[2]][[1]] 1100s [1] "#first" 1100s 1100s 1100s [[2]][[3]] 1100s [[2]][[3]][[1]] 1100s NULL 1100s 1100s [[2]][[3]][[2]] 1100s [[2]][[3]][[2]][[1]] 1100s NULL 1100s 1100s 1100s [[2]][[3]][[3]] 1100s [[2]][[3]][[3]][[1]] 1100s [1] "#comm" 1100s 1100s [[2]][[3]][[3]][[2]] 1100s [[2]][[3]][[3]][[2]][[1]] 1100s NULL 1100s 1100s 1100s [[2]][[3]][[3]][[3]] 1100s [[2]][[3]][[3]][[3]][[1]] 1100s NULL 1100s 1100s 1100s 1100s [[2]][[3]][[4]] 1100s [[2]][[3]][[4]][[1]] 1100s NULL 1100s 1100s 1100s 1100s 1100s > 1100s > # "S4 slot" 1100s > unitizer:::comm_extract( 1100s + unitizer:::parse_with_comments(text = "test@#comment\nhello <- 3") 1100s + ) 1100s [[1]] 1100s NULL 1100s 1100s [[2]] 1100s [[2]][[1]] 1100s NULL 1100s 1100s [[2]][[2]] 1100s [[2]][[2]][[1]] 1100s NULL 1100s 1100s 1100s [[2]][[3]] 1100s [[2]][[3]][[1]] 1100s NULL 1100s 1100s [[2]][[3]][[2]] 1100s [[2]][[3]][[2]][[1]] 1100s [1] "#comment" 1100s 1100s 1100s [[2]][[3]][[3]] 1100s [[2]][[3]][[3]][[1]] 1100s NULL 1100s 1100s 1100s [[2]][[3]][[4]] 1100s [[2]][[3]][[4]][[1]] 1100s NULL 1100s 1100s 1100s 1100s [[2]][[4]] 1100s [[2]][[4]][[1]] 1100s NULL 1100s 1100s 1100s 1100s > 1100s > # "`while`" 1100s > unitizer:::comm_extract( 1100s + unitizer:::parse_with_comments( 1100s + text = "while(x > 5 # a comment\n) { hello; goodbye } #yay" 1100s + ) ) 1100s [[1]] 1100s NULL 1100s 1100s [[2]] 1100s [[2]][[1]] 1100s NULL 1100s 1100s [[2]][[2]] 1100s [[2]][[2]][[1]] 1100s NULL 1100s 1100s 1100s [[2]][[3]] 1100s [[2]][[3]][[1]] 1100s [1] "# a comment" 1100s 1100s [[2]][[3]][[2]] 1100s [[2]][[3]][[2]][[1]] 1100s NULL 1100s 1100s 1100s [[2]][[3]][[3]] 1100s [[2]][[3]][[3]][[1]] 1100s NULL 1100s 1100s 1100s [[2]][[3]][[4]] 1100s [[2]][[3]][[4]][[1]] 1100s NULL 1100s 1100s 1100s 1100s [[2]][[4]] 1100s [[2]][[4]][[1]] 1100s NULL 1100s 1100s [[2]][[4]][[2]] 1100s [[2]][[4]][[2]][[1]] 1100s NULL 1100s 1100s 1100s [[2]][[4]][[3]] 1100s [[2]][[4]][[3]][[1]] 1100s NULL 1100s 1100s 1100s [[2]][[4]][[4]] 1100s [[2]][[4]][[4]][[1]] 1100s NULL 1100s 1100s 1100s 1100s 1100s > 1100s > 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 " 1100s > test.comp <- unitizer:::comm_extract(unitizer:::parse_with_comments(text = txt2)) 1100s > 1100s > # "A more complex test" 1100s > lapply(test.comp[4:5], `[[`, 1) 1100s [[1]] 1100s [1] "# Need to add tests:" 1100s [2] "# - with complex objects? (did I mean in the definition? Or the call??)" 1100s 1100s [[2]] 1100s [1] "# These should be identical to match.call()" 1100s 1100s > 1100s > # "Added SYMBOL_PACKAGE token" 1100s > unitizer:::comm_extract( 1100s + unitizer:::parse_with_comments( 1100s + text = "# a comment before\nunitizer:::browse() #a comment after" 1100s + ) ) 1100s [[1]] 1100s NULL 1100s 1100s [[2]] 1100s [[2]][[1]] 1100s [1] "# a comment before" "#a comment after" 1100s 1100s 1100s > # "Added SYMBOL_PACKAGE token v2" 1100s > unitizer:::comm_extract( 1100s + unitizer:::parse_with_comments( 1100s + text = "# a comment before\nunitizer::browse() #a comment after" 1100s + ) ) 1100s [[1]] 1100s NULL 1100s 1100s [[2]] 1100s [[2]][[1]] 1100s [1] "# a comment before" "#a comment after" 1100s 1100s 1100s > # LBB used to break stuff 1100s > txt3 <- "# This is an early comment\n hello <- 25\n # multi\n hello[[1]] # and another!" 1100s > # "LBB test" 1100s > unitizer:::comm_extract(unitizer:::parse_with_comments(text = txt3)) 1100s [[1]] 1100s NULL 1100s 1100s [[2]] 1100s [[2]][[1]] 1100s [1] "# This is an early comment" 1100s 1100s [[2]][[2]] 1100s [[2]][[2]][[1]] 1100s NULL 1100s 1100s 1100s [[2]][[3]] 1100s [[2]][[3]][[1]] 1100s NULL 1100s 1100s 1100s [[2]][[4]] 1100s [[2]][[4]][[1]] 1100s NULL 1100s 1100s 1100s 1100s [[3]] 1100s [[3]][[1]] 1100s [1] "# multi" "# and another!" 1100s 1100s [[3]][[2]] 1100s [[3]][[2]][[1]] 1100s NULL 1100s 1100s 1100s [[3]][[3]] 1100s [[3]][[3]][[1]] 1100s NULL 1100s 1100s 1100s [[3]][[4]] 1100s [[3]][[4]][[1]] 1100s NULL 1100s 1100s 1100s 1100s > 1100s > # - "Weird missing comment on `res` works" ------------------------------------- 1100s > 1100s > 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" 1100s > expr <- unitizer:::parse_with_comments(text = txt3) 1100s > my.unitizer <- new("unitizer", id = 1, zero.env = new.env()) 1100s > capture.output(my.unitizer <- my.unitizer + expr) 1101s character(0) 1101s > 1101s > lapply(unitizer:::as.list(my.unitizer@items.new), slot, "comment") 1101s [[1]] 1101s [1] "# Calls to `library` and assignments are not normally considered tests, so" 1101s [2] "# you will not be prompted to review them" 1101s 1101s [[2]] 1101s character(0) 1101s 1101s [[3]] 1101s character(0) 1101s 1101s [[4]] 1101s character(0) 1101s 1101s [[5]] 1101s [1] "# first reviewable expression" 1101s 1101s [[6]] 1101s character(0) 1101s 1101s [[7]] 1101s character(0) 1101s 1101s [[8]] 1101s [1] "# This should cause an error; press Y to add to store" 1101s 1101s > 1101s > # - "exprlist excission with negative par ids" --------------------------------- 1101s > 1101s > txt <- "# For random tests\n\nunitizer_sect(\"blah\", {\n identity(1);\n})\n" 1101s > prs.dat <- unitizer:::parse_dat_get(text = txt)$dat 1101s > # set negative ids to be top level parents 1101s > prs.dat <- transform(prs.dat, parent = ifelse(parent < 0, 0L, 1101s + parent)) 1101s > prs.dat <- normalize_id(prs.dat) 1101s > ancestry <- with(prs.dat, unitizer:::ancestry_descend(id, parent, 1101s + 0L)) 1101s > x <- unitizer:::prsdat_fix_exprlist(prs.dat, ancestry) 1101s > unname(as.matrix(x[, 5:6])) 1101s [,1] [,2] 1101s [1,] 1 0 1101s [2,] 21 0 1101s [3,] 2 4 1101s [4,] 4 21 1101s [5,] 3 21 1101s [6,] 5 7 1101s [7,] 7 21 1101s [8,] 6 21 1101s [9,] 19 21 1101s [10,] 8 19 1101s [11,] 15 19 1101s [12,] 9 11 1101s [13,] 11 15 1101s [14,] 10 15 1101s [15,] 12 13 1101s [16,] 13 15 1101s [17,] 14 15 1101s [18,] 18 19 1101s [19,] 20 21 1101s > 1101s > # - "empty symbols handled okay" ----------------------------------------------- 1101s > 1101s > # the empty second argument to `[` caused problems before 1101s > txt <- "mtcars[1:10,]\n" 1101s > # shouldn't cause error 1101s > unitizer:::parse_with_comments(text = txt) 1101s expression(mtcars[1:10,]) 1101s > 1101s > # - "uncommenting works" ------------------------------------------------------- 1101s > 1101s > unitizer:::uncomment(expr[[1]]) 1101s library(utzflm) 1101s > 1101s > # "don't blow away function arg names" 1101s > unitizer:::uncomment(quote(function(a, b) NULL)) 1101s function(a, b) NULL 1101s > # 1101s > # Recover comments and uncomment 1101s > 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))" 1101s > exp <- unitizer:::parse_with_comments(text = txt) 1101s > candc <- unitizer:::comm_and_call_extract(exp) 1101s > 1101s > candc$call[[1L]] 1101s .alike(quote(fun(b = fun2(x, y), 1, 3)), quote(fun(NULL, fun2(a, 1101s b), 1)), alike_settings(lang.mode = 1)) 1101s > 1101s > candc$comments 1101s [1] "# FALSE, match.call disabled" "# first sub.call" 1101s [3] "# second sub.call" 1101s > 1101s > # - "failing parses produce proper errors" ------------------------------------- 1101s > 1101s > txt <- "this is a + syntax error that cannot be parsed" 1101s > try(capture.output(unitizer:::parse_tests(text = txt), type = "message")) 1101s Error in value[[3L]](cond) : 1101s Unable to parse test file; see previous messages 1101s > f <- tempfile() 1101s > on.exit(unlink(f)) 1101s > cat(txt, "\n", sep = "", file = f) 1101s > try(capture.output(unitizer:::parse_tests(f), type = "message")) 1101s Error in value[[3L]](cond) : 1101s Unable to parse test file; see previous messages 1101s > # try in normal mode (just fall back to normal parse) 1101s > try(unitizer:::parse_tests(text = txt, comments = FALSE)) 1101s Error in parse(text = text, keep.source = FALSE) : 1101s :1:6: unexpected symbol 1101s 1: this is 1101s ^ 1101s > 1101s > any( 1101s + grepl( 1101s + "unexpected symbol", 1101s + capture.output(try(unitizer:::parse_tests(f, comments = FALSE)), type='message'), 1101s + ) ) 1101s [1] TRUE 1101s > 1101s > # - "NULL, constants, and new tokens" ------------------------------------------ 1101s > 1101s > # These were added with 3.6.3? Previously, it seems that the equal assign did 1101s > # not generate a master expression to wrap all the pieces, which means these 1101s > # tests just don't work because all the eq_assign at the top level end up with 1101s > # the same parent and the parser gets confused. 1101s > 1101s > txt <- c("a = 2", "# ho how", "b = 3", "", "b + a # oh here", 1101s + "", "b + # oh there", "a # bear", "", "NULL") 1101s > if(getRversion() >= "3.6.3") { 1101s + identical( 1101s + unitizer:::comm_extract(unitizer:::parse_with_comments(text = txt)), 1101s + rds('parse-eq') 1101s + ) 1101s + } else TRUE 1101s [1] TRUE 1101s > 1101s > with.const <- unitizer:::parse_with_comments(text = "3 # comment on const") 1101s > unitizer:::symb_mark_rem(with.const[[1]]) 1101s [1] 3 1101s > 1101s > 1101s PASS 1101s Begin testing t-prompt.R 1101s 1101s R version 4.3.2 (2023-10-31) -- "Eye Holes" 1101s Copyright (C) 2023 The R Foundation for Statistical Computing 1101s Platform: x86_64-pc-linux-gnu (64-bit) 1101s 1101s R is free software and comes with ABSOLUTELY NO WARRANTY. 1101s You are welcome to redistribute it under certain conditions. 1101s Type 'license()' or 'licence()' for distribution details. 1101s 1101s R is a collaborative project with many contributors. 1101s Type 'contributors()' for more information and 1101s 'citation()' on how to cite R or R packages in publications. 1101s 1101s Type 'demo()' for some demos, 'help()' for on-line help, or 1101s 'help.start()' for an HTML browser interface to help. 1101s Type 'q()' to quit R. 1101s 1101s > source(file.path("_helper", "init.R")) 1101s > 1101s > # - "read_line works" ---------------------------------------------------------- 1101s > 1101s > # read through prompt vals 1101s > 1101s > unitizer:::read_line_set_vals(letters[1:3]) 1101s > u.ns <- asNamespace("unitizer") 1101s > unitizer:::read_line() 1101s a 1101s [1] "a" 1101s > identical(u.ns$.global$prompt.vals, letters[2:3]) 1101s [1] TRUE 1101s > unitizer:::read_line() 1101s b 1101s [1] "b" 1101s > u.ns$.global$prompt.vals 1101s [1] "c" 1101s > unitizer:::read_line() 1101s c 1101s [1] "c" 1101s > u.ns$.global$prompt.vals 1101s character(0) 1101s > 1101s > try(unitizer:::read_line()) 1101s Error : Internal Error: ran out of predefined readline input; contact maintainer. 1101s > 1101s > # - "simple prompts" ----------------------------------------------------------- 1101s > 1101s > unitizer:::read_line_set_vals(c("y", "Y", "n", "N")) 1101s > try(unitizer:::simple_prompt(1:5)) 1101s Error in unitizer:::simple_prompt(1:5) : 1101s Argument `message` must be character 1101s > try(unitizer:::simple_prompt("hello", attempts = 1:5)) 1101s Error in unitizer:::simple_prompt("hello", attempts = 1:5) : 1101s Argument `attempts` must be numeric(1L), not NA, and one or greater 1101s > try(unitizer:::simple_prompt("hello", values = NA_character_)) 1101s Error in unitizer:::simple_prompt("hello", values = NA_character_) : 1101s Argument `values` must be character with no NAs 1101s > try(unitizer:::simple_prompt("hello", case.sensitive = 1)) 1101s Error in unitizer:::simple_prompt("hello", case.sensitive = 1) : 1101s Argument `case.sensitive` must be TRUE or FALSE 1101s > 1101s > unitizer:::simple_prompt("hello") 1101s | hello 1101s 1101s unitizer> y 1101s [1] "Y" 1101s > unitizer:::simple_prompt("hello")# 1101s | hello 1101s 1101s unitizer> Y 1101s [1] "Y" 1101s > unitizer:::simple_prompt("hello") 1101s | hello 1101s 1101s unitizer> n 1101s [1] "N" 1101s > unitizer:::read_line_set_vals(c("y", "y", "n")) 1101s > try(unitizer:::simple_prompt("hello", attempts = 1L, case.sensitive = TRUE)) 1101s | hello 1101s 1101s unitizer> y 1101s | Invalid input, please select one of: Y, N 1101s 1101s Error in unitizer:::simple_prompt("hello", attempts = 1L, case.sensitive = TRUE) : 1101s Gave up trying to collect user input after 1 attempts. 1101s > try(unitizer:::simple_prompt("hello", attempts = 1L, case.sensitive = TRUE), 1101s + silent = TRUE) 1101s | hello 1101s 1101s unitizer> y 1101s | Invalid input, please select one of: Y, N 1101s 1101s > try(unitizer:::simple_prompt("hello", attempts = 1L, case.sensitive = TRUE)) 1101s | hello 1101s 1101s unitizer> n 1101s | Invalid input, please select one of: Y, N 1101s 1101s Error in unitizer:::simple_prompt("hello", attempts = 1L, case.sensitive = TRUE) : 1101s Gave up trying to collect user input after 1 attempts. 1101s > 1101s > # - "faux prompt" -------------------------------------------------------------- 1101s > 1101s > unitizer:::read_line_set_vals(c("1 +", "1")) 1101s > unitizer:::faux_prompt(prompt = "> ", continue = "+ ")[[1L]] 1101s > 1 + 1101s + 1 1101s 1 + 1 1101s > unitizer:::read_line_set_vals(c("(})")) 1101s > try(unitizer:::faux_prompt(prompt = "> ", continue = "+ ")) 1101s > (}) 1101s Error in "(})" : :1:2: unexpected '}' 1101s 1: (} 1101s ^ 1101s > 1101s > ## Test the new readLines based read_line 1101s > ## This test will not work in interactive mode, requiring input 1101s > unitizer:::read_line_set_vals(c("1 +", "1")) 1101s > unitizer:::faux_prompt() 1101s > 1 + 1101s + 1 1101s expression(1 + 1) 1101s > 1101s > ## This one embeds a CTRL+C to test interrupt, but we can't test this without 1101s > ## read_line_setvals 1101s > unitizer:::read_line_set_vals(c("1 +", "\x03", "2 + ", "1")) 1101s > unitizer:::faux_prompt() 1101s > 1 + 1101s +  1101s 1101s > 2 + 1101s + 1 1101s expression(2 + 1) 1101s > 1101s > unitizer:::read_line_set_vals(c("\x03", "2 + ", "1")) 1101s > unitizer:::faux_prompt() 1101s >  1101s 1101s 1101s | Type "Q" at the prompt to quit unitizer. 1101s 1101s > 2 + 1101s + 1 1101s expression(2 + 1) 1101s > 1101s > ## Test that changing language doesn't affect partial parsing 1101s > lang <- Sys.getenv("LANGUAGE", unset=NA) 1101s > Sys.setenv("LANGUAGE"="fr") 1101s > unitizer:::read_line_set_vals(c("1 +", "1")) 1101s > unitizer:::faux_prompt(prompt = "> ", continue = "+ ") 1101s > 1 + 1101s + 1 1101s expression(1 + 1) 1101s > if(is.na(lang)) Sys.unsetenv("LANGUAGE") else Sys.setenv("LANGUAGE"=lang) 1101s > 1101s > # - "unitizer prompt" ---------------------------------------------------------- 1101s > 1101s > # Some of this needs to be done outside of testthat due to sinking 1101s > suppressWarnings(glob <- unitizer:::unitizerGlobal$new()) 1101s > unitizer:::read_line_set_vals(c("1 +", "1", "H", "Y")) 1101s > unitizer:::unitizer_prompt( 1101s + "hello", valid.opts = c(Y = "[Y]es", N = "[N]o"), global = glob 1101s + ) 1101s unitizer> 1 + 1101s + 1 1101s [1] 2 1101s unitizer> H 1101s 1101s | No help available. 1101s | 1101s | hello ([Y]es, [N]o, [Q]uit, [H]elp)? 1101s 1101s unitizer> Y 1101s 1101s [1] "Y" 1101s > 1101s > unitizer:::read_line_set_vals(c("1 +", "1", "H", "Q")) 1101s > unitizer:::unitizer_prompt("hello", 1101s + valid.opts = c(Y = "[Y]es", N = "[N]o"), help = "This is all the help you get", 1101s + global = glob) 1101s unitizer> 1 + 1101s + 1 1101s [1] 2 1101s unitizer> H 1101s 1101s | This is all the help you get 1101s | 1101s | hello ([Y]es, [N]o, [Q]uit, [H]elp)? 1101s 1101s unitizer> Q 1101s 1101s [1] "Q" 1101s > 1101s > unitizer:::read_line_set_vals(c("hell())", "Q")) 1101s > txt3 <- unitizer:::capture_output(unitizer:::unitizer_prompt("hello", 1101s + valid.opts = c(Y = "[Y]es", N = "[N]o"), global = glob)) 1101s > txt3$message 1101s [1] "Error in \"hell())\": :1:7: unexpected ')'" 1101s [2] "1: hell())" 1101s [3] " ^" 1101s > 1101s > # and multiline stuff (#242) 1101s > unitizer:::read_line_set_vals(c("{\n 1 + 1\n 2 + 1\n}", "N")) 1101s > unitizer:::unitizer_prompt( 1101s + "hello", valid.opts = c(Y = "[Y]es", N = "[N]o"), global = glob 1101s + ) 1101s unitizer> { 1101s 1 + 1 1101s 2 + 1 1101s } 1101s [1] 3 1101s unitizer> N 1101s 1101s [1] "N" 1101s > 1101s > try( 1101s + unitizer:::unitizer_prompt( 1101s + "hello", valid.opts = c(Y = "[Y]es", N = "[N]o"), 1101s + browse.env = "not an env", global = glob 1101s + ) ) 1101s Error in unitizer:::unitizer_prompt("hello", valid.opts = c(Y = "[Y]es", : 1101s Argument `browse.env` must be an environment 1101s > 1101s > unitizer:::read_line_set_vals(character()) 1101s > try( 1101s + unitizer:::unitizer_prompt( 1101s + "hello", valid.opts = c(Y = "[Y]es", N = "[N]o"), global = glob 1101s + ) ) 1101s Error : Internal Error: ran out of predefined readline input; contact maintainer. 1101s > unitizer:::read_line_set_vals("1L") 1101s > try( 1101s + unitizer:::unitizer_prompt( 1101s + "hello", 1101s + valid.opts = c(Y = "[Y]es", N = "[N]o"), 1101s + exit.condition = unitizer:::exit_fun, 1101s + valid.vals = 2:3, global = glob 1101s + ) ) 1101s unitizer> 1L 1101s | Type a number in `2:3` at the prompt 1101s [1] 1 1101s Error : Internal Error: ran out of predefined readline input; contact maintainer. 1101s > unitizer:::read_line_set_vals("2L") 1101s > unitizer:::unitizer_prompt("hello", valid.opts = c(Y = "[Y]es", 1101s + N = "[N]o"), exit.condition = unitizer:::exit_fun, valid.vals = 2:3, 1101s + global = glob) 1101s unitizer> 2L 1101s [1] 2 1101s > 1101s > 1101s PASS 1101s Begin testing t-random.R 1101s 1101s R version 4.3.2 (2023-10-31) -- "Eye Holes" 1101s Copyright (C) 2023 The R Foundation for Statistical Computing 1101s Platform: x86_64-pc-linux-gnu (64-bit) 1101s 1101s R is free software and comes with ABSOLUTELY NO WARRANTY. 1101s You are welcome to redistribute it under certain conditions. 1101s Type 'license()' or 'licence()' for distribution details. 1101s 1101s R is a collaborative project with many contributors. 1101s Type 'contributors()' for more information and 1101s 'citation()' on how to cite R or R packages in publications. 1101s 1101s Type 'demo()' for some demos, 'help()' for on-line help, or 1101s 'help.start()' for an HTML browser interface to help. 1101s Type 'q()' to quit R. 1101s 1101s > source(file.path("_helper", "init.R")) 1102s > 1102s > # - "random seed" -------------------------------------------------------------- 1102s > 1102s > dir <- file.path(TMP.DIR, "randdir") 1102s > dir.create(dir) 1102s > file <- file.path(dir, "randtest.R") 1102s > cat("sample(1:100)\n", file = file) 1102s > set.seed(1) 1102s > coi(unitize(file, auto.accept = "new")) 1102s Warning in history_capt(history, interactive.mode) : 1102s Unable to capture history in non-interactive mode. 1102s | Auto-accepting changes... 1102s | unitizer updated. 1102s 1102s > # changing seed should have no effect on result 1102s > set.seed(23) 1102s > coi(res <- unitize(file)) 1102s Warning in history_capt(history, interactive.mode) : 1102s Unable to capture history in non-interactive mode. 1102s | 1/1 test passed; nothing to review. 1102s 1102s > # expect_equal(as.character(res$status), "Passed") 1102s > as.character(res$status) 1102s [1] "Passed" 1102s > 1102s > 1102s PASS 1102s Begin testing t-rename.R 1102s 1102s R version 4.3.2 (2023-10-31) -- "Eye Holes" 1102s Copyright (C) 2023 The R Foundation for Statistical Computing 1102s Platform: x86_64-pc-linux-gnu (64-bit) 1102s 1102s R is free software and comes with ABSOLUTELY NO WARRANTY. 1102s You are welcome to redistribute it under certain conditions. 1102s Type 'license()' or 'licence()' for distribution details. 1102s 1102s R is a collaborative project with many contributors. 1102s Type 'contributors()' for more information and 1102s 'citation()' on how to cite R or R packages in publications. 1102s 1102s Type 'demo()' for some demos, 'help()' for on-line help, or 1102s 'help.start()' for an HTML browser interface to help. 1102s Type 'q()' to quit R. 1102s 1102s > source(file.path("_helper", "init.R")) 1103s > 1103s > # - "Rename Works" ------------------------------------------------------------- 1103s > 1103s > x <- readRDS("_helper/unitizers/trivial.unitizer/data.rds") 1103s > x.edit <- editCalls(x, quote(x), quote(y), interactive.only = FALSE) 1103s Warning in .local(x, lang.old, lang.new, ...) : 1103s This is an experimental function; make sure you backup any unitizers before you edit them 1103s > x.edit@items.ref.calls.deparse 1103s [1] "TRUE" "y <- 1 + 1" "y + 2" "y <- y" "y * y" 1103s [6] "y/y + 2" 1103s > !identical(x@items.ref.calls.deparse, x.edit@items.ref.calls.deparse) 1103s [1] TRUE 1103s > identical( 1103s + x.edit@items.ref.calls.deparse, 1103s + gsub("\\bx\\b", "y", x@items.ref.calls.deparse) 1103s + ) 1103s [1] TRUE 1103s > 1103s > # warn 1103s > unitizer:::read_line_set_vals("Y") 1103s > x.edit2 <- editCalls(x, quote(x), quote(y), interactive.mode = TRUE) 1103s Warning in .local(x, lang.old, lang.new, ...) : 1103s This is an experimental function; make sure you backup any unitizers before you edit them 1103s | Do you wish to proceed ([Y]es/[N]o)? 1103s 1103s unitizer> Y 1103s > # message 1103s > unitizer:::read_line_set_vals("N") 1103s > x.edit3 <- editCalls(x, quote(x), quote(y), interactive.mode = TRUE) 1103s Warning in .local(x, lang.old, lang.new, ...) : 1103s This is an experimental function; make sure you backup any unitizers before you edit them 1103s | Do you wish to proceed ([Y]es/[N]o)? 1103s 1103s unitizer> N 1103s Exiting without edits 1103s > identical(x.edit3, x) 1103s [1] TRUE 1103s > 1103s > unitizer:::read_line_set_vals(NULL) 1103s > x.edit@items.ref.calls.deparse 1103s [1] "TRUE" "y <- 1 + 1" "y + 2" "y <- y" "y * y" 1103s [6] "y/y + 2" 1103s > 1103s PASS 1103s Begin testing t-repairenvs.R 1103s 1103s R version 4.3.2 (2023-10-31) -- "Eye Holes" 1103s Copyright (C) 2023 The R Foundation for Statistical Computing 1103s Platform: x86_64-pc-linux-gnu (64-bit) 1103s 1103s R is free software and comes with ABSOLUTELY NO WARRANTY. 1103s You are welcome to redistribute it under certain conditions. 1103s Type 'license()' or 'licence()' for distribution details. 1103s 1103s R is a collaborative project with many contributors. 1103s Type 'contributors()' for more information and 1103s 'citation()' on how to cite R or R packages in publications. 1103s 1103s Type 'demo()' for some demos, 'help()' for on-line help, or 1103s 'help.start()' for an HTML browser interface to help. 1103s Type 'q()' to quit R. 1103s 1103s > source(file.path("_helper", "init.R")) 1103s > 1103s > exps <- expression(1 + 1, a <- 54, b <- 38, a + b, e <- 5 * a, 1103s + a^2, f <- e * a, matrix(rep(f, 20))) 1103s > my.unitizer <- new("unitizer", id = 1, zero.env = new.env()) 1103s > # add ref.exps as new items 1103s > coi(my.unitizer <- my.unitizer + exps) 1103s > my.unitizer2 <- new("unitizer", id = 2, zero.env = new.env()) 1103s > # now convert them to reference items 1103s > coi(my.unitizer2 <- my.unitizer2 + my.unitizer@items.new) 1103s > # - "messed up env ancestry repair works" -------------------------------------- 1103s > 1103s > # Purposefully mess up the environments 1103s > parent.env(my.unitizer2@items.ref[[2]]@env) <- baseenv() 1103s > x <- unitizer:::healEnvs(my.unitizer2@items.ref, my.unitizer2) 1103s Error in parent.env(env) : the empty environment has no parent 1103s Error in run_ls(env = x@env, stop.env = base.env, all.names = TRUE, store.env = ref.env.store) : 1103s Specified `stop.env` does not appear to be in parent environments. 1104s Warning in repairEnvs(items.final) : 1104s 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. 1104s > old.opt <- options(unitizer.max.env.depth = 20) 1104s > res <- unitizer:::healEnvs(my.unitizer2@items.ref, my.unitizer2) 1104s Error in try(while (!identical(env, stop.env)) { : 1104s Logic error: not finding `stop.env` after 20 iterations; contact package maintainer if this is an error. 1104s Error in run_ls(env = x@env, stop.env = base.env, all.names = TRUE, store.env = ref.env.store) : 1104s Specified `stop.env` does not appear to be in parent environments. 1104s Warning in repairEnvs(items.final) : 1104s 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. 1104s > is(res, "unitizerItems") 1104s [1] TRUE 1104s > ref.anc <- unitizer:::env_ancestry(x@base.env) 1104s > itm.anc <- unitizer:::env_ancestry(x[[1L]]@env) 1104s > # Items should belong to base env for reference 1104s > identical(rev(ref.anc), head(rev(itm.anc), length(ref.anc))) 1104s [1] TRUE 1104s > options(old.opt) 1104s > 1104s > # - "re-assigning to ignored environments handled properly" -------------------- 1104s > 1104s > # now `a + b` could try to re-assign to `a <- 54`, but that is same env as 1104s > # `a + b` b/c it is ignored 1104s > items.picked <- my.unitizer@items.new[-3L] 1104s > # expect_error(items.heal <- unitizer:::healEnvs(items.picked, 1104s > # my.unitizer), NA) 1104s > # no error 1104s > items.heal <- unitizer:::healEnvs(items.picked, my.unitizer) 1104s > 1104s > # - "full repair process works" ------------------------------------------------ 1104s > 1104s > # copy files and then try messing up environment for the object 1104s > file_test("-d", file.path("_helper")) 1104s [1] TRUE 1104s > store <- file.path("_helper", "unitizers", "trivial.unitizer") 1104s > store.new <- file.path(TMP.DIR, store) 1104s > dir.create(store.new, recursive = TRUE) 1104s > cpy.files <- c( 1104s + list.files(store, full.names = TRUE), 1104s + file.path("helper", "unitizers", "trivial.R") 1104s + ) 1104s > file.copy(cpy.files, file.path(TMP.DIR, cpy.files), overwrite = TRUE) 1104s [1] TRUE FALSE 1104s > 1104s > untz <- unitizer:::load_unitizers( 1104s + list(store.new), NA_character_, 1104s + par.frame = .GlobalEnv, interactive.mode = TRUE, mode = "unitize", 1104s + show.progress=0L, transcript=FALSE 1104s + ) 1104s Warning in unitizer:::load_unitizers(list(store.new), NA_character_, par.frame = .GlobalEnv, : 1104s Upgraded test file does not match original test file ('trivial.R' vs 'NA'). 1104s Warning in .Object$initialize(...) : 1104s Instantiated global object without global namespace registry; you should only see this warning you are using `repair_environments`. 1104s > # Break env chain, store, and reload 1104s > untz[[1L]]@items.ref.calls.deparse[[5L]] 1104s [1] "y * x" 1104s > parent.env(untz[[1L]]@items.ref[[5L]]@env) <- baseenv() 1104s > # warning 1104s > unitizer:::store_unitizer(untz[[1L]]) 1104s | unitizer updated. 1104s 1104s > untz.rep <- repair_environments(store.new) 1104s Warning in .Object$initialize(...) : 1104s Instantiated global object without global namespace registry; you should only see this warning you are using `repair_environments`. 1104s Warning in repairEnvs(x@items.ref) : 1104s 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. 1104s | unitizer updated. 1104s 1104s > # this should not give warnings 1104s > unitizer:::healEnvs(untz.rep@items.ref, untz.rep) 1104s An object of class "unitizerItems" 1104s Slot "base.env": 1104s 1104s 1104s Slot ".items": 1104s [[1]] 1104s ~~~ Reference Test ~~~ 1104s TRUE 1104s * value: logi[1] 1104s * output: 9 chars 1104s 1104s Access components with `$`, e.g. `.REF$value`; see `help("$", "unitizer")` 1104s 1104s [[2]] 1104s ~~~ Reference Test ~~~ 1104s x <- 1 + 1 1104s * value: unitizerDummy 1104s 1104s Access components with `$`, e.g. `.REF$value`; see `help("$", "unitizer")` 1104s 1104s [[3]] 1104s ~~~ Reference Test ~~~ 1104s x + 2 1104s * value: num[1] 1104s * output: 6 chars 1104s 1104s Access components with `$`, e.g. `.REF$value`; see `help("$", "unitizer")` 1104s 1104s [[4]] 1104s ~~~ Reference Test ~~~ 1104s y <- x 1104s * value: unitizerDummy 1104s 1104s Access components with `$`, e.g. `.REF$value`; see `help("$", "unitizer")` 1104s 1104s [[5]] 1104s ~~~ Reference Test ~~~ 1104s y * x 1104s * value: num[1] 1104s * output: 6 chars 1104s 1104s Access components with `$`, e.g. `.REF$value`; see `help("$", "unitizer")` 1104s 1104s [[6]] 1104s ~~~ Reference Test ~~~ 1104s y/x + 2 1104s * value: num[1] 1104s * output: 6 chars 1104s 1104s Access components with `$`, e.g. `.REF$value`; see `help("$", "unitizer")` 1104s 1104s 1104s Slot ".pointer": 1104s [1] 0 1104s 1104s Slot ".seek.fwd": 1104s [1] TRUE 1104s 1104s > 1104s > 1104s PASS 1104s Begin testing t-search.R 1104s 1104s R version 4.3.2 (2023-10-31) -- "Eye Holes" 1104s Copyright (C) 2023 The R Foundation for Statistical Computing 1104s Platform: x86_64-pc-linux-gnu (64-bit) 1104s 1104s R is free software and comes with ABSOLUTELY NO WARRANTY. 1104s You are welcome to redistribute it under certain conditions. 1104s Type 'license()' or 'licence()' for distribution details. 1104s 1104s R is a collaborative project with many contributors. 1104s Type 'contributors()' for more information and 1104s 'citation()' on how to cite R or R packages in publications. 1104s 1104s Type 'demo()' for some demos, 'help()' for on-line help, or 1104s 'help.start()' for an HTML browser interface to help. 1104s Type 'q()' to quit R. 1104s 1104s > source(file.path("_helper", "init.R")) 1104s > source(file.path("_helper", "pkgs.R")) 1104s Install Packages 1107s Setup Demos 1107s > 1107s > unitizer.dummy.list <- list(A = 1, B = 2, C = 3) 1107s > unitizer.dummy.list.2 <- list(A = 13, B = 24, C = 35) 1107s > # can't unload `unitizer`, ruins `covr` 1107s > try(detach("package:unitizer"), silent = TRUE) 1107s > try(detach("package:unitizerdummypkg1", unload = TRUE), silent = TRUE) 1107s > try(detach("package:unitizerdummypkg2", unload = TRUE), silent = TRUE) 1107s > while ("unitizer.dummy.list" %in% search()) try(detach("unitizer.dummy.list")) 1107s > state.set <- setNames(rep(2L, length(unitizer:::.unitizer.global.settings.names)), 1107s + unitizer:::.unitizer.global.settings.names) 1107s > library(unitizer) 1107s > library(unitizerdummypkg1, lib.loc = TMP.LIB) 1107s > library(unitizerdummypkg2, lib.loc = TMP.LIB) 1107s > 1107s > # - "Detecting packages" ------------------------------------------------------- 1107s > 1107s > unitizer:::is.loaded_package("package:unitizer") 1107s [1] TRUE 1107s > unitizer:::is.loaded_package("unitizer") # FALSE 1107s [1] FALSE 1107s > unitizer:::is.loaded_package("package:stats") 1107s [1] TRUE 1107s > try(unitizer:::is.loaded_package(1)) 1107s Error in unitizer:::is.loaded_package(1) : 1107s Argument `pkg.name` must be character 1L 1107s > try(unitizer:::is.loaded_package(letters)) 1107s Error in unitizer:::is.loaded_package(letters) : 1107s Argument `pkg.name` must be character 1L 1107s > unitizer:::is.loaded_package("Autoloads") # FALSE 1107s [1] FALSE 1107s > is.list(pkg.dat <- unitizer:::get_package_data()) 1107s [1] TRUE 1107s > all( 1107s + vapply( 1107s + pkg.dat, function(x) is.list(x) && identical(names(x), 1107s + c("names", "lib.loc", "version")), logical(1L) 1107s + ) ) 1107s [1] TRUE 1107s > 1107s > # - "Path Compression" --------------------------------------------------------- 1107s > 1107s > search.init.full <- unitizer:::search_as_envs() 1107s > search.init <- search.init.full$search.path 1107s > 1107s > head(unitizer:::compress_search_data(search.init.full), 3L) 1107s [1] ".GlobalEnv" "package:unitizerdummypkg2 (v0.1)" 1107s [3] "package:unitizerdummypkg1 (v0.1)" 1107s > 1107s > # - "Moving Objects on Search Path Works" -------------------------------------- 1107s > 1107s > if (length(search.init) < 6L) stop("Unexpetedly short search path") 1107s > untz.glob <- unitizer:::unitizerGlobal$new(enable.which = state.set, 1107s + set.global = TRUE) 1107s > 1107s > try(unitizer:::move_on_path(5L, 2L, untz.glob)) 1107s Error in unitizer:::move_on_path(5L, 2L, untz.glob) : 1107s old.pos > new.pos is not TRUE 1107s > try(unitizer:::move_on_path(1L, 2L, untz.glob)) 1107s Error in unitizer:::move_on_path(1L, 2L, untz.glob) : 1107s new.pos > 1L is not TRUE 1107s > unitizer:::move_on_path(2L, 5L, untz.glob) 1107s > # can't compare actual environments as they change when detached and 1107s > # re-attached 1107s > 1107s > all.equal( 1107s + names(unitizer:::search_as_envs()$search.path), 1107s + names(search.init[c(1L, 5L, 2L:4L, 6L:length(search.init))]) 1107s + ) 1107s [1] TRUE 1107s > # Now let's undo the previous move, by pushing second pack back to 1107s > # original position 1107s > for (i in rep(5L, 3L)) unitizer:::move_on_path(2L, 5L, untz.glob) 1107s > unitizer:::search_dat_equal(unitizer:::search_as_envs(), search.init.full) 1107s [1] TRUE 1107s > untz.glob$release() 1107s > 1107s > # - "Search Path Journaling Works" --------------------------------------------- 1107s > 1107s > try(detach("package:unitizer"), silent = TRUE) 1107s > try(detach("package:unitizerdummypkg1", unload = TRUE), silent = TRUE) 1107s > try(detach("package:unitizerdummypkg2", unload = TRUE), silent = TRUE) 1107s > library(unitizer) 1107s > # Initialize a global tracking object. Doing it funny here because we don't 1107s > # want to run the search_path_trim command yet, and that would happen if we 1107s > # did a normal init 1107s > # will be modified later 1107s > search.ref <- NULL 1107s > search.init <- unitizer:::search_as_envs() 1107s > untz.glob <- unitizer:::unitizerGlobal$new(enable.which = state.set, 1107s + set.global = TRUE) 1107s > 1107s > stat.tpl <- new("unitizerGlobalStatus", search.path = 2L, working.directory = 2L, 1107s + options = 2L, random.seed = 2L, namespaces = 2L) 1107s > # these need to be done outside of `test_that` b/c `test_that` sets the 1107s > # rlang_trace_top_env option 1107s > st.0 <- untz.glob$indices.last 1107s > st.1 <- untz.glob$state() 1107s > 1107s > # Note, these are intended to be run without the shimming in place 1107s > identical(untz.glob$status, stat.tpl) 1107s [1] TRUE 1107s > 1107s > # state should only be recorded if it changes 1107s > st.0 1107s An object of class "unitizerGlobalIndices" 1107s Slot "search.path": 1107s [1] 1 1107s 1107s Slot "options": 1107s [1] 1 1107s 1107s Slot "working.directory": 1107s [1] 1 1107s 1107s Slot "random.seed": 1107s [1] 1 1107s 1107s Slot "namespaces": 1107s [1] 1 1107s 1107s > identical(st.0, st.1) 1107s [1] TRUE 1107s > # Add a package 1107s > library("unitizerdummypkg1", lib.loc = TMP.LIB) 1107s > st.2 <- untz.glob$state() 1107s > # have two recorded states 1107s > st.2@search.path 1107s [1] 2 1107s > # should have one more item 1107s > diff(sapply(untz.glob$tracking@search.path, function(x) length(x$search.path))) 1107s [1] 1 1107s > environmentName(untz.glob$tracking@search.path[[2L]]$search.path[[2L]]) 1107s [1] "package:unitizerdummypkg1" 1107s > sp.tmp <- untz.glob$tracking@search.path 1107s > # note we compare attribute separately because subsetting drops them 1107s > identical(sp.tmp[[1L]]$search.path, sp.tmp[[2L]]$search.path[-2L]) 1107s [1] TRUE 1107s > 1107s > identical( 1107s + sp.tmp[[1L]]$ns.dat, 1107s + sp.tmp[[2L]]$ns.dat[names(sp.tmp[[2L]]$ns.dat) != "unitizerdummypkg1"] 1107s + ) 1107s [1] TRUE 1107s > # Add another package at a different position 1107s > library("unitizerdummypkg2", pos = 4L, lib.loc = TMP.LIB) 1107s > st.3 <- untz.glob$state() 1107s > diff(sapply(untz.glob$tracking@search.path, function(x) length(x$search.path))) 1107s [1] 1 1 1107s > environmentName( 1107s + untz.glob$tracking@search.path[[st.3@search.path]]$search.path[[4L]] 1107s + ) 1107s [1] "package:unitizerdummypkg2" 1107s > # Attach a list 1107s > attach(unitizer.dummy.list) 1107s > search.ref <- untz.glob$state() 1107s > environmentName( 1107s + untz.glob$tracking@search.path[[search.ref@search.path]]$search.path[[2L]] 1107s + ) 1107s [1] "unitizer.dummy.list" 1107s > identical( 1107s + as.list( 1107s + untz.glob$tracking@search.path[[search.ref@search.path]]$search.path[[2L]] 1107s + ), 1107s + unitizer.dummy.list 1107s + ) 1107s [1] TRUE 1107s > # And one more, but modified 1107s > unitizer.dummy.list.2 <- list(A = 13, B = 24, C = 35) 1107s > attach(unitizer.dummy.list.2, pos = 4L, name = "unitizer.dummy.list") 1107s The following objects are masked _by_ unitizer.dummy.list (pos = 2): 1107s 1107s A, B, C 1107s 1107s > st.4 <- untz.glob$state() 1107s > curr.sp.ind <- untz.glob$indices.last@search.path 1107s > environmentName(untz.glob$tracking@search.path[[curr.sp.ind]]$search.path[[4L]]) 1107s [1] "unitizer.dummy.list" 1107s > # Make sure search path is lining up 1107s > all.equal( 1107s + names(untz.glob$tracking@search.path[[curr.sp.ind]]$search.path), search() 1107s + ) 1107s [1] TRUE 1107s > identical( 1107s + as.list(untz.glob$tracking@search.path[[curr.sp.ind]]$search.path[[4L]]), 1107s + unitizer.dummy.list.2 1107s + ) 1107s [1] TRUE 1107s > identical( 1107s + as.list(untz.glob$tracking@search.path[[curr.sp.ind]]$search.path[[2L]]), 1107s + unitizer.dummy.list 1107s + ) 1107s [1] TRUE 1107s > # should still point to same environment 1107s > identical( 1107s + untz.glob$tracking@search.path[[curr.sp.ind - 1L]]$search.path[[2L]], 1107s + untz.glob$tracking@search.path[[curr.sp.ind]]$search.path[[2L]] 1107s + ) 1107s [1] TRUE 1107s > # state shouldn't have changed 1107s > identical(untz.glob$state(), st.4) 1107s [1] TRUE 1107s > 1107s > # detach some stuff 1107s > # this is the first list 1107s > detach(2L) 1107s > untz.glob$state() 1107s An object of class "unitizerGlobalIndices" 1107s Slot "search.path": 1107s [1] 6 1107s 1107s Slot "options": 1107s [1] 1 1107s 1107s Slot "working.directory": 1107s [1] 1 1107s 1107s Slot "random.seed": 1107s [1] 1 1107s 1107s Slot "namespaces": 1107s [1] 3 1107s 1107s > curr.sp.ind <- untz.glob$indices.last@search.path 1107s > identical( 1107s + untz.glob$tracking@search.path[[curr.sp.ind]]$search.path, 1107s + untz.glob$tracking@search.path[[curr.sp.ind - 1L]]$search.path[-2L] 1107s + ) 1107s [1] TRUE 1107s > detach("package:unitizerdummypkg2") 1107s > untz.glob$state() 1107s An object of class "unitizerGlobalIndices" 1107s Slot "search.path": 1107s [1] 7 1107s 1107s Slot "options": 1107s [1] 1 1107s 1107s Slot "working.directory": 1107s [1] 1 1107s 1107s Slot "random.seed": 1107s [1] 1 1107s 1107s Slot "namespaces": 1107s [1] 3 1107s 1107s > curr.sp.ind <- untz.glob$indices.last@search.path 1107s > identical( 1107s + untz.glob$tracking@search.path[[curr.sp.ind]]$search.path, 1107s + untz.glob$tracking@search.path[[curr.sp.ind - 1L]]$search.path[-5L] 1107s + ) 1107s [1] TRUE 1107s > 1107s > # - "Resetting search path" ---------------------------------------------------- 1107s > 1107s > identical( 1107s + as.list(as.environment("unitizer.dummy.list")), unitizer.dummy.list.2 1107s + ) 1107s [1] TRUE 1107s > # set to just after we added the original dummy list 1107s > untz.glob$reset(search.ref) 1107s An object of class "unitizerGlobalIndices" 1107s Slot "search.path": 1107s [1] 4 1107s 1107s Slot "options": 1107s [1] 1 1107s 1107s Slot "working.directory": 1107s [1] 1 1107s 1107s Slot "random.seed": 1107s [1] 1 1107s 1107s Slot "namespaces": 1107s [1] 3 1107s 1107s > identical(as.list(as.environment("unitizer.dummy.list")), unitizer.dummy.list) 1107s [1] TRUE 1107s > # Confirm we actually set to expected path 1107s > # NOTE: not sure if with updates this can work 1107s > all.equal( 1107s + names(unitizer:::search_as_envs()$search.path), 1107s + names(untz.glob$tracking@search.path[[search.ref@search.path]]$search.path) 1107s + ) 1107s [1] TRUE 1107s > # Reset to very beginning 1107s > untz.glob$resetFull() 1107s An object of class "unitizerGlobalIndices" 1107s Slot "search.path": 1107s [1] 1 1107s 1107s Slot "options": 1107s [1] 1 1107s 1107s Slot "working.directory": 1107s [1] 1 1107s 1107s Slot "random.seed": 1107s [1] 1 1107s 1107s Slot "namespaces": 1107s [1] 1 1107s 1107s > untz.glob$release() 1107s > # compare with all.equal to make sure we use S4 method 1107s > unitizer:::search_dat_equal(unitizer:::search_as_envs(), search.init) 1107s [1] TRUE 1107s > 1107s > # - "Search Path Trim / Restore" ----------------------------------------------- 1107s > 1107s > search.init <- unitizer:::search_as_envs() 1107s > untz.glob <- unitizer:::unitizerGlobal$new(enable.which = state.set, 1107s + set.global = TRUE) 1107s > library(unitizerdummypkg1, lib.loc = TMP.LIB) 1107s > library(unitizerdummypkg2, lib.loc = TMP.LIB) 1107s > unitizer:::search_path_trim(global = untz.glob) 1107s > untz.glob$state() 1107s An object of class "unitizerGlobalIndices" 1107s Slot "search.path": 1107s [1] 2 1107s 1107s Slot "options": 1107s [1] 1 1107s 1107s Slot "working.directory": 1107s [1] 1 1107s 1107s Slot "random.seed": 1107s [1] 1 1107s 1107s Slot "namespaces": 1107s [1] 2 1107s 1107s > sp.keep <- unitizer:::keep_sp_default() 1107s > identical( 1107s + search(), 1107s + sp.keep[match(names(search.init$search.path), sp.keep, nomatch = 0L)] 1107s + ) 1107s [1] TRUE 1107s > untz.glob$resetFull() 1107s An object of class "unitizerGlobalIndices" 1107s Slot "search.path": 1107s [1] 1 1107s 1107s Slot "options": 1107s [1] 1 1107s 1107s Slot "working.directory": 1107s [1] 1 1107s 1107s Slot "random.seed": 1107s [1] 1 1107s 1107s Slot "namespaces": 1107s [1] 1 1107s 1107s > untz.glob$release() 1107s > unitizer:::search_dat_equal(unitizer:::search_as_envs(), search.init) 1107s [1] TRUE 1107s > try(detach("package:unitizerdummypkg1", unload = TRUE), silent = TRUE) 1107s > try(detach("package:unitizerdummypkg2", unload = TRUE), silent = TRUE) 1107s > while ("unitizer.dummy.list" %in% search()) try(detach("unitizer.dummy.list")) 1107s > 1107s > # - "Loaded Namespaces don't cause issues" ------------------------------------- 1107s > 1107s > # had a problem earlier trying to re-attach namespaces 1107s > loadNamespace("unitizerdummypkg1", lib.loc = TMP.LIB) 1107s 1107s > untz.glob <- unitizer:::unitizerGlobal$new(enable.which = state.set, 1107s + set.global = TRUE) 1107s > unitizer:::search_path_trim(global = untz.glob) 1107s > unitizer:::namespace_trim(global = untz.glob) 1107s > untz.glob$state() 1107s An object of class "unitizerGlobalIndices" 1107s Slot "search.path": 1107s [1] 2 1107s 1107s Slot "options": 1107s [1] 1 1107s 1107s Slot "working.directory": 1107s [1] 1 1107s 1107s Slot "random.seed": 1107s [1] 1 1107s 1107s Slot "namespaces": 1107s [1] 2 1107s 1107s > loadNamespace("unitizerdummypkg2", lib.loc = TMP.LIB) 1107s 1107s > untz.glob$state() 1107s An object of class "unitizerGlobalIndices" 1107s Slot "search.path": 1107s [1] 3 1107s 1107s Slot "options": 1107s [1] 1 1107s 1107s Slot "working.directory": 1107s [1] 1 1107s 1107s Slot "random.seed": 1107s [1] 1 1107s 1107s Slot "namespaces": 1107s [1] 3 1107s 1107s > "unitizerdummypkg1" %in% loadedNamespaces() # FALSE 1107s [1] FALSE 1107s > "unitizerdummypkg2" %in% loadedNamespaces() 1107s [1] TRUE 1107s > untz.glob$resetFull() 1107s An object of class "unitizerGlobalIndices" 1107s Slot "search.path": 1107s [1] 1 1107s 1107s Slot "options": 1107s [1] 1 1107s 1107s Slot "working.directory": 1107s [1] 1 1107s 1107s Slot "random.seed": 1107s [1] 1 1107s 1107s Slot "namespaces": 1107s [1] 1 1107s 1107s > untz.glob$release() 1107s > "unitizerdummypkg1" %in% loadedNamespaces() 1107s [1] TRUE 1107s > "unitizerdummypkg2" %in% loadedNamespaces() # FALSE 1107s [1] FALSE 1107s > unloadNamespace("unitizerdummypkg1") 1107s > 1107s > # - "Prevent Namespace Unload Works" ------------------------------------------- 1107s > 1107s > old.opt <- options(unitizer.namespace.keep = "unitizerdummypkg1") 1107s > loadNamespace("unitizerdummypkg1", lib.loc = TMP.LIB) 1107s 1107s > glb <- unitizer:::unitizerGlobal$new(set.global = TRUE) 1107s > glb$status@options <- 2L 1107s > unitizer:::unload_namespaces("unitizerdummypkg1", global = glb) 1107s NULL 1107s > glb$ns.opt.conflict@conflict 1107s [1] TRUE 1107s > glb$ns.opt.conflict@namespaces 1107s [1] "unitizerdummypkg1" 1107s > unloadNamespace("unitizerdummypkg1") 1107s > options(old.opt) 1107s > glb$release() 1107s > 1107s > # - "Generate unique names" ---------------------------------------------------- 1107s > 1107s > unitizer:::unitizerUniqueNames(list(search.path = c(goodbye = "0", 1107s + hello = "1", goodbye = "2", goodbye = "3"))) 1107s [1] "goodbye" "hello" "goodbye.1" "goodbye.2" 1107s > 1107s > # - "Fake Package Re-attach" --------------------------------------------------- 1107s > 1107s > # Make sure that aspects of search path management other than search path 1107s > # survive a failure caused by bad search path env (#252, #253). 1107s > 1107s > owd <- getwd() 1107s > test.f <- paste0(tempfile(), ".R") 1107s > writeLines(" 1107s + f <- tempfile() 1107s + dir.create(f) 1107s + setwd(f) 1107s + # Package assumed non-existing; R could disallow this in the future 1107s + # which could change the test. 1107s + attach(list(x=42), name='package:adfaadcxuqyojfnkfadsf') 1107s + 1 + 1", test.f) 1107s > out <- unitizer:::capture_output( 1107s + try(unitize(test.f, state='recommended', interactive.mode=FALSE)) 1107s + ) 1108s > any(grepl("mismatch between actual search path and tracked", out$message)) 1108s [1] TRUE 1108s > identical(owd, getwd()) # confirm working directory restored 1108s [1] TRUE 1108s > 1108s > 1108s PASS 1108s Begin testing t-section.R 1108s 1108s R version 4.3.2 (2023-10-31) -- "Eye Holes" 1108s Copyright (C) 2023 The R Foundation for Statistical Computing 1108s Platform: x86_64-pc-linux-gnu (64-bit) 1108s 1108s R is free software and comes with ABSOLUTELY NO WARRANTY. 1108s You are welcome to redistribute it under certain conditions. 1108s Type 'license()' or 'licence()' for distribution details. 1108s 1108s R is a collaborative project with many contributors. 1108s Type 'contributors()' for more information and 1108s 'citation()' on how to cite R or R packages in publications. 1108s 1108s Type 'demo()' for some demos, 'help()' for on-line help, or 1108s 'help.start()' for an HTML browser interface to help. 1108s Type 'q()' to quit R. 1108s 1108s > source(file.path("_helper", "init.R")) 1108s > 1108s > expr.1 <- expression(1 + 1, b <- 5, matrix(integer(), nrow = b, 1108s + ncol = b)) 1108s > expr.2 <- { 1108s + 1 + 1 1108s + b <- 5 1108s + matrix(integer(), nrow = b, ncol = b) 1108s + } 1108s > expr.3 <- quote(expression(1 + 1, b <- 5, matrix(integer(), nrow = b, 1108s + ncol = b))) 1108s > expr.4 <- quote({ 1108s + 1 + 1 1108s + b <- 5 1108s + matrix(integer(), nrow = b, ncol = b) 1108s + }) 1108s > # - "simple tests" ------------------------------------------------------------- 1108s > 1108s > try(unitizer_sect(1:3)) 1108s Error in unitizer_sect(1:3) : 1108s Argument `title` must be a 1 length character vector. 1108s > try(unitizer_sect(letters)) 1108s Error in unitizer_sect(letters) : 1108s Argument `title` must be a 1 length character vector. 1108s > try(unitizer_sect("mytest", expr.1, 1:3)) 1108s Error in unitizer_sect("mytest", expr.1, 1:3) : 1108s Argument `details` must be character 1108s > # note the following two produce error messages, but it's not actually an error, 1108s > # it's just that there are multiple errors and `expect_error` only suppresses 1108s > # the last one, not the preceding ones. 1108s > try(unitizer_sect("mytest", expr.1, letters, letters)) 1108s Error in unitizer_sect("mytest", expr.1, letters, letters) : 1108s Argument `compare` must be "testFuns" or a function 1108s > try(unitizer_sect("mytest", expr.1, letters, identity)) 1108s Error in unitizer_sect("mytest", expr.1, letters, identity) : 1108s Argument `compare`, if a function, must accept two arguments and require no more than two (does not have at least two arguments) 1108s > try(unitizer_sect("mytest", expr.2)) 1108s Error in unitizer_sect("mytest", expr.2) : 1108s Argument `expr` must be an expression, or an unevaluated call that evaluates to an expression or `{`. 1108s > try(unitizer_sect("mytest", matrix(1:9, nrow = 3))) 1108s Error in unitizer_sect("mytest", matrix(1:9, nrow = 3)) : 1108s Argument `expr` must be an expression, or an unevaluated call that evaluates to an expression or `{`. 1108s > is(sect.1 <- unitizer_sect("mytest", expr.1), "unitizerSectionExpression") 1108s [1] TRUE 1108s > identical(unitizer:::as.expression(sect.1), expr.1) 1108s [1] TRUE 1108s > 1108s > is(sect.2 <- unitizer_sect("mytest", { 1108s + 1 + 1 1108s + b <- 5 1108s + matrix(integer(), nrow = b, ncol = b) 1108s + }), "unitizerSectionExpression") 1108s [1] TRUE 1108s > identical(sect.1, sect.2) 1108s [1] TRUE 1108s > is(sect.3 <- unitizer_sect("mytest", expr.3), "unitizerSectionExpression") 1108s [1] TRUE 1108s > identical(sect.1, sect.3) 1108s [1] TRUE 1108s > is(sect.4 <- unitizer_sect("mytest", expr.4), "unitizerSectionExpression") 1108s [1] TRUE 1108s > identical(sect.1, sect.4) 1108s [1] TRUE 1108s > is(sect.5 <- unitizer_sect("mytest", expression(1 + 1, 1108s + b <- 5, matrix(integer(), nrow = b, ncol = b))), "unitizerSectionExpression") 1108s [1] TRUE 1108s > identical(sect.1, sect.5) 1108s [1] TRUE 1108s > is(sect.1 <- unitizer_sect("mytest", expr.1, compare = identical), 1108s + "unitizerSectionExpression") 1108s [1] TRUE 1108s > unitizer_sect("hello") # warn 1108s Warning in unitizer_sect("hello") : `unitizer_sect` "hello" is empty. 1108s NULL 1108s > 1108s > # - "Custom Comparison Functions" ---------------------------------------------- 1108s > 1108s > # Run expressions with different comparison functions 1108s > set.seed(1) 1108s > expr.1 <- expression(50 + runif(1)/10^10, message("Hello There", 1108s + runif(1)), cat("Hello there", runif(1)), stop("Yo", runif(1))) 1108s > expr.2 <- expression(50 + runif(1)/10^10, message("Hello There", 1108s + runif(1)), cat("Hello there", runif(1)), stop("Yo", runif(1))) 1108s > expr.3 <- expression(unitizer_sect("change comp funs", compare = identical, 1108s + { 1108s + 50 + runif(1)/10^10 1108s + message("Hello There", runif(1)) 1108s + cat("Hello there", runif(1)) 1108s + stop("Yo", runif(1)) 1108s + })) 1108s > expr.4 <- expression( 1108s + unitizer_sect( 1108s + "change comp funs", 1108s + compare = testFuns( 1108s + value = identical, output = all.equal, message = all.equal, 1108s + conditions = function(x, y) TRUE), 1108s + { 1108s + 50 + runif(1)/10^10 1108s + message("Hello There", runif(1)) 1108s + cat("Hello there", runif(1)) 1108s + stop("Yo", runif(1)) 1108s + })) 1108s > my.unitizer <- new("unitizer", id = 1, zero.env = new.env()) 1108s > coi(my.unitizer <- my.unitizer + expr.1) 1109s > my.unitizer2 <- new("unitizer", id = 2, zero.env = new.env()) 1109s > # make previous items into reference items 1109s > coi(my.unitizer2 <- my.unitizer2 + my.unitizer@items.new) 1109s > # now add back items to compare 1109s > coi(my.unitizer2 <- my.unitizer2 + expr.2) 1109s > my.unitizer3 <- new("unitizer", id = 3, zero.env = new.env()) 1109s > # make previous items into reference items 1109s > coi(my.unitizer3 <- my.unitizer3 + my.unitizer@items.new) 1109s > # now add back items to compare 1109s > coi(my.unitizer3 <- my.unitizer3 + expr.3) 1109s > my.unitizer4 <- new("unitizer", id = 4, zero.env = new.env()) 1109s > # make previous items into reference items 1109s > coi(my.unitizer4 <- my.unitizer4 + my.unitizer@items.new) 1109s > # now add back items to compare 1109s > coi(my.unitizer4 <- my.unitizer4 + expr.4) 1109s > 1109s > my.unitizer2@tests.result 1109s value conditions output message aborted 1109s [1,] TRUE TRUE TRUE TRUE TRUE 1109s [2,] TRUE FALSE TRUE TRUE TRUE 1109s [3,] TRUE TRUE TRUE TRUE TRUE 1109s [4,] TRUE FALSE TRUE TRUE TRUE 1109s > my.unitizer3@tests.result 1109s value conditions output message aborted 1109s [1,] FALSE TRUE TRUE TRUE TRUE 1109s [2,] TRUE FALSE TRUE TRUE TRUE 1109s [3,] TRUE TRUE TRUE TRUE TRUE 1109s [4,] TRUE FALSE TRUE TRUE TRUE 1109s > my.unitizer4@tests.result 1109s value conditions output message aborted 1109s [1,] FALSE TRUE TRUE TRUE TRUE 1109s [2,] TRUE TRUE TRUE FALSE TRUE 1109s [3,] TRUE TRUE FALSE TRUE TRUE 1109s [4,] TRUE TRUE TRUE FALSE TRUE 1109s > 1109s > 1109s PASS 1109s Begin testing t-shim.R 1109s 1109s R version 4.3.2 (2023-10-31) -- "Eye Holes" 1109s Copyright (C) 2023 The R Foundation for Statistical Computing 1109s Platform: x86_64-pc-linux-gnu (64-bit) 1109s 1109s R is free software and comes with ABSOLUTELY NO WARRANTY. 1109s You are welcome to redistribute it under certain conditions. 1109s Type 'license()' or 'licence()' for distribution details. 1109s 1109s R is a collaborative project with many contributors. 1109s Type 'contributors()' for more information and 1109s 'citation()' on how to cite R or R packages in publications. 1109s 1109s Type 'demo()' for some demos, 'help()' for on-line help, or 1109s 'help.start()' for an HTML browser interface to help. 1109s Type 'q()' to quit R. 1109s 1109s > source(file.path("aammrtf", "mock.R")) 1109s > source(file.path("_helper", "init.R")) 1109s > source(file.path("_helper", "pkgs.R")) 1109s Install Packages 1112s Setup Demos 1112s > 1112s > old.state <- tracingState(TRUE) 1112s > 1112s > # - "trace_at_end" ------------------------------------------------------------- 1112s > 1112s > if (is(unitizer:::trace_test_fun, "functionWithTrace")) 1112s + untrace("trace_test_fun", where = asNamespace("unitizer")) 1112s > unitizer:::trace_at_end("trace_test_fun", quote(if (!inherits(.res, 1112s + "try-error")) cat(sprintf("x: %d\n", .res$value))), print = FALSE, 1112s + where = asNamespace("unitizer")) 1112s Tracing function "trace_test_fun" in package "namespace:unitizer" 1112s > coi(unitizer:::trace_test_fun()) 1112s > tracingState(FALSE) 1112s [1] TRUE 1112s > identical(capture.output(unitizer:::trace_test_fun()), character()) 1112s [1] TRUE 1112s > tracingState(TRUE) 1112s [1] FALSE 1112s > 1112s > err <- try(unitizer:::trace_test_fun(stop("hello")), silent = TRUE) 1112s > cond <- attr(err, "condition") 1112s > conditionMessage(cond) 1112s [1] "hello" 1112s > conditionCall(cond) 1112s unitizer:::trace_test_fun(stop("hello")) 1112s > # return/missing etc. corner cases 1112s > f <- function(x, y, z = 5) { 1112s + if (missing(x)) { 1112s + return(TRUE) 1112s + } 1112s + else if (z > 5) { 1112s + stop("OMG, z > 5") 1112s + } 1112s + else if (identical(substitute(y), "hey")) { 1112s + "substitute!" 1112s + } 1112s + else FALSE 1112s + } 1112s > unitizer:::trace_at_end("f", quote(cat("hello\n")), FALSE, environment()) 1112s > res <- f() 1112s hello 1112s > res 1112s [1] TRUE 1112s > res2 <- f(1) 1112s hello 1112s > res2 # FALSE 1112s [1] FALSE 1112s > err <- try(f(1, z = 6), silent = TRUE) 1112s hello 1112s > is(err, "try-error") 1112s [1] TRUE 1112s > attr(err, "condition") 1112s 5> 1112s > res3 <- f(1, y = "hey") 1112s hello 1112s > res3 1112s [1] "substitute!" 1112s > 1112s > # - "Parent Env Stays on Top" -------------------------------------------------- 1112s > 1112s > try(detach("package:unitizerdummypkg1", unload = TRUE), silent = TRUE) 1112s > while ("unitizer.dummy.list" %in% search()) try(detach("unitizer.dummy.list")) 1112s > unitizer.dummy.list <- list(z = 23, x = 1, y = "hello") 1112s > my.env <- new.env() 1112s > state.set <- c(search.path = 2L) 1112s > # make sure to unset this at end 1112s > untz.glob <- unitizer:::unitizerGlobal$new(par.env = my.env, 1112s + enable.which = state.set, set.global = TRUE) 1112s > untz.glob$shimFuns() 1112s [1] TRUE 1112s > sp <- search() 1112s > curr2 <- sp[[2L]] 1112s > 1112s > 1112s > identical(environmentName(parent.env(my.env)), curr2) 1112s [1] TRUE 1112s > library("unitizerdummypkg1", lib.loc = TMP.LIB) 1112s > identical(environmentName(parent.env(my.env)), "package:unitizerdummypkg1") 1112s [1] TRUE 1112s > attach(unitizer.dummy.list) 1112s > identical(environmentName(parent.env(my.env)), "unitizer.dummy.list") 1112s [1] TRUE 1112s > detach("unitizer.dummy.list") 1112s > identical(environmentName(parent.env(my.env)), "package:unitizerdummypkg1") 1112s [1] TRUE 1112s > detach("package:unitizerdummypkg1", unload = TRUE) 1112s > identical(environmentName(parent.env(my.env)), curr2) 1112s [1] TRUE 1112s > untz.glob$checkShims() 1112s [1] TRUE 1112s > 1112s > # - "Parent env tracking with search path manip" ------------------------------- 1112s > 1112s > untz.glob$state() 1112s An object of class "unitizerGlobalIndices" 1112s Slot "search.path": 1112s [1] 1 1112s 1112s Slot "options": 1112s [1] 0 1112s 1112s Slot "working.directory": 1112s [1] 0 1112s 1112s Slot "random.seed": 1112s [1] 0 1112s 1112s Slot "namespaces": 1112s [1] 0 1112s 1112s > keep.more <- c(getOption("unitizer.search.path.keep.base")) 1112s > unitizer:::search_path_trim(keep.more, global = untz.glob) 1112s > untz.glob$state() 1112s An object of class "unitizerGlobalIndices" 1112s Slot "search.path": 1112s [1] 1 1112s 1112s Slot "options": 1112s [1] 0 1112s 1112s Slot "working.directory": 1112s [1] 0 1112s 1112s Slot "random.seed": 1112s [1] 0 1112s 1112s Slot "namespaces": 1112s [1] 0 1112s 1112s > identical(environmentName(parent.env(my.env)), search()[[2L]]) 1112s [1] TRUE 1112s > untz.glob$resetFull() 1112s An object of class "unitizerGlobalIndices" 1112s Slot "search.path": 1112s [1] 1 1112s 1112s Slot "options": 1112s [1] 1 1112s 1112s Slot "working.directory": 1112s [1] 1 1112s 1112s Slot "random.seed": 1112s [1] 1 1112s 1112s Slot "namespaces": 1112s [1] 1 1112s 1112s > identical(environmentName(parent.env(my.env)), curr2) 1112s [1] TRUE 1112s > 1112s > # - "Disable Unshims, etc." ---------------------------------------------------- 1112s > 1112s > untz.glob$unshimFuns() 1112s [1] TRUE 1112s > !any(vapply(list(library, detach, attach), inherits, logical(1L), 1112s + "functionWithTrace")) 1112s [1] TRUE 1112s > untz.glob$release() 1112s > 1112s > # - "Checks, errors, etc." ----------------------------------------------------- 1112s > 1112s > # make sure to unset this at end 1112s > untz.glob <- unitizer:::unitizerGlobal$new(par.env = my.env, 1112s + enable.which = state.set, set.global = TRUE) 1112s > tracingState(FALSE) 1112s [1] TRUE 1112s > untz.glob$shimFuns() # warning 1112s Warning in untz.glob$shimFuns() : 1112s Unable to shim required functions to run with `par.env=NULL` because tracing state is FALSE. Setting `par.env=.GlobalEnv`. 1112s [1] FALSE 1112s > parent.env(my.env) 1112s 1112s > tracingState(TRUE) 1112s [1] FALSE 1112s > untz.glob$release() 1112s > untz.glob <- unitizer:::unitizerGlobal$new(par.env = my.env, 1112s + set.global = TRUE) 1112s > trace("library", quote(cat("I am traced\n")), where = .BaseNamespaceEnv) 1112s Tracing function "library" in package "namespace:base" 1112s [1] "library" 1112s > lib.trace <- library 1112s > untz.glob$shimFuns() # warning 1112s Warning in untz.glob$shimFuns() : 1112s Unable to shim required functions to run with `par.env=NULL` because they are already traced. Setting `par.env=.GlobalEnv`. 1112s [1] FALSE 1112s > parent.env(my.env) 1112s 1112s > inherits(attach, "functionWithTrace") # FALSE 1112s [1] FALSE 1112s > inherits(detach, "functionWithTrace") # FALSE 1112s [1] FALSE 1112s > inherits(library, "functionWithTrace") 1112s [1] TRUE 1112s > identical(lib.trace, library) 1112s [1] TRUE 1112s > untrace("library", where = .BaseNamespaceEnv) 1112s Untracing function "library" in package "namespace:base" 1112s > untz.glob$release() 1112s > untz.glob <- unitizer:::unitizerGlobal$new(par.env = my.env, 1112s + set.global = TRUE) 1112s > untz.glob$shimFuns() 1112s [1] TRUE 1112s > trace("attach", quote(cat("I am traced\n")), where = .BaseNamespaceEnv) 1112s Tracing function "attach" in package "namespace:base" 1112s [1] "attach" 1112s > attach.trace <- attach 1112s > untz.glob$checkShims() # warning 1112s Warning in untz.glob$checkShims() : 1112s Traced functions unexpectedly changed, disabling clean parent env 1112s Warning in unshimFuns() : 1112s `attach` was not untraced because they were modified by something other than unitizer. 1112s `FALSE`, `TRUE`, and `FALSE` were not untraced for unknown reasons; please report to maintainer. 1112s 1112s you should consider manually untracing the function, or restarting your R session to restore function to original value. 1112s [1] FALSE 1112s > parent.env(my.env) 1112s 1112s > inherits(detach, "functionWithTrace") # FALSE 1112s [1] FALSE 1112s > inherits(library, "functionWithTrace") # FALSE 1112s [1] FALSE 1112s > inherits(attach, "functionWithTrace") 1112s [1] TRUE 1112s > identical(attach.trace, attach) 1112s [1] TRUE 1112s > untrace("attach", where = .BaseNamespaceEnv) 1112s Untracing function "attach" in package "namespace:base" 1112s > untz.glob$release() 1112s > untz.glob <- unitizer:::unitizerGlobal$new(par.env = my.env, 1112s + set.global = TRUE) 1112s > untz.glob$shimFuns() 1112s [1] TRUE 1112s > tracingState(FALSE) 1112s [1] TRUE 1112s > untz.glob$checkShims() # warning 1112s Warning in untz.glob$checkShims() : 1112s Tracing state off, so disabling clean parent env 1112s [1] FALSE 1112s > parent.env(my.env) 1112s 1112s > tracingState(TRUE) 1112s [1] FALSE 1112s > inherits(detach, "functionWithTrace") # FALSE 1112s [1] FALSE 1112s > inherits(library, "functionWithTrace") # FALSE 1112s [1] FALSE 1112s > inherits(attach, "functionWithTrace") # FALSE 1112s [1] FALSE 1112s > # try tracing some stuff that shouldn't be 1112s > untz.glob$shimFuns("baljevzxhjLsdc") # Warning 1112s Warning in untz.glob$shimFuns("baljevzxhjLsdc") : 1112s Unable to shim required functions to run with `par.env=NULL` because some cannot be found. Setting `par.env=.GlobalEnv`. 1112s [1] FALSE 1112s > # test unexpected message or behavior from `trace_at_end` 1112s > try(untz.glob$shimFun("sum")) 1112s Error in untz.glob$shimFun("sum") : Internal Error: missing shim data 1112s > 1112s > mock(unitizer:::trace_at_end, quote(stop("trace_at_end fail"))) 1112s > any( 1112s + grepl( 1112s + "trace_at_end fail", 1112s + capture.output( 1112s + trace.fail <- untz.glob$shimFun("library"), type = "message" 1112s + ), 1112s + fixed = TRUE 1112s + ) 1112s + ) 1112s [1] TRUE 1112s > unmock(unitizer:::trace_at_end) 1112s > 1112s > trace.fail # FALSE 1112s [1] FALSE 1112s > mock(unitizer:::trace_at_end, quote(message("random message"))) 1112s > untz.glob$shimFun("library") 1112s random message 1112s Warning in untz.glob$shimFun("library") : 1112s Function `library` was not traced even though tracing attempt did not produce errors. 1112s [1] FALSE 1112s > unmock(unitizer:::trace_at_end) 1112s > 1112s > mock(unitizer:::trace_at_end, quote(TRUE)) 1112s > dont.trace <- untz.glob$shimFun("library") # Warning "not traced" 1112s Warning in untz.glob$shimFun("library") : 1112s Function `library` was not traced even though tracing attempt did not produce errors. 1112s > unmock(unitizer:::trace_at_end) 1112s > 1112s > dont.trace # FALSE 1112s [1] FALSE 1112s > untz.glob$release() 1112s > # untrace condition 1112s > untz.glob <- unitizer:::unitizerGlobal$new(par.env = my.env, set.global = TRUE) 1112s > untz.glob$shimFuns() 1112s [1] TRUE 1112s > 1112s > mock( 1112s + unitizer:::untrace_utz, 1112s + quote({ 1112s + message("untrace dummy") 1112s + base::untrace(what = what, signature = signature, where = where) 1112s + }) 1112s + ) 1112s > untz.glob$unshimFuns() # message untrace dummy 1112s untrace dummy 1112s untrace dummy 1112s untrace dummy 1112s [1] TRUE 1112s > unmock(unitizer:::untrace_utz) 1112s > untz.glob$release() 1112s > 1112s > try(detach("package:unitizerdummypkg1", unload = TRUE), silent = TRUE) 1112s > 1112s > while ("unitizer.dummy.list" %in% search()) try(detach("unitizer.dummy.list")) 1112s > 1112s > # - "find_returns" ------------------------------------------------------------- 1112s > 1112s > fun <- function() { 1112s + if (TRUE) 1112s + return(1) 1112s + else { 1112s + { 1112s + 2 + 2 1112s + identity(c(1, 2, return(3), { 1112s + list(1, 2, 5) 1112s + return(return(4)) 1112s + })) 1112s + return(5) 1112s + } 1112s + return(6) 1112s + } 1112s + if (TRUE) 1112s + return(7) 1112s + else return(8) 1112s + return(9) 1112s + return(10) 1112s + } 1112s > ret.loc <- unitizer:::find_returns(fun) 1112s > ret.loc 1112s [[1]] 1112s [1] 2 3 1112s 1112s [[2]] 1112s [1] 2 4 2 3 2 4 1112s 1112s [[3]] 1112s [1] 2 4 2 3 2 5 3 1112s 1112s [[4]] 1112s [1] 2 4 2 4 1112s 1112s [[5]] 1112s [1] 2 4 3 1112s 1112s [[6]] 1112s [1] 3 3 1112s 1112s [[7]] 1112s [1] 3 4 1112s 1112s [[8]] 1112s [1] 4 1112s 1112s [[9]] 1112s [1] 5 1112s 1112s > 1112s > # Validate visually that this worked 1112s > 1112s > all(vapply(unitizer:::get_returns(fun, ret.loc), function(x) x[[1L]] == 1112s + quote(return), logical(1L))) 1112s [1] TRUE 1112s > 1112s > 1112s PASS 1112s Begin testing t-state.R 1112s 1112s R version 4.3.2 (2023-10-31) -- "Eye Holes" 1112s Copyright (C) 2023 The R Foundation for Statistical Computing 1112s Platform: x86_64-pc-linux-gnu (64-bit) 1112s 1112s R is free software and comes with ABSOLUTELY NO WARRANTY. 1112s You are welcome to redistribute it under certain conditions. 1112s Type 'license()' or 'licence()' for distribution details. 1112s 1112s R is a collaborative project with many contributors. 1112s Type 'contributors()' for more information and 1112s 'citation()' on how to cite R or R packages in publications. 1112s 1112s Type 'demo()' for some demos, 'help()' for on-line help, or 1112s 'help.start()' for an HTML browser interface to help. 1112s Type 'q()' to quit R. 1112s 1113s > source(file.path("_helper", "init.R")) 1113s > 1113s > options(unitizer.color = FALSE, width = 80L) 1113s > 1113s > # - "Random Seed" -------------------------------------------------------------- 1113s > 1113s > old.seed <- if (!exists(".Random.seed")) NULL else .Random.seed 1113s > seed.dat <- getOption("unitizer.seed") 1113s > 1113s > suppressWarnings( 1113s + untz.glob <- 1113s + unitizer:::unitizerGlobal$new(enable.which = setNames(2L, "random.seed")) 1113s + ) 1113s > do.call(set.seed, seed.dat) 1113s > new.seed <- .Random.seed 1113s > state <- untz.glob$state() 1113s > invisible(runif(10)) # see if we can reset state after this 1113s > untz.glob$reset(state) 1113s An object of class "unitizerGlobalIndices" 1113s Slot "search.path": 1113s [1] 0 1113s 1113s Slot "options": 1113s [1] 0 1113s 1113s Slot "working.directory": 1113s [1] 0 1113s 1113s Slot "random.seed": 1113s [1] 2 1113s 1113s Slot "namespaces": 1113s [1] 0 1113s 1113s > identical(.Random.seed, new.seed) 1113s [1] TRUE 1113s > untz.glob$resetFull() 1113s An object of class "unitizerGlobalIndices" 1113s Slot "search.path": 1113s [1] 1 1113s 1113s Slot "options": 1113s [1] 1 1113s 1113s Slot "working.directory": 1113s [1] 1 1113s 1113s Slot "random.seed": 1113s [1] 1 1113s 1113s Slot "namespaces": 1113s [1] 1 1113s 1113s > 1113s > if (is.null(old.seed)) { 1113s + !isTRUE(exists(".Random.seed")) 1113s + } else identical(old.seed, .Random.seed) 1113s [1] TRUE 1113s > 1113s > # - "State Show" --------------------------------------------------------------- 1113s > 1113s > show(unitizer:::unitizerStatePristine()) 1113s Settings Values 1113s 1 par.env 1113s 2 search.path 2 1113s 3 options 2 1113s 4 working.directory 2 1113s 5 random.seed 2 1113s 6 namespaces 2 1113s ----- 1113s 0: off 1113s 1: track starting with initial state 1113s 2: track starting with clean state 1113s : use special unitizer environment as 'par.env' 1113s See `?unitizerState` for more details. 1113s > 1113s > # - "all.equal.unitizerDummy" -------------------------------------------------- 1113s > 1113s > dummy <- new("unitizerDummy") 1113s > blah <- "hello" 1113s > ref.txt <- "`.REF` value was not recorded, but `.NEW` value was; they are likely different" 1113s > identical(all.equal(dummy, blah), ref.txt) 1113s [1] TRUE 1113s > all.equal(dummy, dummy) 1113s [1] TRUE 1113s > identical( 1113s + all.equal(blah, dummy), 1113s + "`.NEW` value was not recorded, but `.REF` value was; they are likely different" 1113s + ) 1113s [1] TRUE 1113s > # testing S4 / S3 methods, first works, second doesn't since we can't 1113s > # have an S3 generic with dispatch on 2nd arg 1113s > 1113s > identical( 1113s + evalq(all.equal(new("unitizerDummy"), "hello"), getNamespace("stats")), 1113s + ref.txt 1113s + ) 1113s [1] TRUE 1113s > evalq(all.equal("hello", new("unitizerDummy")), getNamespace("stats")) 1113s [1] "Modes: character, S4" 1113s [2] "Attributes: < target is NULL, current is list >" 1113s [3] "target is character, current is unitizerDummy" 1113s > 1113s > # - "All Equal States" --------------------------------------------------------- 1113s > 1113s > # Doesn't seem like we're comparing these to anything? Maybe should look into 1113s > # doing so? 1113s > 1113s > state.A <- new("unitizerGlobalState", search.path = letters[1:3], 1113s + options = list(a = 5:7, b = new("unitizerDummy"), c = "hello"), 1113s + working.directory = "a/b/c") 1113s > state.B <- new("unitizerGlobalState", search.path = letters[1:3], 1113s + options = list(a = 5:7, b = new("unitizerDummy"), d = "goodbye", 1113s + c = new("unitizerDummy")), working.directory = new("unitizerDummy"), 1113s + random.seed = 1:3) 1113s > state.C <- new("unitizerGlobalState", search.path = letters, 1113s + options = list(a = list(5, 6, 7), c = LETTERS), working.directory = new("unitizerDummy"), 1113s + random.seed = 1:3) 1113s > # just compare to A 1113s > state.D <- new("unitizerGlobalState", search.path = letters[1:3], 1113s + options = list(a = list(1, 2, 3), b = new("unitizerDummy"), 1113s + c = "hello"), working.directory = "a/b/c") 1113s > state.E <- new("unitizerGlobalState", options = setNames(as.list(1:20), 1113s + head(letters, 20))) 1113s > state.F <- new("unitizerGlobalState", options = setNames(as.list(1:20), 1113s + tail(letters, 20))) 1113s > # This one is supposed to return something non-character or TRUE when used 1113s > # with the provided all.equal 1113s > state.G <- new("unitizerGlobalState", options = list(a = structure(TRUE, 1113s + class = "unitizer_glob_state_test"), b = 0)) 1113s > state.H <- new("unitizerGlobalState", options = list(a = structure(FALSE, 1113s + class = "unitizer_glob_state_test"), b = 2)) 1113s > 1113s > # - "as.state" ----------------------------------------------------------------- 1113s > 1113s > identical( 1113s + unitizer:::as.state("recommended"), 1113s + unitizer:::as.state(unitizer:::unitizerStateSuggested()) 1113s + ) 1113s [1] TRUE 1113s > identical( 1113s + unitizer:::as.state("suggested"), 1113s + unitizer:::as.state(unitizer:::unitizerStateSuggested()) 1113s + ) 1113s [1] TRUE 1113s > identical( 1113s + unitizer:::as.state("pristine"), 1113s + unitizer:::as.state(unitizer:::unitizerStatePristine()) 1113s + ) 1113s [1] TRUE 1113s > 1113s > # unitizerStateProcessed should produce the default object (which currently 1113s > # is "off") 1113s > 1113s > all.equal( 1113s + unitizer:::as.state(.GlobalEnv), 1113s + unitizer:::as.state(unitizer:::unitizerStateSuggested(par.env = .GlobalEnv)) 1113s + ) 1113s [1] TRUE 1113s > all.equal( 1113s + unitizer:::as.state(in_pkg("stats")), 1113s + unitizer:::as.state( 1113s + unitizer:::unitizerStateSuggested(par.env = getNamespace("stats")) 1113s + ) ) 1113s [1] TRUE 1113s > 1113s > stats.lib <- file.path(system.file(package = "stats"), "R") 1113s > all.equal( 1113s + unitizer:::as.state(in_pkg(), test.files = stats.lib), 1113s + unitizer:::as.state( 1113s + unitizer:::unitizerStateSuggested(par.env = getNamespace("stats")) 1113s + ) ) 1113s [1] TRUE 1113s > try(unitizer:::as.state(200)) 1113s Error in as.state_raw(x) : 1113s Argument `x` must be character(1L) %in% c("pristine", "recommended", "suggested" 1113s , "basic", "off", "safe"), NULL, an environment, or must inherit from S4 classes 1113s `unitizerStateRaw`, `unitizerStateProcessed` or `unitizerInPkg` in order to be 1113s interpreted as a unitizer state object. 1113s > state <- unitizer:::unitizerStateOff() 1113s > # bypass validity method 1113s > state@options <- 2L 1113s > try(validObject(state)) 1113s Error in validObject(state) : 1113s invalid class "unitizerStateOff" object: Argument `state` is an invalid state: 'options' is set to 2, but 'search.path' and 'namespaces' are not 1113s > # state raw conversions 1113s > identical( 1113s + unitizer:::as.state(unitizer:::unitizerStateRaw()), 1113s + unitizer:::unitizerStateProcessed() 1113s + ) 1113s [1] TRUE 1113s > identical( 1113s + unitizer:::as.state(unitizer:::unitizerStateRaw(par.env = "stats")), 1113s + unitizer:::unitizerStateProcessed(par.env = getNamespace("stats")) 1113s + ) 1113s [1] TRUE 1113s > state@options <- 0L 1113s > state.proc <- unitizer:::as.unitizerStateProcessed(state) 1113s > state.raw <- unitizer:::as.unitizerStateRaw(state.proc) 1113s > is(state.raw, "unitizerStateRaw") 1113s [1] TRUE 1113s > all.equal( 1113s + lapply(slotNames(state), slot, object = state.proc), 1113s + lapply(slotNames(state.raw), slot, object = state.raw) 1113s + ) 1113s [1] TRUE 1113s > try(unitizer:::as.state(unitizer:::unitizerStateRaw(par.env = in_pkg()))) 1113s Error in in_pkg_to_env(x.raw@par.env, test.files) : 1113s Unable to detect package to use namespace of as parent environment; see `? 1113s unitizerState` for how to specify a package namespace explicitly as a parent 1113s environment. 1113s Error in unitizer:::as.state(unitizer:::unitizerStateRaw(par.env = in_pkg())) : 1113s Unable to convert `par.env` value to a namespace environment 1113s > 1113s > identical( 1113s + unitizer:::as.state(unitizer:::unitizerStateRaw(par.env = in_pkg("stats"))), 1113s + unitizer:::unitizerStateProcessed(par.env = getNamespace("stats")) 1113s + ) 1113s [1] TRUE 1113s > try( 1113s + unitizer:::as.state( 1113s + unitizer:::unitizerStateRaw(par.env = in_pkg("asdfalkdfasd")) 1113s + ) ) 1113s Error in loadNamespace(name) : there is no package called 'asdfalkdfasd' 1113s Error in in_pkg_to_env(x.raw@par.env, test.files) : 1113s Unable to load "asdfalkdfasd" namespace to use as parent environment; see 1113s `?unitizerState` for instructions on how to specify a package namespace as a 1113s parent environment for tests. 1113s Error in unitizer:::as.state(unitizer:::unitizerStateRaw(par.env = in_pkg("asdfalkdfasd"))) : 1113s Unable to convert `par.env` value to a namespace environment 1113s > try( 1113s + unitizer:::as.state( 1113s + unitizer:::unitizerStateRaw(par.env = in_pkg("")), test.files = getwd() 1113s + ) ) 1113s Error in in_pkg("") : Argument `package` may not be an empty string 1113s > # impossible states 1113s > state.obj <- unitizer:::unitizerStateRaw() 1113s > state.obj@options <- 2L 1113s > try(unitizer:::as.state(state.obj)) 1113s Error in unitizer:::as.state(state.obj) : 1113s Options state tracking (2) must be less than namespace state tracking (0). 1113s > state.obj@namespaces <- 2L 1113s > state.obj@search.path <- 1L 1113s > try(unitizer:::as.state(state.obj)) 1113s Error in unitizer:::as.state(state.obj) : 1113s Namespace state tracking (2) must be less than or equal to search path state 1113s tracking (1). 1113s > 1113s > # - "as.state_raw" ------------------------------------------------------------- 1113s > 1113s > old.opt.loc <- options(unitizer.state = .GlobalEnv) 1113s > try(unitizer:::as.state_raw(.GlobalEnv)) 1113s Error in unitizer:::as.state_raw(.GlobalEnv) : 1113s 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. 1113s > options(unitizer.state = 42L) 1113s > try(unitizer:::as.state_raw(.GlobalEnv)) 1113s Error in unitizer:::as.state_raw(.GlobalEnv) : 1113s `getOption('unitizer.state')` must be character(1L) %in% c("pristine", "recom- 1113s mended", "suggested", "basic", "off", "safe"), NULL, an environment, or must 1113s inherit from S4 classes `unitizerStateRaw`, `unitizerStateProcessed` or ` 1113s unitizerInPkg` in order to be interpreted as a unitizer state object. 1113s > state.raw <- unitizer:::as.unitizerStateRaw(unitizer:::unitizerStateOff()) 1113s > state.proc <- unitizer:::as.unitizerStateProcessed(state.raw) 1113s > my.env <- new.env() 1113s > options(unitizer.state = state.raw) 1113s > state.raw@par.env <- my.env 1113s > all.equal(unitizer:::as.state_raw(my.env), state.raw) 1113s [1] TRUE 1113s > options(unitizer.state = state.proc) 1113s > my.env <- new.env() 1113s > state.proc@par.env <- my.env 1113s > all.equal( 1113s + unitizer:::as.state_raw(my.env), 1113s + unitizer:::as.unitizerStateRaw(state.proc) 1113s + ) 1113s [1] TRUE 1113s > options(old.opt.loc) 1113s > 1113s > # - "state" -------------------------------------------------------------------- 1113s > 1113s > # all these assume we set the options to be in recommended mode 1113s > 1113s > all.equal(state("stats"), unitizer:::unitizerStateSuggested(par.env = "stats")) 1113s [1] TRUE 1113s > 1113s > all.equal( 1113s + state(in_pkg("stats")), 1113s + unitizer:::unitizerStateSuggested(par.env = in_pkg("stats")) 1113s + ) 1113s [1] TRUE 1113s > all.equal( 1113s + state(in_pkg()), unitizer:::unitizerStateSuggested(par.env = in_pkg()) 1113s + ) 1113s [1] TRUE 1113s > all.equal( 1113s + state(search.path = 1), unitizer:::unitizerStateSuggested(search.path = 1L) 1113s + ) 1113s [1] TRUE 1113s > s1 <- unitizer:::unitizerStateSuggested(par.env = .GlobalEnv) 1113s > for (i in setdiff(slotNames(s1), "par.env")) slot(s1, i) <- 0L 1113s > s2 <- unitizer:::unitizerStateOff() 1113s > all.equal(s1, s2) 1113s [1] TRUE 1113s > # invalid state 1113s > try(state(search.path = 3)) 1113s Error in state(search.path = 3) : 1113s Argument `search.path` must be integer(1L) in 0:2 1113s > try(state(options = 2, namespaces = 1)) 1113s Error in state(options = 2, namespaces = 1) : 1113s Unable to create valid `unitizerStateRaw` object: Argument `state` is an invalid state: 'options' is set to 2, but 'search.path' and 'namespaces' are not 1113s > try(state(namespaces = 2, search.path = 1)) 1113s Error in state(namespaces = 2, search.path = 1) : 1113s Unable to create valid `unitizerStateRaw` object: Argument `state` is an invalid state: 'namespaces' is set to 2, but 'search.path' is not 1113s > state.inv <- unitizer:::unitizerStateProcessed() 1113s > state.inv@options <- 2L 1113s > try(unitizer:::as.state(state.inv)) 1113s Error in unitizer:::as.state(state.inv) : 1113s Options state tracking (2) must be less than namespace state tracking (0). 1113s > state.inv@namespaces <- 2L 1113s > try(unitizer:::as.state(state.inv)) 1113s Error in unitizer:::as.state(state.inv) : 1113s Namespace state tracking (2) must be less than or equal to search path state 1113s tracking (0). 1113s > # captured 1113s > any(grepl("", capture.output(show(state(in_pkg()))))) 1113s [1] TRUE 1113s > any(grepl("", capture.output(show(state(in_pkg("stats")))))) 1113s [1] TRUE 1113s > any(grepl("namespace:stats", capture.output(show(state(asNamespace("stats")))))) 1113s [1] TRUE 1113s > 1113s > # - "in_pkg" ------------------------------------------------------------------- 1113s > 1113s > try(in_pkg("")) 1113s Error in in_pkg("") : Argument `package` may not be an empty string 1113s > identical(as.character(in_pkg()), "") 1113s [1] TRUE 1113s > identical(as.character(in_pkg("stats")), "") 1113s [1] TRUE 1113s > identical(capture.output(show(in_pkg())), "") 1113s [1] TRUE 1113s > try(unitizer:::in_pkg_to_env(in_pkg(), "/")) 1113s Error in unitizer:::in_pkg_to_env(in_pkg(), "/") : 1113s Unable to detect package to use namespace of as parent environment; see `? 1113s unitizerState` for how to specify a package namespace explicitly as a parent 1113s environment. 1113s > 1113s > # - "merge states" ------------------------------------------------------------- 1113s > 1113s > trk.new <- new("unitizerGlobalTrackingStore", search.path = list(1, 1113s + 2, 3), options = list("a", "b")) 1113s > trk.ref <- new("unitizerGlobalTrackingStore", search.path = list(4, 1113s + 5, 6), options = list("c", "d")) 1113s > items <- new("unitizerItems") 1113s > items <- items + new("unitizerItem", call = quote(1 + 1), glob.indices = new("unitizerGlobalIndices", 1113s + search.path = 1L, options = 2L)) 1113s > items <- items + new("unitizerItem", call = quote(2 + 1), glob.indices = new("unitizerGlobalIndices", 1113s + search.path = 2L, options = 1L)) 1113s > items <- items + new("unitizerItem", call = quote(1 * 1), reference = TRUE, 1113s + glob.indices = new("unitizerGlobalIndices", search.path = 1L, 1113s + options = 1L)) 1113s > items <- items + new("unitizerItem", call = quote(2 * 1), reference = TRUE, 1113s + glob.indices = new("unitizerGlobalIndices", search.path = 3L, 1113s + options = 2L)) 1113s > res <- unitizer:::mergeStates(items, trk.new, trk.ref) 1113s > 1113s > sapply(res$items, function(x) as.integer(slot(x, "glob.indices"))) 1113s [,1] [,2] [,3] [,4] 1113s search.path 1 2 4 5 1113s options 2 1 3 4 1113s working.directory 0 0 0 0 1113s random.seed 0 0 0 0 1113s namespaces 0 0 0 0 1113s > s.n.to.check <- c("search.path", "options", "working.directory", 1113s + "random.seed", "namespaces") 1113s > sapply(s.n.to.check, slot, object = res$states) 1113s $search.path 1113s $search.path[[1]] 1113s [1] 1 1113s 1113s $search.path[[2]] 1113s [1] 2 1113s 1113s $search.path[[3]] 1113s [1] 3 1113s 1113s $search.path[[4]] 1113s [1] 4 1113s 1113s $search.path[[5]] 1113s [1] 6 1113s 1113s 1113s $options 1113s $options[[1]] 1113s [1] "a" 1113s 1113s $options[[2]] 1113s [1] "b" 1113s 1113s $options[[3]] 1113s [1] "c" 1113s 1113s $options[[4]] 1113s [1] "d" 1113s 1113s 1113s $working.directory 1113s list() 1113s 1113s $random.seed 1113s list() 1113s 1113s $namespaces 1113s list() 1113s 1113s > # No reference items 1113s > items.no.ref <- items[1:2] 1113s > identical( 1113s + unitizer:::mergeStates(items.no.ref, trk.new, trk.ref), 1113s + list(items = items.no.ref, states = trk.new) 1113s + ) 1113s [1] TRUE 1113s > # No new items; note that we only remap the used states to the new state 1113s > # which is why we need all the .mod objects 1113s > 1113s > items.no.new <- items[3:4] 1113s > items.no.new.mod <- items.no.new 1113s > items.no.new.mod[[2L]]@glob.indices@search.path <- 2L 1113s > trk.ref.mod <- trk.ref 1113s > trk.ref.mod@search.path[[2L]] <- NULL 1113s > 1113s > identical( 1113s + unitizer:::mergeStates( 1113s + items.no.new, new("unitizerGlobalTrackingStore"),trk.ref 1113s + ), 1113s + list(items = items.no.new.mod, states = trk.ref.mod) 1113s + ) 1113s [1] TRUE 1113s > 1113s > 1113s PASS 1113s Begin testing t-text.R 1113s 1113s R version 4.3.2 (2023-10-31) -- "Eye Holes" 1113s Copyright (C) 2023 The R Foundation for Statistical Computing 1113s Platform: x86_64-pc-linux-gnu (64-bit) 1113s 1113s R is free software and comes with ABSOLUTELY NO WARRANTY. 1113s You are welcome to redistribute it under certain conditions. 1113s Type 'license()' or 'licence()' for distribution details. 1113s 1113s R is a collaborative project with many contributors. 1113s Type 'contributors()' for more information and 1113s 'citation()' on how to cite R or R packages in publications. 1113s 1113s Type 'demo()' for some demos, 'help()' for on-line help, or 1113s 'help.start()' for an HTML browser interface to help. 1113s Type 'q()' to quit R. 1113s 1113s > source(file.path("_helper", "init.R")) 1114s > 1114s > # - "cap_first" ---------------------------------------------------------------- 1114s > 1114s > set.seed(1, "Mersenne-Twister") 1114s > words <- replicate(2, paste0(sample(letters, 5), collapse = "")) 1114s > WORDS <- toupper(words) 1114s > 1114s > unitizer:::cap_first(c("", letters[1:2], letters[25:26], words, WORDS)) 1114s [1] "" "A" "B" "Y" "Z" "Gjnue" "Xzpob" "GJNUE" "XZPOB" 1114s > 1114s > unitizer:::decap_first(c("", letters[1:2], letters[25:26], words, WORDS)) 1114s [1] "" "a" "b" "y" "z" "gjnue" "xzpob" "gJNUE" "xZPOB" 1114s > 1114s > # - "header" ------------------------------------------------------------------- 1114s > 1114s > try(unitizer:::header("hello world", letters)) 1114s Error in unitizer:::header("hello world", letters) : 1114s Argument `level` must be 1 length integer-like and in 1:3 1114s > try(unitizer:::header(letters, 1)) 1114s Error in unitizer:::header(letters, 1) : 1114s Argument `x` must be a one length character vector 1114s > 1114s > # - "word_wrap" ---------------------------------------------------------------- 1114s > 1114s > 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?" 1114s > lorem2 <- "/Volumes/FIXED/folder1/folder2/folder.2345/folderabac/file.text.batch" 1114s > lorem3 <- "\"untz.state.test\", \"add.smooth\", \"bitmapType\", \"browser\", \"browserNLdisabled\", \"CBoundsCheck\", \"check.bounds\", \"citation.bibtex.max\", \"continue\", \"contrasts\"" 1114s > range(nchar(head(unitizer:::word_wrap(lorem1, 25L), -1L))) 1114s [1] 18 25 1114s > t.rn <- range(nchar(head(unitizer:::word_wrap(lorem1, 25L, 3L), 1114s + -1L))) 1114s > # for some reason can't get test to produce same thing in windows when 1114s > # running all tests vs. single one at the prompt; the > 20 is a cop-out that 1114s > # should catch both the expected case (23) and what actually happens when 1114s > # you run the tests on windows 1114s > # expect_true(min(t.rn) > 20 && max(t.rn) <= 25) 1114s > min(t.rn) > 20 && max(t.rn) <= 25 1114s [1] TRUE 1114s > 1114s > unitizer:::word_wrap(substr(lorem1, 1, 147), 45L, 3L) 1114s [1] "Today, with Kiernan on the stand offering co-" 1114s [2] "nfirmation, Howard walked the jury through " 1114s [3] "the enormous amount of data pulled from Ulb-" 1114s [4] "richt's computer." 1114s > unitizer:::word_wrap(substr(lorem1, 1, 147), 45L, 3L, FALSE) 1114s [1] "Today, with Kiernan on the stand offering con" 1114s [2] "firmation, Howard walked the jury through the" 1114s [3] "enormous amount of data pulled from Ulbricht'" 1114s [4] "s computer." 1114s > unitizer:::word_wrap(lorem2, 15L, 3L) 1114s [1] "/Volumes/FIXED/" "folder1/fol-" "der2/folder.23-" "45/folderabac/" 1114s [5] "file.text.batch" 1114s > unitizer:::word_wrap(lorem2, 15L, 8L) 1114s [1] "/Volumes/FIXED/" "folder1/" "folder2/folder." "2345/fol-" 1114s [5] "derabac/file." "text.batch" 1114s > 1114s > unitizer:::word_wrap(lorem3, 76L, 8L) 1114s [1] "\"untz.state.test\", \"add.smooth\", \"bitmapType\", \"browser\", \"browserNLdisab-" 1114s [2] "led\", \"CBoundsCheck\", \"check.bounds\", \"citation.bibtex.max\", \"continue\", " 1114s [3] "\"contrasts\"" 1114s > unitizer:::word_wrap("hello sunset \nthere moonrise", width = 12L) 1114s [1] "hello sunset" "there " "moonrise" 1114s > 1114s > 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") 1114s > 1114s > unitizer:::word_wrap(x1, unlist = FALSE, width = 80L) 1114s [[1]] 1114s [1] "this is supposed to be a particularly long string" 1114s [2] "that allows us to test the behavior of bullets once we start seeing" 1114s [3] "some wrapping kicking in which was a problem once upon a time" 1114s 1114s > com <- "# this is supposed to be a relatively long comment that will get re-flowed" 1114s > old.opt <- options(crayon.enabled = FALSE) 1114s > unitizer:::word_comment(com, width = 30L) 1114s [1] "# this is supposed to be a " "#relatively long comment that " 1114s [3] "#will get re-flowed" 1114s > unitizer:::word_wrap(c("\nhello\nthere", "\nhow")) 1114s [1] "" "hello" "there" "" "how" 1114s > # too narrow 1114s > no.wrap <- "hello I won't be wrapped" 1114s > unitizer:::word_wrap(no.wrap, width = 3) # warning 1114s Warning in unitizer:::word_wrap(no.wrap, width = 3) : 1114s Display width too narrow to properly wrap text; setting to 80L 1114s [1] "hello I won't be wrapped" 1114s > options(old.opt) 1114s > 1114s > # - "bullets" ------------------------------------------------------------------ 1114s > 1114s > x <- c("there was once a time when the fantastic unicorns could fly", 1114s + "bugs bunny ate carrots and drank milk while hunting ducks") 1114s > xx <- unitizer:::UL(x) 1114s > 1114s > as.character(xx, width = 30L) 1114s [1] "- there was once a time when " " the fantastic unicorns could" 1114s [3] " fly" "- bugs bunny ate carrots and " 1114s [5] " drank milk while hunting " " ducks" 1114s > print(xx, width = 80L) 1114s - there was once a time when the fantastic unicorns could fly 1114s - bugs bunny ate carrots and drank milk while hunting ducks 1114s > yy <- unitizer:::OL(x) 1114s > as.character(yy, width = 30L) 1114s [1] "1. there was once a time when " " the fantastic unicorns " 1114s [3] " could fly" "2. bugs bunny ate carrots and " 1114s [5] " drank milk while hunting " " ducks" 1114s > # hopefully always C locale collation in tests? 1114s > sort(as.character(unitizer:::OL(rep(letters, 2), style = "LETTERS"))) 1114s [1] " A. a" " B. b" " C. c" " D. d" " E. e" " F. f" " G. g" " H. h" " I. i" 1114s [10] " J. j" " K. k" " L. l" " M. m" " N. n" " O. o" " P. p" " Q. q" " R. r" 1114s [19] " S. s" " T. t" " U. u" " V. v" " W. w" " X. x" " Y. y" " Z. z" "AA. a" 1114s [28] "AB. b" "AC. c" "AD. d" "AE. e" "AF. f" "AG. g" "AH. h" "AI. i" "AJ. j" 1114s [37] "AK. k" "AL. l" "AM. m" "AN. n" "AO. o" "AP. p" "AQ. q" "AR. r" "AS. s" 1114s [46] "AT. t" "AU. u" "AV. v" "AW. w" "AX. x" "AY. y" "AZ. z" 1114s > xl <- as.list(x) 1114s > y <- unitizer:::UL(c(xl, list(unitizer:::OL(c(xl, list(unitizer:::UL(x))))), 1114s + "yowza it is raining toads today!")) 1114s > as.character(y, width = 30) 1114s [1] "- there was once a time when " " the fantastic unicorns could" 1114s [3] " fly" "- bugs bunny ate carrots and " 1114s [5] " drank milk while hunting " " ducks" 1114s [7] " 1. there was once a time " " when the fantastic " 1114s [9] " unicorns could fly" " 2. bugs bunny ate carrots " 1114s [11] " and drank milk while " " hunting ducks" 1114s [13] " - there was once a time " " when the fantastic " 1114s [15] " unicorns could fly" " - bugs bunny ate carrots " 1114s [17] " and drank milk while " " hunting ducks" 1114s [19] "- yowza it is raining toads " " today!" 1114s > try(unitizer:::as.character.bullet(hello, 1:10)) 1114s Error in unitizer:::as.character.bullet(hello, 1:10) : 1114s Argument `width` must be a one length positive numeric. 1114s > # Extra args to word_wrap 1114s > try(as.character(unitizer:::OL(c("hello", "there")), unlist = TRUE)) 1114s Error in as.character.bullet(unitizer:::OL(c("hello", "there")), unlist = TRUE) : 1114s You may not specify `unlist` as part of `...` as that argument is used internally 1114s > as.character(unitizer:::OL("asdfasdfqwerjhdfkasdfasdfasd"), width = 20L) 1114s [1] "1. asdfasdfqwerjhdf-" " kasdfasdfasd" 1114s > as.character(unitizer:::OL("asdfasdfqwerjhdfkasdfasdfasd"), width = 20L, 1114s + hyphens = FALSE) 1114s [1] "1. asdfasdfqwerjhdfk" " asdfasdfasd" 1114s > 1114s > # - "substr_const" ------------------------------------------------------------- 1114s > 1114s > unitizer:::substr_cons(c("ab", "abcde", "abce"), 4L) 1114s [1] "ab " "abcd" "abc " 1114s > unitizer:::substr_cons(c("ab", "abcde", "abce"), 4L, justify = "right") 1114s [1] " ab" "abcd" " abc" 1114s > unitizer:::substr_cons(c("NEW", "PASS", "FAIL", "DELETED", "Error"), 4L) 1114s [1] "NEW " "PASS" "FAIL" "DEL " "Err " 1114s > 1114s > # - "str_reduce_unique" -------------------------------------------------------- 1114s > 1114s > str1 <- c("abcdef", "abcdefgh", "abcql") 1114s > res1 <- c("def", "defgh", "ql") 1114s > unitizer:::str_reduce_unique(str1) 1114s [1] "def" "defgh" "ql" 1114s > unitizer:::str_reduce_unique(str1, from = "right") 1114s [1] "abcdef" "abcdefgh" "abcql" 1114s > str2 <- vapply(strsplit(str1, ""), function(x) paste0(rev(x), 1114s + collapse = ""), "") 1114s > res2 <- vapply(strsplit(res1, ""), function(x) paste0(rev(x), 1114s + collapse = ""), "") 1114s > all.equal(unitizer:::str_reduce_unique(str2, from = "right"), res2) 1114s [1] TRUE 1114s > unitizer:::str_reduce_unique("aaa") 1114s [1] "" 1114s > identical(unitizer:::str_reduce_unique(rep("aaa", 5L)), rep("", 5L)) 1114s [1] TRUE 1114s > 1114s > # - "strtrunc" ----------------------------------------------------------------- 1114s > 1114s > str1 <- c(paste0(letters, collapse = ""), paste0(LETTERS, collapse = "")) 1114s > unitizer:::strtrunc(str1, 10L) 1114s [1] "abcdefg..." "ABCDEFG..." 1114s > unitizer:::strtrunc(str1, 10L, from = "left") 1114s [1] "...tuvwxyz" "...TUVWXYZ" 1114s > unitizer:::strtrunc(c("abc", "cab"), 3L) 1114s [1] "abc" "cab" 1114s > try(unitizer:::strtrunc(c("abc", "cab"), 2L)) 1114s Error in unitizer:::strtrunc(c("abc", "cab"), 2L) : 1114s `nchar.max` too small, make bigger or make `ctd` shorter. 1114s > 1114s > # - "oneline" ------------------------------------------------------------------ 1114s > 1114s > dep <- c("res <- data %>% group_by(ID) %>% summarise(date2 = nth(date, ", 1114s + " 2), time2 = nth(time, 2), first_date = first(date), last_date = last(date), ", 1114s + " first_time = first(time), last_time = last(time))") 1114s > unitizer:::one_line(dep) 1114s [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))" 1114s > unitizer:::one_line(dep, 50) 1114s [1] "res <- data %>% group_by(ID) %>% summarise(date..." 1114s > 1114s > # - "let_comb_fun" ------------------------------------------------------------- 1114s > 1114s > (unitizer:::make_let_combn_fun(letters))(12) 1114s [1] "a." "b." "c." "d." "e." "f." "g." "h." "i." "j." "k." "l." 1114s > 1114s > # - "cc" ----------------------------------------------------------------------- 1114s > 1114s > unitizer:::cc("a", "b") 1114s [1] "ab" 1114s > unitizer:::cc(c("a", "b"), "c") 1114s [1] "abc" 1114s > unitizer:::cc(c("a", "b"), "c", c = " ") 1114s [1] "a b c" 1114s > 1114s > # - "screen_out" --------------------------------------------------------------- 1114s > 1114s > string <- "once upon a time in a fairy land very far away lived a green dragon" 1114s > unitizer:::screen_out(string, max.len = c(3L, 2L), width = 13L) 1114s once upon a 1114s time in a 1114s ... truncated 4 lines 1114s > 1114s > # - "text_wrap" ---------------------------------------------------------------- 1114s > 1114s > try(unitizer:::text_wrap(list(1, 2, 3), 5)) 1114s Error in unitizer:::text_wrap(list(1, 2, 3), 5) : 1114s Arguments `x` and `width` must be character and integer like (all values >= 1) respectively 1114s > try(unitizer:::text_wrap(letters, 1:3)) 1114s Error in unitizer:::text_wrap(letters, 1:3) : 1114s Argument `x` must be a multiple in length of argument `width` 1114s > 1114s > # - "capture_output" ----------------------------------------------------------- 1114s > 1114s > capt <- unitizer:::capture_output({ 1114s + cat("hello") 1114s + cat("goodbye", file = stderr()) 1114s + }) 1114s > capt 1114s - Output ----------------------------------------------------------------------- 1114s 1114s hello 1114s - Message ---------------------------------------------------------------------- 1114s 1114s goodbye 1114s > sum(grepl("Output|Message", capture.output(print(capt)))) 1114s [1] 2 1114s > 1114s > # - "meta_word_cat" ------------------------------------------------------------ 1114s > 1114s > unitizer:::meta_word_cat("hello") 1114s | hello 1114s 1114s > capture.output(unitizer:::meta_word_cat("hello", trail.nl = FALSE)) 1114s [1] "| hello" 1114s > # Newline issues 1114s > unitizer:::meta_word_cat("hello\n", sep = "") 1114s | hello 1114s 1114s > unitizer:::meta_word_cat("hello", "there") 1114s | hello 1114s | there 1114s 1114s > unitizer:::meta_word_cat("hello", "there", sep = " ") 1114s | hello there 1114s 1114s > 1114s > # - "meta_word_msg" ------------------------------------------------------------ 1114s > 1114s > unitizer:::meta_word_msg("hello") 1114s | hello 1114s 1114s > txt <- "hello there how are you this wraps" 1114s > unitizer:::meta_word_msg(txt, width = 20) 1114s | hello there how 1114s | are you this wraps 1114s 1114s > # legacy fun 1114s > unitizer:::word_msg("hello") 1114s hello 1114s > 1114s > # - "desc" --------------------------------------------------------------------- 1114s > 1114s > obj1 <- list(a = iris, b = lm(dist ~ speed, cars), 1:10, matrix(letters, 1114s + 2)) 1114s > desc(obj1, 80) 1114s [1] "list(a=data.frame[150,5], b=lm[12], int[10], chr mat[2,13])" 1114s > desc(obj1, 40) 1114s [1] "list[4]" 1114s > desc(iris, 80) 1114s [1] "data.frame[150,5]" 1114s > desc(iris, 200) 1114s [1] "data.frame(Sepal.Length=num[150], Sepal.Width=num[150], Petal.Length=num[150], Petal.Width=num[150], Species=fct[150])" 1114s > desc(list(NULL, 1L)) 1114s [1] "list(NULL, int[1])" 1114s > desc(NULL) 1114s [1] "NULL" 1114s > unitizer:::desc(NULL) 1114s [1] "NULL" 1114s > unitizer:::desc(lm(y ~ x, data.frame(y = 1:10, x = runif(10)))) 1114s [1] "lm[12]" 1114s > unitizer:::desc(new("unitizerItem", call = quote(1 + 1), env = new.env())) 1114s [1] "unitizerItem" 1114s > unitizer:::desc(array(1:27, dim = rep(3, 3))) 1114s [1] "array[3,3,3]" 1114s > unitizer:::desc(data.frame(a = letters[1:10], b = 1:10, stringsAsFactors = TRUE)) 1114s [1] "data.frame(a=fct[10], b=int[10])" 1114s > 1114s > # - "char_to_eng" -------------------------------------------------------------- 1114s > 1114s > unitizer:::char_to_eng(character(), "", "") 1114s [1] "" 1114s > unitizer:::char_to_eng(letters[1:4], "", "") 1114s [1] "a, b, c, and d" 1114s > unitizer:::char_to_eng(letters[1:2], "", "") 1114s [1] "a, and b" 1114s > unitizer:::char_to_eng(letters[1], "", "") 1114s [1] "a" 1114s > unitizer:::char_to_eng(letters[1]) 1114s [1] "a was" 1114s > unitizer:::char_to_eng(letters[1:2]) 1114s [1] "a, and b were" 1114s > 1114s > 1114s PASS 1114s Begin testing t-translate.R 1114s 1114s R version 4.3.2 (2023-10-31) -- "Eye Holes" 1114s Copyright (C) 2023 The R Foundation for Statistical Computing 1114s Platform: x86_64-pc-linux-gnu (64-bit) 1114s 1114s R is free software and comes with ABSOLUTELY NO WARRANTY. 1114s You are welcome to redistribute it under certain conditions. 1114s Type 'license()' or 'licence()' for distribution details. 1114s 1114s R is a collaborative project with many contributors. 1114s Type 'contributors()' for more information and 1114s 'citation()' on how to cite R or R packages in publications. 1114s 1114s Type 'demo()' for some demos, 'help()' for on-line help, or 1114s 'help.start()' for an HTML browser interface to help. 1114s Type 'q()' to quit R. 1114s 1114s > source(file.path("_helper", "init.R")) 1114s > source(file.path("aammrtf", "ref.R")); make_ref_obj_funs("refobjs") 1114s > 1114s > test.file.dir <- file.path("_helper", "ref-objs", "translate") 1114s > test.file <- file.path(test.file.dir, "testthat", "test-translate2.R") 1114s > test.file.min <- file.path(test.file.dir, "testthat2", "test-translate-min.R") 1114s > target.dir.base <- file.path(TMP.DIR, basename(tempfile())) 1114s > target.dir <- file.path(target.dir.base, "helper", "translate", "unitizer") 1114s > 1114s > # - "Prompt to create dir" ----------------------------------------------------- 1114s > 1114s > try( 1114s + testthat_translate_file( 1114s + test.file, target.dir, prompt = "always", interactive.mode = FALSE 1114s + ) ) 1114s Error in testthat_transcribe_file(file.name, target.dir, keep.testthat.call, : 1114s Unable to proceed without creating target directory 1114s > # translations have to be outside of `testthat`; second translation should fail 1114s > # except we allow manual input 1114s > 1114s > # - "translate a file" --------------------------------------------------------- 1114s > 1114s > unitizer:::capture_output({ 1114s + unitizer:::read_line_set_vals(c("Y")) 1114s + res1 <- testthat_translate_file(test.file, target.dir, prompt = "always", 1114s + interactive.mode = TRUE) 1114s + res1.txt <- readLines(res1) 1114s + unitizer:::read_line_set_vals(c("Y")) 1114s + res2 <- testthat_translate_file(test.file, target.dir, prompt = "overwrite", 1114s + interactive.mode = TRUE) 1114s + res2.txt <- readLines(res2) 1114s + unitizer:::read_line_set_vals(NULL) 1114s + }) 1115s > dummy <- new("unitizerDummy") 1115s > 1115s > all.equal(res1.txt, rds("translate_res1")) 1115s [1] TRUE 1115s > all.equal(res1.txt, res2.txt) 1115s [1] TRUE 1115s > 1115s > # Can't do this twice in a row without prompting in non-interactive mode 1115s > # note test above does work because we use interactive mode to accept prompt 1115s > 1115s > any( 1115s + grepl( 1115s + "already exists", 1115s + capture.output( 1115s + try( 1115s + testthat_translate_file( 1115s + test.file, target.dir, prompt = "always", interactive.mode = FALSE 1115s + ) ), 1115s + type='message' 1115s + ) ) ) 1115s [1] TRUE 1115s > untz <- get_unitizer(file.path(target.dir, "translate2.unitizer")) 1115s > all.equal(untz@items.ref.calls.deparse, rds("translate_res2")) 1115s [1] TRUE 1115s > 1115s > lapply(unitizer:::as.list(untz@items.ref), function(x) x@data@value[[1L]]) 1115s [[1]] 1115s 1115s 1115s [[2]] 1115s [1] 1 2 3 4 5 6 7 8 9 10 1115s 1115s [[3]] 1115s NULL 1115s 1115s [[4]] 1115s NULL 1115s 1115s [[5]] 1115s NULL 1115s 1115s [[6]] 1115s NULL 1115s 1115s [[7]] 1115s [1] "yoyo" 1115s 1115s [[8]] 1115s NULL 1115s 1115s > unlink(target.dir, recursive = TRUE) 1115s > 1115s > target.dir.base <- file.path(TMP.DIR, basename(tempfile())) 1115s > target.dir <- file.path(target.dir.base, "_helper", "translate", "unitizer") 1115s > 1115s > test.dir <- file.path("_helper", "ref-objs", "translate", "testthat") 1115s > 1115s > # - "translate a dir" ---------------------------------------------------------- 1115s > 1115s > unitizer:::capture_output(res2 <- testthat_translate_dir(test.dir, target.dir)) 1115s > all.equal(lapply(res2, readLines), rds("translate_res3")) 1115s [1] TRUE 1115s > untz <- get_unitizer(file.path(target.dir, "translate2.unitizer")) 1115s > all.equal(untz@items.ref.calls.deparse, rds("translate_res4")) 1115s [1] TRUE 1115s > 1115s > # Note not the same as when we did just the single file because the helper 1115s > # file is loaded so `fun0` and `fun1` are actually defined 1115s > lapply(unitizer:::as.list(untz@items.ref), function(x) x@data@value[[1L]]) 1115s [[1]] 1115s 1115s 1115s [[2]] 1115s [1] 1 2 3 4 5 6 7 8 9 10 1115s 1115s [[3]] 1115s [1] 42 1115s 1115s [[4]] 1115s [1] 24 1115s 1115s [[5]] 1115s [1] 24 1115s 1115s [[6]] 1115s NULL 1115s 1115s [[7]] 1115s [1] "yoyo" 1115s 1115s [[8]] 1115s NULL 1115s 1115s > 1115s > # Can't do it again since there are files there 1115s > any( 1115s + grepl( 1115s + "safety feature to ensure files are not accidentally overwritten", 1115s + capture.output( 1115s + try(testthat_translate_dir(test.dir, target.dir)), type='message' 1115s + ) ) ) 1115s [1] TRUE 1115s > 1115s > # - minimal -------------------------------------------------------------------- 1115s > 1115s > # to test parameters 1115s > 1115s > writeLines( 1115s + readLines( 1115s + testthat_translate_file( 1115s + test.file.min, target.dir, prompt = "never", interactive.mode = TRUE, 1115s + unitize = FALSE 1115s + ) ) ) 1115s # Minimal translation 1115s # test_that("simple tests", { 1115s # expect_equal(fun0(a), 1:10) 1115s # }) 1115s unitizer_sect("simple tests", { 1115s # expect_equal(fun0(a), 1:10) 1115s fun0(a) 1115s }) 1115s > writeLines( 1115s + readLines( 1115s + testthat_translate_file( 1115s + test.file.min, target.dir, prompt = "never", interactive.mode = TRUE, 1115s + use.sects = FALSE, unitize = FALSE 1115s + ) ) ) 1115s # Minimal translation 1115s # test_that("simple tests", { 1115s # expect_equal(fun0(a), 1:10) 1115s # }) 1115s # - "simple tests" ------------------------------------------------------------- 1115s 1115s 1115s # expect_equal(fun0(a), 1:10) 1115s fun0(a) 1115s > writeLines( 1115s + readLines( 1115s + testthat_translate_file( 1115s + test.file.min, target.dir, prompt = "never", interactive.mode = TRUE, 1115s + use.sects = FALSE, keep.testthat.call = FALSE, unitize = FALSE 1115s + ) ) ) 1115s # Minimal translation 1115s # - "simple tests" ------------------------------------------------------------- 1115s 1115s 1115s fun0(a) 1115s > 1115s > 1115s > 1116s PASS 1116s Begin testing t-upgrade.R 1116s 1116s R version 4.3.2 (2023-10-31) -- "Eye Holes" 1116s Copyright (C) 2023 The R Foundation for Statistical Computing 1116s Platform: x86_64-pc-linux-gnu (64-bit) 1116s 1116s R is free software and comes with ABSOLUTELY NO WARRANTY. 1116s You are welcome to redistribute it under certain conditions. 1116s Type 'license()' or 'licence()' for distribution details. 1116s 1116s R is a collaborative project with many contributors. 1116s Type 'contributors()' for more information and 1116s 'citation()' on how to cite R or R packages in publications. 1116s 1116s Type 'demo()' for some demos, 'help()' for on-line help, or 1116s 'help.start()' for an HTML browser interface to help. 1116s Type 'q()' to quit R. 1116s 1116s > source(file.path("_helper", "init.R")) 1116s > blat_vers <- function(x) sub("'\\d+(?:\\.\\d+)*'", "''", x) 1116s > 1116s > # - "Upgrade works" ------------------------------------------------------------ 1116s > 1116s > # this is also now tested as part of load 1116s > unitizer <- 1116s + get_unitizer(file.path("_helper", "unitizers", "trivial.unitizer.0.4.2")) 1116s > try(validObject(unitizer, complete = TRUE)) 1116s Error in validObject(object[[x]], complete = TRUE) : 1116s invalid class "unitizerItem" object: 1: slots in class definition but not in object: "call.dep", "section.id", "section.name", "glob.indices", "state" 1116s 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" 1116s > as.character(unitizer@version) 1116s [1] "0.4.2" 1116s > unitizer.up <- unitizer:::upgrade_internal(unitizer) # warning 1116s Warning in addSlot(object, "cons", NULL) : 1116s Slot `cons` does not exist in current version of `unitizer` so not added to object. 1116s Warning in addSlot(object, "jump.to.test", 0L) : 1116s Slot `jump.to.test` does not exist in current version of `unitizer` so not added to object. 1116s > validObject(unitizer.up) 1116s [1] TRUE 1116s > identical(unitizer.up@version, as.character(packageVersion("unitizer"))) 1116s [1] TRUE 1116s > 1116s > # - Upgrade Warnings in Unitize ------------------------------------------------ 1116s > 1116s > tdir <- tempfile() 1116s > dir.create(tdir) 1116s > dir.create(file.path(tdir, "trivial.unitizer")) 1116s > file.copy(file.path("_helper", "unitizers", "trivial.R"), tdir) 1116s [1] TRUE 1116s > file.copy( 1116s + file.path("_helper", "unitizers", "trivial.unitizer.0.4.2", "data.rds"), 1116s + file.path(tdir, "trivial.unitizer") 1116s + ) 1116s [1] TRUE 1116s > odir <- setwd(tdir) 1116s > unitizer:::read_line_set_vals('N') 1116s > out <- unitizer:::capture_output( 1116s + try(unitize(file.path(tdir, "trivial.R"), interactive.mode=TRUE)) 1116s + ) 1116s > out[] <- lapply(out, blat_vers) 1116s > out 1116s - Output ----------------------------------------------------------------------- 1116s 1116s 1116s | 1116s | The following unitizer will be upgraded to version '': 1116s | 1116s | - trivial.unitizer (at '') 1116s 1116s unitizer> N 1116s 1116s - Message ---------------------------------------------------------------------- 1116s 1116s Warning in check_call_stack() : 1116s It appears you are running unitizer inside an error handling function such as 1116s `withCallingHanlders`, `tryCatch`, or `withRestarts`. This is strongly dis- 1116s couraged as it may cause unpredictable behavior from unitizer in the event tests 1116s produce conditions / errors. We strongly recommend you re-run your tests 1116s outside of such handling functions. 1116s Warning in addSlot(object, "cons", NULL) : 1116s Slot `cons` does not exist in current version of `unitizer` so not added to object. 1116s Warning in addSlot(object, "jump.to.test", 0L) : 1116s Slot `jump.to.test` does not exist in current version of `unitizer` so not added to object. 1116s Warning in load_unitizers(store.ids[active], test.files[active], par.frame = util.frame, : 1116s Upgraded test file does not match original test file ('NA' vs 'trivial.R'). 1116s | unitizer upgrades are IRREVERSIBLE and not backwards compatible. 1116s | Proceed? 1116s 1116s Error in unitize_core(test.file.inf, list(store.id.inf), state = state, : 1116s Cannot proceed without upgrading unitizers. 1116s > 1116s > unitizer:::read_line_set_vals(c('Y','Q')) 1116s > out <- unitizer:::capture_output( 1116s + unitize(file.path(tdir, "trivial.R"), interactive.mode=TRUE) 1116s + ) 1117s > out[] <- lapply(out, blat_vers) 1117s > out 1117s - Output ----------------------------------------------------------------------- 1117s 1117s 1117s | 1117s | The following unitizer will be upgraded to version '': 1117s | 1117s | - trivial.unitizer (at '') 1117s 1117s unitizer> Y 1117s 1117s +------------------------------------------------------------------------------+ 1117s | unitizer for: trivial.R | 1117s +------------------------------------------------------------------------------+ 1117s 1117s Pass Fail New 1117s 1 - 3 1117s ........................... 1117s 1 - 3 1117s 1117s - New -------------------------------------------------------------------------- 1117s 1117s | The 3 tests in this section are new. Add tests to store ([Y]es, [N]o, [P]rev, 1117s | [B]rowse, [R]erun, [Q]uit, [H]elp)? 1117s 1117s > x <- 1 + 1 1117s > x + 2 1117s [1] 4 1117s 1117s unitizer> Q 1117s 1117s | unitizer unchanged. 1117s 1117s - Message ---------------------------------------------------------------------- 1117s 1117s Warning in addSlot(object, "cons", NULL) : 1117s Slot `cons` does not exist in current version of `unitizer` so not added to object. 1117s Warning in addSlot(object, "jump.to.test", 0L) : 1117s Slot `jump.to.test` does not exist in current version of `unitizer` so not added to object. 1117s Warning in load_unitizers(store.ids[active], test.files[active], par.frame = util.frame, : 1117s Upgraded test file does not match original test file ('NA' vs 'trivial.R'). 1117s | unitizer upgrades are IRREVERSIBLE and not backwards compatible. 1117s | Proceed? 1117s 1117s | No changes recorded. 1117s > unitizer:::read_line_set_vals(NULL) 1117s > setwd(odir) 1117s > unlink(tdir, recursive=TRUE) 1117s > 1117s > # - Upgrade Multiple Unitizers Unitize ----------------------------------------- 1117s > 1117s > tdir <- tempfile() 1117s > dir.create(tdir) 1117s > dir.create(file.path(tdir, "trivial1.unitizer")) 1117s > dir.create(file.path(tdir, "trivial2.unitizer")) 1117s > file.copy( 1117s + file.path("_helper", "unitizers", "trivial.R"), 1117s + file.path(tdir, c("trivial1.R", "trivial2.R")) 1117s + ) 1117s [1] TRUE TRUE 1117s > file.copy( 1117s + file.path("_helper", "unitizers", "trivial.unitizer.0.4.2", "data.rds"), 1117s + file.path(tdir, "trivial1.unitizer") 1117s + ) 1117s [1] TRUE 1117s > file.copy( 1117s + file.path("_helper", "unitizers", "trivial.unitizer.0.4.2", "data.rds"), 1117s + file.path(tdir, "trivial2.unitizer") 1117s + ) 1117s [1] TRUE 1117s > odir <- setwd(tdir) 1117s > unitizer:::read_line_set_vals(c('Y','Q')) 1117s > out <- unitizer:::capture_output( 1117s + unitize_dir(tdir, interactive.mode=TRUE) 1117s + ) 1120s > out[] <- lapply(out, blat_vers) 1120s > out 1120s - Output ----------------------------------------------------------------------- 1120s 1120s 1120s | 1120s | The following unitizers will be upgraded to version '': 1120s | 1120s | - trivial1.unitizer (at '') 1120s | - trivial2.unitizer (at '') 1120s 1120s unitizer> Y 1120s 1120s | Summary of files in common directory '.': 1120s | 1120s | Pass Fail New 1120s | *1. trivial1.R 1 - 3 1120s | *2. trivial2.R 1 - 3 1120s | .............................. 1120s | 2 - 6 1120s | Legend: 1120s | * `unitizer` requires review 1120s 1120s | Type number of unitizer to review, 'A' to review all that require review 1120s 1120s unitizer> Q 1120s 1120s - Message ---------------------------------------------------------------------- 1120s 1120s Warning in addSlot(object, "cons", NULL) : 1120s Slot `cons` does not exist in current version of `unitizer` so not added to object. 1120s Warning in addSlot(object, "jump.to.test", 0L) : 1120s Slot `jump.to.test` does not exist in current version of `unitizer` so not added to object. 1120s Warning in addSlot(object, "cons", NULL) : 1120s Slot `cons` does not exist in current version of `unitizer` so not added to object. 1120s Warning in addSlot(object, "jump.to.test", 0L) : 1120s Slot `jump.to.test` does not exist in current version of `unitizer` so not added to object. 1120s Warning in load_unitizers(store.ids[active], test.files[active], par.frame = util.frame, : 1120s Upgraded test file does not match original test file ('NA' vs 'trivial1.R'). 1120s Warning in load_unitizers(store.ids[active], test.files[active], par.frame = util.frame, : 1120s Upgraded test file does not match original test file ('NA' vs 'trivial2.R'). 1120s | unitizer upgrades are IRREVERSIBLE and not backwards compatible. 1120s | Proceed? 1120s 1120s > unitizer:::read_line_set_vals(NULL) 1120s > setwd(odir) 1120s > unlink(tdir, recursive=TRUE) 1120s > 1120s > # - "Rename" ------------------------------------------------------------------- 1120s > 1120s > setClass("untzUpgrTest", slots = c(a = "character")) 1120s > x <- new("untzUpgrTest", a = letters) 1120s > validObject(x) 1120s [1] TRUE 1120s > setClass("untzUpgrTest", slots = c(b = "character")) 1120s > try(validObject(x)) 1120s Error in validObject(x) : 1120s invalid class "untzUpgrTest" object: slots in class definition but not in object: "b" 1120s > try(capture.output(unitizer:::renameSlot(x, "c", "b"), type = "message")) 1120s Error in unitizer:::renameSlot(x, "c", "b") : 1120s Old slot `c` doesn't exist in object 1120s > x.rename <- unitizer:::renameSlot(x, "a", "b") 1120s > validObject(x.rename) 1120s [1] TRUE 1120s > 1120s > # - "Later but valid version" -------------------------------------------------- 1120s > 1120s > test.file <- file.path(TMP.DIR, "tests.R") 1120s > cat("1 + 1", file = test.file) 1120s > unitizer:::capture_output(unitize(test.file, auto.accept = "new")) 1120s > version <- unlist(strsplit(as.character(packageVersion("unitizer")), 1120s + ".", fixed = TRUE)) 1120s > version[1] <- as.character(as.numeric(version[1]) + 1) 1120s > version.new <- paste0(version, collapse = ".") 1120s > unitizer.rds <- readRDS(file.path(TMP.DIR, "tests.unitizer", "data.rds")) 1120s > unitizer.rds@version <- version.new 1120s > # this should work 1120s > !nchar(unitizer:::unitizer_valid(unitizer.rds)) 1120s [1] TRUE 1120s > # now lets cause an error 1120s > unitizer.rds@eval.time <- runif(5) 1120s > grepl("NB: ", unitizer:::unitizer_valid(unitizer.rds)) 1120s [1] TRUE 1120s > 1120s > # - "Failing Test w/ Upgrade" -------------------------------------------------- 1120s > 1120s > # Unitizer will fail, but also requires an upgrade. This ensures the failure is 1120s > # shown despite the need for an upgrade. 1120s > tdir <- tempfile() 1120s > dir.create(tdir) 1120s > dir.create(file.path(tdir, "fail-and-upgrade.unitizer")) 1120s > file.copy(file.path("_helper", "unitizers", "fail-and-upgrade.R"), tdir) 1120s [1] TRUE 1120s > file.copy( 1120s + file.path("_helper", "unitizers", "fail-and-upgrade.unitizer", "data.rds"), 1120s + file.path(tdir, "fail-and-upgrade.unitizer") 1120s + ) 1120s [1] TRUE 1120s > odir <- setwd(tdir) 1120s > try(unitize(file.path("fail-and-upgrade.R"))) 1120s 1120s Warning in check_call_stack() : 1120s It appears you are running unitizer inside an error handling function such as 1120s `withCallingHanlders`, `tryCatch`, or `withRestarts`. This is strongly dis- 1120s couraged as it may cause unpredictable behavior from unitizer in the event tests 1120s produce conditions / errors. We strongly recommend you re-run your tests 1120s outside of such handling functions. 1120s Warning in history_capt(history, interactive.mode) : 1120s Unable to capture history in non-interactive mode. 1120s +------------------------------------------------------------------------------+ 1120s | unitizer for: fail-and-upgrade.R | 1120s +------------------------------------------------------------------------------+ 1120s 1120s Pass Fail 1120s - 1 1120s ...................... 1120s - 1 1120s 1120s - Failed ----------------------------------------------------------------------- 1120s 1120s | The following test failed because the new evaluation does not match the 1120s | reference value from the store. Overwrite with new result ([Y]es, [N]o, 1120s | [P]rev, [B]rowse, [R]erun, [Q]uit, [H]elp)? 1120s 1120s # fails with newer versions of unitizer so we can make sure upgrade shows error 1120s # and doesn't just gag at the upgrade prompt 1120s 1120s > packageVersion("unitizer") < "1.4.15" 1120s [1] FALSE 1120s 1120s | Value mismatch: 1120s 1120s < .ref > .new 1120s @@ 1 @@ @@ 1 @@ 1120s < [1] TRUE > [1] FALSE 1120s 1120s | State mismatch; see `.DIFF$state` for details. 1120s 1120s | User input required to proceed, but we are in non-interactive mode. 1120s 1120s | unitizer unchanged. 1120s 1120s | * Fail: packageVersion("unitizer") < "1.4.15" 1120s | in 'fail-and-upgrade.R' 1120s 1120s | Newly evaluated tests do not match unitizer (Fail: 1); see above for more 1120s | info, or run in interactive mode. 1120s 1120s Error in unitize_core(test.file.inf, list(store.id.inf), state = state, : 1120s Cannot proceed in non-interactive mode. 1120s > 1120s > # Confirm upgrade needed 1120s > capture.output(unitizer:::read_line_set_vals(c('Y', 'Q'))) 1120s character(0) 1120s > out <- unitizer:::capture_output( 1120s + unitize(file.path("fail-and-upgrade.R"), interactive.mode=TRUE) 1120s + ) 1120s > out[] <- lapply(out, blat_vers) 1120s > out 1120s - Output ----------------------------------------------------------------------- 1120s 1120s 1120s | 1120s | The following unitizer will be upgraded to version '': 1120s | 1120s | - fail-and-upgrade.unitizer (at '') 1120s 1120s unitizer> Y 1120s 1120s +------------------------------------------------------------------------------+ 1120s | unitizer for: fail-and-upgrade.R | 1120s +------------------------------------------------------------------------------+ 1120s 1120s Pass Fail 1120s - 1 1120s ...................... 1120s - 1 1120s 1120s - Failed ----------------------------------------------------------------------- 1120s 1120s | The following test failed because the new evaluation does not match the 1120s | reference value from the store. Overwrite with new result ([Y]es, [N]o, 1120s | [P]rev, [B]rowse, [R]erun, [Q]uit, [H]elp)? 1120s 1120s # fails with newer versions of unitizer so we can make sure upgrade shows error 1120s # and doesn't just gag at the upgrade prompt 1120s 1120s > packageVersion("unitizer") < "1.4.15" 1120s [1] FALSE 1120s 1120s | Value mismatch: 1120s 1120s < .ref > .new 1120s @@ 1 @@ @@ 1 @@ 1120s < [1] TRUE > [1] FALSE 1120s 1120s | State mismatch; see `.DIFF$state` for details. 1120s 1120s unitizer> Q 1120s 1120s | unitizer unchanged. 1120s 1120s - Message ---------------------------------------------------------------------- 1120s 1120s | unitizer upgrades are IRREVERSIBLE and not backwards compatible. 1120s | Proceed? 1120s 1120s | No changes recorded. 1120s > 1120s > unitizer:::read_line_set_vals(NULL) 1120s > setwd(odir) 1120s > unlink(tdir, recursive=TRUE) 1120s > 1120s > 1120s PASS 1120s Begin testing t-utz1.R 1120s 1120s R version 4.3.2 (2023-10-31) -- "Eye Holes" 1120s Copyright (C) 2023 The R Foundation for Statistical Computing 1120s Platform: x86_64-pc-linux-gnu (64-bit) 1120s 1120s R is free software and comes with ABSOLUTELY NO WARRANTY. 1120s You are welcome to redistribute it under certain conditions. 1120s Type 'license()' or 'licence()' for distribution details. 1120s 1120s R is a collaborative project with many contributors. 1120s Type 'contributors()' for more information and 1120s 'citation()' on how to cite R or R packages in publications. 1120s 1120s Type 'demo()' for some demos, 'help()' for on-line help, or 1120s 'help.start()' for an HTML browser interface to help. 1120s Type 'q()' to quit R. 1120s 1120s > # - "No Attach Test" ----------------------------------------------------------- 1120s > 1120s > f <- paste0(tempfile(), ".R") 1120s > writeLines("1 + 1", f) 1120s > try(unitizer::unitize(f)) 1120s 1120s Error in unitize_core(test.file.inf, list(store.id.inf), state = state, : 1120s `unitizer` package must be attached to the search path, e.g. with `library(unitizer)` 1120s > unlink(f) 1120s > 1120s > # - "Usual Setup" -------------------------------------------------------------- 1120s > 1120s > source(file.path("_helper", "init.R")) 1120s > source(file.path("aammrtf", "ref.R")); make_ref_obj_funs("refobjs") 1120s > source(file.path("_helper", "pkgs.R")) 1120s Install Packages 1121s Setup Demos 1121s > 1121s > # - "custom history file" ------------------------------------------------------ 1121s > 1121s > # Random history file 1121s > unitizer:::read_line_set_vals(c("1 + 1", "Y", "Y", "Y", "Y", "N")) 1121s > hist.file <- tempfile() 1121s > invisible( 1121s + unitizer:::capture_output( 1121s + unitize(FLM.TEST.FILE, interactive.mode = TRUE, history = hist.file) 1121s + ) ) 1122s > hist.dat <- readLines(hist.file) 1122s > unlink(hist.file) 1122s > 1122s > # History only works in interactive mode 1122s > if (interactive()) { 1122s + identical(hist.dat, c("## (original history will be restored on exit)", 1122s + "library(utzflm, lib.loc = getOption(\"unitizer.tmp.lib.loc\"))", 1122s + "dat <- data.frame(x = 1:100, y = (1:100)^2)", "res <- fastlm(dat$x, dat$y)", 1122s + "res", "1 + 1", "get_slope(res)", "get_rsq(res)", "fastlm(1:100, 1:10)")) 1122s + } else { 1122s + identical(hist.dat, character()) 1122s + } 1122s [1] TRUE 1122s > # - "bad history" -------------------------------------------------------------- 1122s > 1122s > bad.hist <- try(unitize(FLM.TEST.FILE, history = list()), silent = TRUE) 1122s 1122s > inherits(bad.hist, "try-error") 1122s [1] TRUE 1122s > conditionMessage(attr(bad.hist, "condition")) 1122s [1] "Argument `history` must be the name of a file that can be opened in \"at\" mode, or \"\", or NULL" 1122s > 1122s > # - "bad seed" ----------------------------------------------------------------- 1122s > 1122s > # gsub needed b/c of inconsistent error calls in 3.3.2 and 3.4 1122s > old.opt <- options(unitizer.seed = "bad.seed") 1122s > txtopt1 <- unitizer:::capture_output(try(unitize(FLM.TEST.FILE))) 1122s > options(unitizer.seed = list("bad.seed")) 1122s > txtopt2 <- unitizer:::capture_output(try(unitize(FLM.TEST.FILE))) 1122s > # set.seed gained an argument c.a. R3.6 that caused error mismatch 1122s > txtopt2$message[grepl("\\(function \\(seed", txtopt2$message, 1122s + ignore.case = TRUE)] <- "" 1122s > options(old.opt) 1122s > 1122s > 1122s > unitizer:::clean_eval_exp(txtopt1) 1122s - Output ----------------------------------------------------------------------- 1122s 1122s 1122s - Message ---------------------------------------------------------------------- 1122s 1122s Error in do.call(set.seed, seed.dat) : second argument must be a list 1122s Error in as.state(state, test.files) : 1122s 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.) 1122s Error in unitize_core(test.file.inf, list(store.id.inf), state = state, : 1122s Argument `state` could not be evaluated. 1122s > # supplied seed not valid int 1122s > # unexpectedly exited; not clear why all stderr is not being captured by 1122s > # capture_output... 1122s > txtopt2 1122s - Output ----------------------------------------------------------------------- 1122s 1122s 1122s - Message ---------------------------------------------------------------------- 1122s 1122s 1122s NAs introduced by coercion 1122s 1122s supplied seed is not a valid integer 1122s Error in as.state(state, test.files) : 1122s 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.) 1122s Error in unitize_core(test.file.inf, list(store.id.inf), state = state, : 1122s Argument `state` could not be evaluated. 1122s > 1122s > # - "create dir" --------------------------------------------------------------- 1122s > 1122s > # Unitizers in different directories that don't exist; also test using a 1122s > # function to generate those directories 1122s > get_store_id <- function(x) { 1122s + file <- basename(x) 1122s + dir <- dirname(dirname(x)) 1122s + file.path(dir, "unitizer2", sub("(.*)\\.R", "\\1.unitizer", 1122s + file)) 1122s + } 1122s > unitizer:::read_line_set_vals(c("N")) 1122s > txt1 <- unitizer:::capture_output( 1122s + untz1 <- try(unitize_dir(FLM.TEST.DIR, get_store_id, interactive.mode = TRUE)) 1122s + ) 1122s > unitizer:::read_line_set_vals(c("Y", "Q")) 1122s > txt2 <- unitizer:::capture_output(untz2 <- unitize_dir(FLM.TEST.DIR, 1122s + get_store_id, interactive.mode = TRUE)) 1122s > 1122s > inherits(untz1, "try-error") 1122s [1] TRUE 1122s > inherits(untz2, "unitizer_results") 1122s [1] TRUE 1122s > 1122s > # Some of the text must be ablated 1122s > rem_txt <- function(x) { 1122s + crd <- grep("Create directory\\?", x) 1122s + if (!length(crd)) 1122s + stop("Logic Error: this must be a create directory test") 1122s + x[-(2L:(crd[[1L]] - 1L))] 1122s + } 1122s > txt1$output <- rem_txt(txt1$output) 1122s > txt2$output <- rem_txt(txt2$output) 1122s > 1122s > # must create the following directory 1122s > # cannot proceed w/o creating directories 1122s > 1122s > txt1 1122s - Output ----------------------------------------------------------------------- 1122s 1122s 1122s | Create directory? 1122s 1122s unitizer> N 1122s 1122s - Message ---------------------------------------------------------------------- 1122s 1122s Warning in check_call_stack() : 1122s It appears you are running unitizer inside an error handling function such as 1122s `withCallingHanlders`, `tryCatch`, or `withRestarts`. This is strongly dis- 1122s couraged as it may cause unpredictable behavior from unitizer in the event tests 1122s produce conditions / errors. We strongly recommend you re-run your tests 1122s outside of such handling functions. 1122s Error in unitize_core(test.files = test.files, store.ids = store.ids, : 1122s Cannot proceed without creating directories. 1122s > txt2 1122s - Output ----------------------------------------------------------------------- 1122s 1122s 1122s | Create directory? 1122s 1122s unitizer> Y 1122s 1122s | Summary of files in common directory 'unitizer': 1122s | 1122s | Pass Fail New 1122s | *1. fastlm1.R - - 4 1122s | *2. fastlm2.R - - 1 1122s | *3. unitizer.fastlm.R - - 3 1122s | ..................................... 1122s | - - 8 1122s | Legend: 1122s | * `unitizer` requires review 1122s 1122s | Type number of unitizer to review, 'A' to review all that require review 1122s 1122s unitizer> Q 1122s 1122s - Message ---------------------------------------------------------------------- 1122s 1122s 1122s > 1122s > # - print / dir ---------------------------------------------------------------- 1122s > 1122s > # quit from all at once 1122s > unitizer:::read_line_set_vals(c("A", "QQ", "Q")) 1122s > unitize_dir(FLM.TEST.DIR, interactive.mode = TRUE) 1122s 1122s | Summary of files in common directory 'unitizer': 1122s | 1122s | Pass Fail New 1122s | *1. fastlm1.R - - 4 1122s | *2. fastlm2.R - - 1 1122s | *3. unitizer.fastlm.R - - 3 1122s | ..................................... 1122s | - - 8 1122s | Legend: 1122s | * `unitizer` requires review 1122s 1122s | Type number of unitizer to review, 'A' to review all that require review 1122s 1122s unitizer> A 1122s 1122s +------------------------------------------------------------------------------+ 1122s | unitizer for: unitizer/fastlm1.R | 1122s +------------------------------------------------------------------------------+ 1122s 1122s Pass Fail New 1122s - - 4 1122s ........................... 1122s - - 4 1122s 1122s - New -------------------------------------------------------------------------- 1122s 1122s | The 4 tests in this section are new. Add tests to store ([Y]es, [N]o, [P]rev, 1122s | [B]rowse, [R]erun, [QQ]uit All, [Q]uit, [H]elp)? 1122s 1123s # Assignments and calls to `library` are not considered tests by 1123s # `unitizer` so you will not need to review them 1123s 1123s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 1123s > dat <- data.frame(x = 1:100, y = (1:100)^2) 1123s > res <- fastlm(dat$x, dat$y) 1123s 1123s # The `unitizer>` prompt is like the standard R prompt. You may 1123s # enter expressions such as `lm(y ~ x, dat)$coefficients`, or 1123s # `str(res)`. 1123s # 1123s # Once you are done reviewing, you need to tell `unitizer` you 1123s # accept the test by typing 'Y' at the prompt. Enter 'H' for help. 1123s 1123s > res 1123s intercept slope rsq 1123s -1717.000 101.000 0.939 1123s attr(,"class") 1123s [1] "fastlm" 1123s 1123s unitizer> QQ 1123s 1123s | No changes recorded. 1123s | unitizer unchanged. 1123s 1123s | Summary of files in common directory 'unitizer': 1123s | 1123s | Pass Fail New 1123s | *1. fastlm1.R - - 4 1123s | *2. fastlm2.R - - 1 1123s | *3. unitizer.fastlm.R - - 3 1123s | ..................................... 1123s | - - 8 1123s | Legend: 1123s | * `unitizer` requires review 1123s 1123s | Type number of unitizer to review, 'A' to review all that require review 1123s 1123s unitizer> Q 1123s 1123s > 1123s > # Now test `unitize_dir`; we are testing all different combination of whether 1123s > # a unitizer is accepted and updated 1123s > # Review all 1123s > # Accept all 1123s > # Quit 1123s > # Quit 1123s > # Re-evalute 1123s > # Review remaining 1123s > # Accept all 1123s > # Quit from review 1123s > # Quit completely 1123s > 1123s > unitizer:::read_line_set_vals(c("A", "Y", "Y", "Y", "Y", "Y", 1123s + "Q", "Q", "R", "A", "Y", "Y", "Q", "Q")) 1123s > untz3a <- unitize_dir(FLM.TEST.DIR, interactive.mode = TRUE) 1123s 1123s | Summary of files in common directory 'unitizer': 1123s | 1123s | Pass Fail New 1123s | *1. fastlm1.R - - 4 1123s | *2. fastlm2.R - - 1 1123s | *3. unitizer.fastlm.R - - 3 1123s | ..................................... 1123s | - - 8 1123s | Legend: 1123s | * `unitizer` requires review 1123s 1123s | Type number of unitizer to review, 'A' to review all that require review 1123s 1123s unitizer> A 1123s 1123s +------------------------------------------------------------------------------+ 1123s | unitizer for: unitizer/fastlm1.R | 1123s +------------------------------------------------------------------------------+ 1123s 1123s Pass Fail New 1123s - - 4 1123s ........................... 1123s - - 4 1123s 1123s - New -------------------------------------------------------------------------- 1123s 1123s | The 4 tests in this section are new. Add tests to store ([Y]es, [N]o, [P]rev, 1123s | [B]rowse, [R]erun, [QQ]uit All, [Q]uit, [H]elp)? 1123s 1123s # Assignments and calls to `library` are not considered tests by 1123s # `unitizer` so you will not need to review them 1123s 1123s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 1123s > dat <- data.frame(x = 1:100, y = (1:100)^2) 1123s > res <- fastlm(dat$x, dat$y) 1123s 1123s # The `unitizer>` prompt is like the standard R prompt. You may 1123s # enter expressions such as `lm(y ~ x, dat)$coefficients`, or 1123s # `str(res)`. 1123s # 1123s # Once you are done reviewing, you need to tell `unitizer` you 1123s # accept the test by typing 'Y' at the prompt. Enter 'H' for help. 1123s 1123s > res 1123s intercept slope rsq 1123s -1717.000 101.000 0.939 1123s attr(,"class") 1123s [1] "fastlm" 1123s 1123s unitizer> Y 1123s 1123s # There are three more tests to review; accept them with 'Y' 1123s 1123s > get_slope(res) 1123s [1] 101 1123s 1123s unitizer> Y 1123s 1123s > get_rsq(res) 1123s [1] 0.939 1123s 1123s unitizer> Y 1123s 1123s # This last test is expected to cause an error; press 'Y' to 1123s # accept it so future checks can confirm the same error persists 1123s 1123s > fastlm(1:100, 1:10) 1123s Error in fastlm(1:100, 1:10) : 1123s Arguments `x` and `y` must be the same length. 1123s 1123s unitizer> Y 1123s 1123s = Finalize Unitizer ============================================================ 1123s 1123s | You will IRREVERSIBLY modify 'unitizer/fastlm1.unitizer' by: 1123s | - Adding 4 out of 4 new tests 1123s 1123s | Update unitizer ([Y]es, [N]o, [P]rev, [B]rowse, [R]erun, [QQ]uit All)? 1123s 1123s unitizer> Y 1123s 1123s | unitizer updated. 1123s 1123s +------------------------------------------------------------------------------+ 1123s | unitizer for: unitizer/fastlm2.R | 1123s +------------------------------------------------------------------------------+ 1123s 1123s Pass Fail New 1123s - - 1 1123s ........................... 1123s - - 1 1123s 1123s - New -------------------------------------------------------------------------- 1123s 1123s | The following test is new. Add test to store ([Y]es, [N]o, [P]rev, [B]rowse, 1123s | [R]erun, [QQ]uit All, [Q]uit, [H]elp)? 1123s 1123s # For internal tests only; not for demo 1123s 1123s > x <- 1:10 1123s > y <- 1:10^3 1123s > res <- summary(lm(y ~ x, data.frame(x = x, y = y))) 1123s > intercept <- res$coefficients[1, 1] 1123s > slope <- res$coefficients[2, 1] 1123s > rsq <- res$r.squared 1123s > structure(c(intercept = intercept, slope = slope, rsq = rsq), 1123s + class = "fastlm") 1123s intercept slope rsq 1123s 4.95e+02 1.00e+00 9.90e-05 1123s attr(,"class") 1123s [1] "fastlm" 1123s 1123s unitizer> Q 1123s 1123s | No changes recorded. 1123s | unitizer unchanged. 1123s 1123s +------------------------------------------------------------------------------+ 1123s | unitizer for: unitizer/unitizer.fastlm.R | 1123s +------------------------------------------------------------------------------+ 1123s 1123s Pass Fail New 1123s - - 3 1123s ........................... 1123s - - 3 1123s 1123s - New -------------------------------------------------------------------------- 1123s 1123s | The 3 tests in this section are new. Add tests to store ([Y]es, [N]o, [P]rev, 1123s | [B]rowse, [R]erun, [QQ]uit All, [Q]uit, [H]elp)? 1123s 1123s # Extra test file for internal tests; not for DEMO 1123s 1123s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 1123s > x <- 1:10 1123s > y <- x^3 1123s > res <- fastlm(x, y) 1123s > get_slope(res) 1123s [1] 105 1123s 1123s unitizer> Q 1123s 1123s | No changes recorded. 1123s | unitizer unchanged. 1123s 1123s | Summary of files in common directory 'unitizer': 1123s | 1123s | Pass Fail New 1123s | $1. fastlm1.R ? ? ? 1123s | *2. fastlm2.R - - 1 1123s | *3. unitizer.fastlm.R - - 3 1123s | ..................................... 1123s | ? ? ? 1123s | Legend: 1123s | * `unitizer` requires review 1123s | $ `unitizer` has been modified and needs to be re-run to recompute summary 1123s 1123s | Type number of unitizer to review, 'A' to review all that require review, 'R' 1123s | to re-run all updated 1123s 1123s unitizer> R 1123s 1123s | Summary of files in common directory 'unitizer': 1123s | 1123s | Pass Fail New 1123s | 1. fastlm1.R 4 - - 1123s | *2. fastlm2.R - - 1 1123s | *3. unitizer.fastlm.R - - 3 1123s | ..................................... 1123s | 4 - 4 1123s | Legend: 1123s | * `unitizer` requires review 1123s 1123s | Type number of unitizer to review, 'A' to review all that require review 1123s 1123s unitizer> A 1123s 1123s +------------------------------------------------------------------------------+ 1123s | unitizer for: unitizer/fastlm2.R | 1123s +------------------------------------------------------------------------------+ 1123s 1123s Pass Fail New 1123s - - 1 1123s ........................... 1123s - - 1 1123s 1123s - New -------------------------------------------------------------------------- 1123s 1123s | The following test is new. Add test to store ([Y]es, [N]o, [P]rev, [B]rowse, 1123s | [R]erun, [QQ]uit All, [Q]uit, [H]elp)? 1123s 1123s # For internal tests only; not for demo 1123s 1123s > x <- 1:10 1123s > y <- 1:10^3 1123s > res <- summary(lm(y ~ x, data.frame(x = x, y = y))) 1123s > intercept <- res$coefficients[1, 1] 1123s > slope <- res$coefficients[2, 1] 1123s > rsq <- res$r.squared 1123s > structure(c(intercept = intercept, slope = slope, rsq = rsq), 1123s + class = "fastlm") 1123s intercept slope rsq 1123s 4.95e+02 1.00e+00 9.90e-05 1123s attr(,"class") 1123s [1] "fastlm" 1123s 1123s unitizer> Y 1123s 1123s = Finalize Unitizer ============================================================ 1123s 1123s | You will IRREVERSIBLY modify 'unitizer/fastlm2.unitizer' by: 1123s | - Adding 1 out of 1 new tests 1123s 1123s | Update unitizer ([Y]es, [N]o, [P]rev, [B]rowse, [R]erun, [QQ]uit All)? 1123s 1123s unitizer> Y 1123s 1123s | unitizer updated. 1123s 1123s +------------------------------------------------------------------------------+ 1123s | unitizer for: unitizer/unitizer.fastlm.R | 1123s +------------------------------------------------------------------------------+ 1123s 1123s Pass Fail New 1123s - - 3 1123s ........................... 1123s - - 3 1123s 1123s - New -------------------------------------------------------------------------- 1123s 1123s | The 3 tests in this section are new. Add tests to store ([Y]es, [N]o, [P]rev, 1123s | [B]rowse, [R]erun, [QQ]uit All, [Q]uit, [H]elp)? 1123s 1123s # Extra test file for internal tests; not for DEMO 1123s 1123s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 1123s > x <- 1:10 1123s > y <- x^3 1123s > res <- fastlm(x, y) 1123s > get_slope(res) 1123s [1] 105 1123s 1123s unitizer> Q 1123s 1123s | No changes recorded. 1123s | unitizer unchanged. 1123s 1123s | Summary of files in common directory 'unitizer': 1123s | 1123s | Pass Fail New 1123s | 1. fastlm1.R 4 - - 1123s | $2. fastlm2.R ? ? ? 1123s | *3. unitizer.fastlm.R - - 3 1123s | ..................................... 1123s | ? ? ? 1123s | Legend: 1123s | * `unitizer` requires review 1123s | $ `unitizer` has been modified and needs to be re-run to recompute summary 1123s 1123s | Type number of unitizer to review, 'A' to review all that require review, 'R' 1123s | to re-run all updated 1123s 1123s unitizer> Q 1123s 1123s > untz3a.get.all <- vapply(get_unitizer(untz3a), class, character(1L)) 1123s > identical(untz3a.get.all, c("unitizer", "unitizer", "logical")) 1123s [1] TRUE 1123s > print(untz3a) 1123s Summary of tests (accept/total): 1123s 1123s id test.file New Passed Totals 1123s 1 fastlm1.R 0/0 4/4 4/4 $ 1123s 2 fastlm2.R 1/1 0/0 1/1 1123s 3 unitizer.fastlm.R 0/3 0/0 0/3 * 1123s ----------------------------------------------------- 1123s 0 Totals 1/4 4/4 5/8 1123s 1123s * unitizer was not saved 1123s $ unitizer was saved in prior evaluation 1123s 1123s Test files in common directory 'tests/unitizer' 1123s > untz3a.first <- untz3a[[1L]] 1123s > print(untz3a.first) 1123s Test File: tests/unitizer/fastlm1.R 1123s Store ID: tests/unitizer/fastlm1.unitizer 1123s 1123s id call ignored status user reviewed 1123s 1 1 library(utzflm, lib.loc = g... * Passed Y FALSE 1123s 2 2 dat <- data.frame(x = 1:100... * Passed Y FALSE 1123s 3 3 res <- fastlm(dat$x, dat$y) * Passed Y FALSE 1123s 4 4 res Passed Y FALSE 1123s 5 5 get_slope(res) Passed Y FALSE 1123s 6 6 get_rsq(res) Passed Y FALSE 1123s 7 7 fastlm(1:100, 1:10) Passed Y FALSE 1123s 1123s You chose NOT to save these changes to the unitizer store 1123s > 1123s > identical(class(untz3a), "unitizer_results") 1123s [1] TRUE 1123s > identical( 1123s + lapply(untz3a, class), 1123s + replicate(3L, c("unitizer_result", "data.frame"), simplify = FALSE) 1123s + ) 1123s [1] TRUE 1123s > 1123s > untz3a.cpy <- untz3a 1123s > # need to drop temp file attributes for tests 1123s > for (i in seq_along(untz3a.cpy)) { 1123s + attr(untz3a.cpy[[i]], "test.file") <- basename(attr(untz3a.cpy[[i]], 1123s + "test.file")) 1123s + attr(untz3a.cpy[[i]], "store.id") <- basename(attr(untz3a.cpy[[i]], 1123s + "store.id")) 1123s + } 1123s > all.equal(untz3a.cpy, rds("unitize_res1")) 1123s [1] TRUE 1123s > 1123s > # dummy class for errors 1123s > untz3a.first.bad <- untz3a.first 1123s > setClass("uhtsdfoqiuerhzb", slots=c(a='integer')) 1123s > attr(untz3a.first.bad, "store.id") <- new("uhtsdfoqiuerhzb") 1123s > print(untz3a.first.bad) 1123s Test File: tests/unitizer/fastlm1.R 1123s Store ID: 1123s 1123s id call ignored status user reviewed 1123s 1 1 library(utzflm, lib.loc = g... * Passed Y FALSE 1123s 2 2 dat <- data.frame(x = 1:100... * Passed Y FALSE 1123s 3 3 res <- fastlm(dat$x, dat$y) * Passed Y FALSE 1123s 4 4 res Passed Y FALSE 1123s 5 5 get_slope(res) Passed Y FALSE 1123s 6 6 get_rsq(res) Passed Y FALSE 1123s 7 7 fastlm(1:100, 1:10) Passed Y FALSE 1123s 1123s You chose NOT to save these changes to the unitizer store 1123s > 1123s > # this is a bit contrived as it isn't possible to directly create an empty 1123s > # unitize dir result 1123s > untz3a.empty <- untz3a[0] 1123s > class(untz3a.empty) <- class(untz3a) 1123s > print(untz3a.empty) 1123s | No unitizers 1123s 1123s > 1123s > # Now accept the last remaining tests 1123s > # unlink(list.files(test.dir, pattern="\\.unitizer$", full.names=TRUE), 1123s > # recursive=TRUE) 1123s > # Invalid input 1123s > # Review third unitizer 1123s > # Accept all 1123s > # Re-eval and exit (again, not clear this is right thing to do) 1123s > unitizer:::read_line_set_vals(c("3000", "3", "Y", "Y", "Y", "Y", 1123s + "R")) 1123s > untz3b <- unitize_dir(FLM.TEST.DIR, interactive.mode = TRUE) 1123s 1123s | Summary of files in common directory 'unitizer': 1123s | 1123s | Pass Fail New 1123s | 1. fastlm1.R 4 - - 1123s | 2. fastlm2.R 1 - - 1123s | *3. unitizer.fastlm.R - - 3 1123s | ..................................... 1123s | 5 - 3 1123s | Legend: 1123s | * `unitizer` requires review 1123s 1123s | Type number of unitizer to review, 'A' to review all that require review 1123s 1123s unitizer> 3000 1123s | Type a number in `1:3` at the prompt 1123s [1] 3000 1123s unitizer> 3 1123s +------------------------------------------------------------------------------+ 1123s | unitizer for: unitizer/unitizer.fastlm.R | 1123s +------------------------------------------------------------------------------+ 1123s 1123s Pass Fail New 1123s - - 3 1123s ........................... 1123s - - 3 1123s 1123s - New -------------------------------------------------------------------------- 1123s 1123s | The 3 tests in this section are new. Add tests to store ([Y]es, [N]o, [P]rev, 1123s | [B]rowse, [R]erun, [Q]uit, [H]elp)? 1123s 1123s # Extra test file for internal tests; not for DEMO 1123s 1123s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 1123s > x <- 1:10 1123s > y <- x^3 1123s > res <- fastlm(x, y) 1123s > get_slope(res) 1123s [1] 105 1123s 1123s unitizer> Y 1123s 1123s > get_rsq(res) 1123s [1] 0.862 1123s 1123s unitizer> Y 1123s 1123s > get_intercept(res) 1123s [1] -277 1123s 1123s unitizer> Y 1123s 1123s = Finalize Unitizer ============================================================ 1123s 1123s | You will IRREVERSIBLY modify 'unitizer/unitizer.fastlm.unitizer' by: 1123s | - Adding 3 out of 3 new tests 1123s 1123s | Update unitizer ([Y]es, [N]o, [P]rev, [B]rowse, [R]erun)? 1123s 1123s unitizer> Y 1123s 1123s | unitizer updated. 1123s 1123s | Summary of files in common directory 'unitizer': 1123s | 1123s | Pass Fail 1123s | 1. fastlm1.R 4 - 1123s | 2. fastlm2.R 1 - 1123s | $3. unitizer.fastlm.R ? ? 1123s | ................................ 1123s | ? ? 1123s | Legend: 1123s | $ `unitizer` has been modified and needs to be re-run to recompute summary 1123s 1123s | Type number of unitizer to review, 'A' to review all that require review, 'R' 1123s | to re-run all updated 1123s 1123s unitizer> R 1123s 1123s | Summary of files in common directory 'unitizer': 1123s | 1123s | Pass Fail 1123s | 1. fastlm1.R 4 - 1123s | 2. fastlm2.R 1 - 1123s | 3. unitizer.fastlm.R 3 - 1123s | ................................ 1123s | 8 - 1123s 1123s | 8/8 tests passed; nothing to review. 1123s 1123s > print(untz3b) 1123s Summary of tests (accept/total): 1123s 1123s id test.file Passed 1123s 1 fastlm1.R 4/4 * 1123s 2 fastlm2.R 1/1 * 1123s 3 unitizer.fastlm.R 3/3 $ 1123s --------------------------------- 1123s 0 Totals 8/8 1123s 1123s * unitizer was not saved 1123s $ unitizer was saved in prior evaluation 1123s 1123s Test files in common directory 'tests/unitizer' 1123s > identical( 1123s + vapply(get_unitizer(untz3b), class, character(1L)), rep("unitizer", 3L) 1123s + ) 1123s [1] TRUE 1123s > # - "namespace conflict" ------------------------------------------------------- 1123s > 1123s > # Namespace conflicts; unfortunately if either `covr` or `data.table` are 1123s > # loaded this may not work quite right. Also as of `covr` 2.2.2 it seems that 1123s > # the R session `covr` launches now seems to load the covr namespace. The 1123s > # logic here ensures covr namespace is always loaded for this tests, if 1123s > # possible. So we omit the line were what namespaces could not be unloaded are 1123s > # mentioned. 1123s > 1123s > unitizer:::read_line_set_vals("Y") 1123s > ns.conf1 <- unitizer:::capture_output( 1123s + unitize_dir(FLM.TEST.DIR, state = "pristine", interactive.mode = TRUE) 1123s + ) 1124s > ns.conf1$message <- ns.conf1$message[-3] 1124s > ns.conf1 1124s - Output ----------------------------------------------------------------------- 1124s 1124s 1124s | Summary of files in common directory 'unitizer': 1124s | 1124s | Pass Fail 1124s | 1. fastlm1.R 4 - 1124s | 2. fastlm2.R 1 - 1124s | 3. unitizer.fastlm.R 3 - 1124s | ................................ 1124s | 8 - 1124s 1124s | Do you wish to proceed despite compromised state tracking 1124s | ([Y]es, [N]o)? 1124s 1124s unitizer> Y 1124s 1124s - Message ---------------------------------------------------------------------- 1124s 1124s | `unitizer` was unable to run with `options` state tracking enabled starting 1124s | with the first test file because the following namespaces could not be 1124s 1124s | You may proceed normally but be aware that option state was not managed 1124s | starting with the file in question, and option state will not be managed 1124s | during review, or restored to original values after `unitizer` completes 1124s | evaluation. You may quit `unitizer` now to avoid any changes. See `?unitiz- 1124s | erState` for more details. 1124s 1124s | 8/8 tests passed; nothing to review. 1124s 1124s > 1124s > unitizer:::read_line_set_vals("N") 1124s > ns.conf2 <- unitizer:::capture_output( 1124s + unitize_dir(FLM.TEST.DIR, state = "pristine", interactive.mode = TRUE) 1124s + ) 1124s > ns.conf2$message <- ns.conf2$message[-3] 1124s > ns.conf2 1124s - Output ----------------------------------------------------------------------- 1124s 1124s 1124s | Summary of files in common directory 'unitizer': 1124s | 1124s | Pass Fail 1124s | 1. fastlm1.R 4 - 1124s | 2. fastlm2.R 1 - 1124s | 3. unitizer.fastlm.R 3 - 1124s | ................................ 1124s | 8 - 1124s 1124s | Do you wish to proceed despite compromised state tracking 1124s | ([Y]es, [N]o)? 1124s 1124s unitizer> N 1124s 1124s - Message ---------------------------------------------------------------------- 1124s 1124s | `unitizer` was unable to run with `options` state tracking enabled starting 1124s | with the first test file because the following namespaces could not be 1124s 1124s | You may proceed normally but be aware that option state was not managed 1124s | starting with the file in question, and option state will not be managed 1124s | during review, or restored to original values after `unitizer` completes 1124s | evaluation. You may quit `unitizer` now to avoid any changes. See `?unitiz- 1124s | erState` for more details. 1124s 1124s > 1124s > # Non-interactive; also testing what happens when we run a test with errors 1124s > # inside a try block 1124s > 1124s > try(unitize_dir(FLM.TEST.DIR, state = "pristine", interactive.mode = FALSE)) 1124s 1124s Warning in check_call_stack() : 1124s It appears you are running unitizer inside an error handling function such as 1124s `withCallingHanlders`, `tryCatch`, or `withRestarts`. This is strongly dis- 1124s couraged as it may cause unpredictable behavior from unitizer in the event tests 1124s produce conditions / errors. We strongly recommend you re-run your tests 1124s outside of such handling functions. 1124s 1124s 1124s 1124s 1124s 1124s 1124s | Unexpectedly exited evaluation attempt when executing test expression: 1124s | > fastlm(1:100, 1:10) 1124s | Make sure you are not calling `unitize` inside a `tryCatch`/`try` block, 1124s | invoking a restart defined outside `unitize`, evaluating an expression that 1124s | calls `quit()`/`q()`, or quitting from a `browser()`/`debug()`/`trace()`. If 1124s | none of these apply yet you are seeing this message please contact package 1124s | maintainer. 1124s 1124s Error in fastlm(1:100, 1:10) : 1124s Arguments `x` and `y` must be the same length. 1124s > ns.conf3 <- unitizer:::capture_output( 1124s + try( 1124s + unitize( 1124s + file.path(FLM.TEST.DIR, "fastlm2.R"), state = "pristine", 1124s + interactive.mode = FALSE 1124s + ) ) ) 1124s > ns.conf3$message <- ns.conf3$message[-grep('unloaded', ns.conf3$message)] 1124s > ns.conf3 1124s - Output ----------------------------------------------------------------------- 1124s 1124s 1124s - Message ---------------------------------------------------------------------- 1124s 1124s Warning in check_call_stack() : 1124s It appears you are running unitizer inside an error handling function such as 1124s `withCallingHanlders`, `tryCatch`, or `withRestarts`. This is strongly dis- 1124s couraged as it may cause unpredictable behavior from unitizer in the event tests 1124s produce conditions / errors. We strongly recommend you re-run your tests 1124s outside of such handling functions. 1124s Warning in history_capt(history, interactive.mode) : 1124s Unable to capture history in non-interactive mode. 1124s | `unitizer` was unable to run with `options` state tracking enabled starting 1124s | with the first test file because the following namespaces could not be 1124s 1124s Error in unitize_browse(unitizers = unitizers[valid], mode = mode, interactive.mode = interactive.mode, : 1124s Unable to proceed in non-interactive mode; set options state tracking to a value 1124s less than or equal to search path state tracking or see vignette for other 1124s workarounds. 1124s > 1124s > # - "Removing Tests" ----------------------------------------------------------- 1124s > 1124s > # Removing tests; del2 has the same tests as del1, but with some removed 1124s > extra.dir <- file.path(FLM.TEST.DIR, "..", "extra") 1124s > unitize(file.path(extra.dir, "del1.R"), auto.accept = "new", interactive.mode = FALSE) 1124s 1124s Warning in history_capt(history, interactive.mode) : 1124s Unable to capture history in non-interactive mode. 1124s +------------------------------------------------------------------------------+ 1124s | unitizer for: extra/del1.R | 1124s +------------------------------------------------------------------------------+ 1124s 1124s Pass Fail New 1124s basic tests - - 3 1124s more tests - - 3 1124s ............................ 1124s - - 6 1124s 1124s | Auto-accepting changes... 1124s | unitizer updated. 1124s 1124s > unitizer:::read_line_set_vals(c("Y", "YY", "Y", "Y")) 1124s > unitize( 1124s + file.path(extra.dir, "del2.R"), 1124s + store.id = file.path(extra.dir, "del1.unitizer"), 1124s + interactive.mode = TRUE 1124s + ) 1124s 1124s +------------------------------------------------------------------------------+ 1124s | unitizer for: extra/del2.R | 1124s +------------------------------------------------------------------------------+ 1124s 1124s Pass Fail Del 1124s basic tests 2 - 1 1124s - - 3 1124s ............................ 1124s 2 - 4 1124s 1124s = basic tests ================================================================== 1124s 1124s - Removed ---------------------------------------------------------------------- 1124s 1124s | The following test exists in the unitizer store but not in the new test 1124s | script. Remove test from store ([Y]es, [N]o, [P]rev, [B]rowse, [R]erun, 1124s | [Q]uit, [H]elp)? 1124s 1124s > "hello" 1124s [1] "hello" 1124s 1124s unitizer> Y 1124s 1124s = Other Removed Items ========================================================== 1124s 1124s - Removed ---------------------------------------------------------------------- 1124s 1124s | The 3 tests in this section exist in the unitizer store but not in the new 1124s | test script. Remove tests from store ([Y]es, [N]o, [P]rev, [B]rowse, [R]erun, 1124s | [Q]uit, [H]elp)? 1124s 1124s > 3 1124s [1] 3 1124s 1124s unitizer> YY 1124s 1124s 1. 3 . . . . Removed:- 1124s 2. 645 . . . . Removed:- 1124s 3. 9/0 . . . . Removed:- 1124s 1124s Choose 'Y' for the 3 tests shown above ([Y]es, [N]o)? 1124s unitizer> Y 1124s 1124s = Finalize Unitizer ============================================================ 1124s 1124s | You will IRREVERSIBLY modify 'extra/del1.unitizer' by: 1124s | - Removing 4 out of 4 removed tests 1124s 1124s | Update unitizer ([Y]es, [N]o, [P]rev, [B]rowse, [R]erun)? 1124s 1124s unitizer> Y 1124s 1124s | unitizer updated. 1124s 1124s > # - "navigate" ----------------------------------------------------------------- 1124s > 1124s > # Update `fastlm` to cause unitizers to fail, and go through the errors 1124s > update_fastlm(FLM, version = "0.1.1") 1124s > inst_pak(FLM) 1125s > # Try navigating through the unitizer 1125s > unitizer:::read_line_set_vals(c("P", "B", "3", "N", "U", "N", 1125s + "N", "B", "U", "Q")) 1125s > untz7a <- unitize(FLM.TEST.FILE, interactive.mode = TRUE) 1125s 1125s +------------------------------------------------------------------------------+ 1125s | unitizer for: unitizer/fastlm1.R | 1125s +------------------------------------------------------------------------------+ 1125s 1125s Pass Fail 1125s 2 2 1125s ...................... 1125s 2 2 1125s 1125s - Failed ----------------------------------------------------------------------- 1125s 1125s | The 2 tests in this section failed because the new evaluations do not match 1125s | the reference values from the store. Overwrite with new results ([Y]es, [N]o, 1125s | [P]rev, [B]rowse, [R]erun, [Q]uit, [H]elp)? 1125s 1125s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 1125s > dat <- data.frame(x = 1:100, y = (1:100)^2) 1125s > res <- fastlm(dat$x, dat$y) 1125s 1125s # Our fast computations do not produce the same results as our 1125s # original tests so they fail. If you need more detail than the 1125s # provided diff you may use `.new`/`.NEW` or `.ref`/`.REF`. 1125s # 1125s # You should reject these tests by typing 'N' at the prompt since 1125s # they are incorrect. 1125s 1126s > res 1126s intercept slope rsq 1126s -3.54e+13 7.01e+11 9.39e-01 1126s attr(,"class") 1126s [1] "fastlm" 1126s 1126s | Value mismatch: 1126s 1126s < .ref > .new 1126s @@ 1,4 @@ @@ 1,4 @@ 1126s intercept slope rsq intercept slope rsq 1126s < -1717.000 101.000 0.939 > -3.54e+13 7.01e+11 9.39e-01 1126s attr(,"class") attr(,"class") 1126s [1] "fastlm" [1] "fastlm" 1126s 1126s | State mismatch; see `.DIFF$state` for details. 1126s 1126s unitizer> P 1126s 1126s | At first reviewable item; nothing to step back to 1126s 1126s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 1126s > dat <- data.frame(x = 1:100, y = (1:100)^2) 1126s > res <- fastlm(dat$x, dat$y) 1126s 1126s # Our fast computations do not produce the same results as our 1126s # original tests so they fail. If you need more detail than the 1126s # provided diff you may use `.new`/`.NEW` or `.ref`/`.REF`. 1126s # 1126s # You should reject these tests by typing 'N' at the prompt since 1126s # they are incorrect. 1126s 1126s > res 1126s intercept slope rsq 1126s -3.54e+13 7.01e+11 9.39e-01 1126s attr(,"class") 1126s [1] "fastlm" 1126s 1126s | Value mismatch: 1126s 1126s < .ref > .new 1126s @@ 1,4 @@ @@ 1,4 @@ 1126s intercept slope rsq intercept slope rsq 1126s < -1717.000 101.000 0.939 > -3.54e+13 7.01e+11 9.39e-01 1126s attr(,"class") attr(,"class") 1126s [1] "fastlm" [1] "fastlm" 1126s 1126s | State mismatch; see `.DIFF$state` for details. 1126s 1126s unitizer> B 1126s 1126s *1. library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) . -:- 1126s *2. dat <- data.frame(x = 1:100, y = (1:100)^2) . . . . . . -:- 1126s *3. res <- fastlm(dat$x, dat$y) . . . . . . . . . . . . -:- 1126s 4. res . . . . . . . . . . . . . . . . . . . . Failed:- 1126s 5. get_slope(res) . . . . . . . . . . . . . . . . Failed:- 1126s 6. get_rsq(res) . . . . . . . . . . . . . . . . . Passed:- 1126s 7. fastlm(1:100, 1:10) . . . . . . . . . . . . . . Passed:- 1126s 1126s | What test do you wish to review (input a test number, [U]nreviewed)? 1126s 1126s unitizer> 3 1126s 1126s | You selected a test that is not normally reviewed in this mode; 1126s | as such, upon test completion, you will be brought back to this menu 1126s | instead of being taken to the next reviewable test. 1126s 1126s - Failed ----------------------------------------------------------------------- 1126s 1126s | The 2 tests in this section failed because the new evaluations do not match 1126s | the reference values from the store. Overwrite with new results ([Y]es, [N]o, 1126s | [P]rev, [B]rowse, [R]erun, [Q]uit, [H]elp)? 1126s 1126s > res <- fastlm(dat$x, dat$y) 1126s unitizer> N 1126s 1126s *1. library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) . -:- 1126s *2. dat <- data.frame(x = 1:100, y = (1:100)^2) . . . . . . -:- 1126s *3. res <- fastlm(dat$x, dat$y) . . . . . . . . . . . . -:N 1126s 4. res . . . . . . . . . . . . . . . . . . . . Failed:- 1126s 5. get_slope(res) . . . . . . . . . . . . . . . . Failed:- 1126s 6. get_rsq(res) . . . . . . . . . . . . . . . . . Passed:- 1126s 7. fastlm(1:100, 1:10) . . . . . . . . . . . . . . Passed:- 1126s 1126s | What test do you wish to review (input a test number, [U]nreviewed)? 1126s 1126s unitizer> U 1126s 1126s - Failed ----------------------------------------------------------------------- 1126s 1126s | The 2 tests in this section failed because the new evaluations do not match 1126s | the reference values from the store. Overwrite with new results ([Y]es, [N]o, 1126s | [P]rev, [B]rowse, [R]erun, [Q]uit, [H]elp)? 1126s 1126s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 1126s > dat <- data.frame(x = 1:100, y = (1:100)^2) 1126s > res <- fastlm(dat$x, dat$y) 1126s 1126s # Our fast computations do not produce the same results as our 1126s # original tests so they fail. If you need more detail than the 1126s # provided diff you may use `.new`/`.NEW` or `.ref`/`.REF`. 1126s # 1126s # You should reject these tests by typing 'N' at the prompt since 1126s # they are incorrect. 1126s 1126s > res 1126s intercept slope rsq 1126s -3.54e+13 7.01e+11 9.39e-01 1126s attr(,"class") 1126s [1] "fastlm" 1126s 1126s | Value mismatch: 1126s 1126s < .ref > .new 1126s @@ 1,4 @@ @@ 1,4 @@ 1126s intercept slope rsq intercept slope rsq 1126s < -1717.000 101.000 0.939 > -3.54e+13 7.01e+11 9.39e-01 1126s attr(,"class") attr(,"class") 1126s [1] "fastlm" [1] "fastlm" 1126s 1126s | State mismatch; see `.DIFF$state` for details. 1126s 1126s unitizer> N 1126s 1126s # This one is also incorrect; reject with 'N' 1126s 1126s > get_slope(res) 1126s [1] 7.01e+11 1126s 1126s | Value mismatch: 1126s 1126s < .ref > .new 1126s @@ 1 @@ @@ 1 @@ 1126s < [1] 101 > [1] 7.01e+11 1126s 1126s | State mismatch; see `.DIFF$state` for details. 1126s 1126s unitizer> N 1126s 1126s = Finalize Unitizer ============================================================ 1126s 1126s | You made no changes to the unitizer so there is no need to update it. While 1126s | unnecessary, you can force an update by typing O at the prompt. 1126s 1126s | Exit unitizer ([Y]es, [P]rev, [B]rowse, [R]erun, f[O]rce)? 1126s 1126s unitizer> B 1126s 1126s *1. library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) . -:- 1126s *2. dat <- data.frame(x = 1:100, y = (1:100)^2) . . . . . . -:- 1126s *3. res <- fastlm(dat$x, dat$y) . . . . . . . . . . . . -:N 1126s 4. res . . . . . . . . . . . . . . . . . . . . Failed:N 1126s 5. get_slope(res) . . . . . . . . . . . . . . . . Failed:N 1126s 6. get_rsq(res) . . . . . . . . . . . . . . . . . Passed:- 1126s 7. fastlm(1:100, 1:10) . . . . . . . . . . . . . . Passed:- 1126s 1126s | What test do you wish to review (input a test number, [U]nreviewed)? 1126s 1126s unitizer> U 1126s 1126s | No unreviewed tests. 1126s 1126s = Finalize Unitizer ============================================================ 1126s 1126s | You made no changes to the unitizer so there is no need to update it. While 1126s | unnecessary, you can force an update by typing O at the prompt. 1126s 1126s | Exit unitizer ([Y]es, [P]rev, [B]rowse, [R]erun, f[O]rce)? 1126s 1126s unitizer> Q 1126s 1126s | Changes discarded. 1126s | unitizer unchanged. 1126s 1126s > attr(untz7a, "test.file") <- basename(attr(untz7a, "test.file")) 1126s > attr(untz7a, "store.id") <- basename(attr(untz7a, "store.id")) 1126s > path <- attr(untz7a, "test.file") 1126s > path 1126s [1] "fastlm1.R" 1126s > (path.norm <- unitizer:::normalize_path(path, mustWork=FALSE, exists=TRUE)) 1126s [1] "fastlm1.R" 1126s > (rel.path <- unitizer:::relativize_path(path.norm, wd=NULL, only.if.shorter=TRUE, exists=TRUE)) 1126s [1] "fastlm1.R" 1126s > (pkg.dir <- unitizer:::get_package_dir(path.norm, exists=TRUE)) 1126s [1] "." 1126s > untz7a 1126s Test File: fastlm1.R 1126s Store ID: fastlm1.unitizer 1126s 1126s id call ignored status user reviewed 1126s 1 1 library(utzflm, lib.loc = g... * Failed N FALSE 1126s 2 2 dat <- data.frame(x = 1:100... * Failed N FALSE 1126s 3 3 res <- fastlm(dat$x, dat$y) * Failed N TRUE 1126s 4 4 res Failed N TRUE 1126s 5 5 get_slope(res) Failed N TRUE 1126s 6 6 get_rsq(res) Passed Y FALSE 1126s 7 7 fastlm(1:100, 1:10) Passed Y FALSE 1126s 1126s You chose NOT to save these changes to the unitizer store 1126s > 1126s > # - "review dir" --------------------------------------------------------------- 1126s > 1126s > # list help, review first item, but do nothing 1126s > unitizer:::read_line_set_vals(c("H", "1", "Q", "Q")) 1126s > unitize_dir(FLM.TEST.DIR, interactive.mode = TRUE) 1126s 1126s | Summary of files in common directory 'unitizer': 1126s | 1126s | Pass Fail 1126s | *1. fastlm1.R 2 2 1126s | 2. fastlm2.R 1 - 1126s | *3. unitizer.fastlm.R 1 2 1126s | ................................ 1126s | 4 4 1126s | Legend: 1126s | * `unitizer` requires review 1126s 1126s | Type number of unitizer to review, 'A' to review all that require review 1126s 1126s unitizer> H 1126s 1126s | Available options: 1126s | - 1:3: unitizer number to review 1126s | - A: Review all `unitzers` that require review (*) 1126s | - AA: Review all tests 1126s | - RR: Re-run all tests 1126s | - Q: quit 1126s | 1126s | Pick a unitizer or an option ([A]ll, [Q]uit, [H]elp)? 1126s 1126s unitizer> 1 1126s +------------------------------------------------------------------------------+ 1126s | unitizer for: unitizer/fastlm1.R | 1126s +------------------------------------------------------------------------------+ 1126s 1126s Pass Fail 1126s 2 2 1126s ...................... 1126s 2 2 1126s 1126s - Failed ----------------------------------------------------------------------- 1126s 1126s | The 2 tests in this section failed because the new evaluations do not match 1126s | the reference values from the store. Overwrite with new results ([Y]es, [N]o, 1126s | [P]rev, [B]rowse, [R]erun, [Q]uit, [H]elp)? 1126s 1126s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 1126s > dat <- data.frame(x = 1:100, y = (1:100)^2) 1126s > res <- fastlm(dat$x, dat$y) 1126s 1126s # Our fast computations do not produce the same results as our 1126s # original tests so they fail. If you need more detail than the 1126s # provided diff you may use `.new`/`.NEW` or `.ref`/`.REF`. 1126s # 1126s # You should reject these tests by typing 'N' at the prompt since 1126s # they are incorrect. 1126s 1126s > res 1126s intercept slope rsq 1126s -3.54e+13 7.01e+11 9.39e-01 1126s attr(,"class") 1126s [1] "fastlm" 1126s 1126s | Value mismatch: 1126s 1126s < .ref > .new 1126s @@ 1,4 @@ @@ 1,4 @@ 1126s intercept slope rsq intercept slope rsq 1126s < -1717.000 101.000 0.939 > -3.54e+13 7.01e+11 9.39e-01 1126s attr(,"class") attr(,"class") 1126s [1] "fastlm" [1] "fastlm" 1126s 1126s | State mismatch; see `.DIFF$state` for details. 1126s 1126s unitizer> Q 1126s 1126s | No changes recorded. 1126s | unitizer unchanged. 1126s 1126s | Summary of files in common directory 'unitizer': 1126s | 1126s | Pass Fail 1126s | *1. fastlm1.R 2 2 1126s | 2. fastlm2.R 1 - 1126s | *3. unitizer.fastlm.R 1 2 1126s | ................................ 1126s | 4 4 1126s | Legend: 1126s | * `unitizer` requires review 1126s 1126s | Type number of unitizer to review, 'A' to review all that require review 1126s 1126s unitizer> Q 1126s 1126s > # incorrect selection 1126s > unitizer:::read_line_set_vals(c("H", "4", "1", "Q", "Q")) 1126s > unitize_dir(FLM.TEST.DIR, interactive.mode = TRUE) 1126s 1127s | Summary of files in common directory 'unitizer': 1127s | 1127s | Pass Fail 1127s | *1. fastlm1.R 2 2 1127s | 2. fastlm2.R 1 - 1127s | *3. unitizer.fastlm.R 1 2 1127s | ................................ 1127s | 4 4 1127s | Legend: 1127s | * `unitizer` requires review 1127s 1127s | Type number of unitizer to review, 'A' to review all that require review 1127s 1127s unitizer> H 1127s 1127s | Available options: 1127s | - 1:3: unitizer number to review 1127s | - A: Review all `unitzers` that require review (*) 1127s | - AA: Review all tests 1127s | - RR: Re-run all tests 1127s | - Q: quit 1127s | 1127s | Pick a unitizer or an option ([A]ll, [Q]uit, [H]elp)? 1127s 1127s unitizer> 4 1127s | Type a number in `1:3` at the prompt 1127s [1] 4 1127s unitizer> 1 1127s +------------------------------------------------------------------------------+ 1127s | unitizer for: unitizer/fastlm1.R | 1127s +------------------------------------------------------------------------------+ 1127s 1127s Pass Fail 1127s 2 2 1127s ...................... 1127s 2 2 1127s 1127s - Failed ----------------------------------------------------------------------- 1127s 1127s | The 2 tests in this section failed because the new evaluations do not match 1127s | the reference values from the store. Overwrite with new results ([Y]es, [N]o, 1127s | [P]rev, [B]rowse, [R]erun, [Q]uit, [H]elp)? 1127s 1127s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 1127s > dat <- data.frame(x = 1:100, y = (1:100)^2) 1127s > res <- fastlm(dat$x, dat$y) 1127s 1127s # Our fast computations do not produce the same results as our 1127s # original tests so they fail. If you need more detail than the 1127s # provided diff you may use `.new`/`.NEW` or `.ref`/`.REF`. 1127s # 1127s # You should reject these tests by typing 'N' at the prompt since 1127s # they are incorrect. 1127s 1127s > res 1127s intercept slope rsq 1127s -3.54e+13 7.01e+11 9.39e-01 1127s attr(,"class") 1127s [1] "fastlm" 1127s 1127s | Value mismatch: 1127s 1127s < .ref > .new 1127s @@ 1,4 @@ @@ 1,4 @@ 1127s intercept slope rsq intercept slope rsq 1127s < -1717.000 101.000 0.939 > -3.54e+13 7.01e+11 9.39e-01 1127s attr(,"class") attr(,"class") 1127s [1] "fastlm" [1] "fastlm" 1127s 1127s | State mismatch; see `.DIFF$state` for details. 1127s 1127s unitizer> Q 1127s 1127s | No changes recorded. 1127s | unitizer unchanged. 1127s 1127s | Summary of files in common directory 'unitizer': 1127s | 1127s | Pass Fail 1127s | *1. fastlm1.R 2 2 1127s | 2. fastlm2.R 1 - 1127s | *3. unitizer.fastlm.R 1 2 1127s | ................................ 1127s | 4 4 1127s | Legend: 1127s | * `unitizer` requires review 1127s 1127s | Type number of unitizer to review, 'A' to review all that require review 1127s 1127s unitizer> Q 1127s 1127s > # simulate slow unitizer review 1127s > old.opt <- options(unitizer.prompt.b4.quit.time = 0) 1127s > unitizer:::read_line_set_vals(c("H", "1", "Q", "Q", "Q", "Y")) 1127s > unitize_dir(FLM.TEST.DIR, interactive.mode = TRUE) 1127s 1127s | Summary of files in common directory 'unitizer': 1127s | 1127s | Pass Fail 1127s | *1. fastlm1.R 2 2 1127s | 2. fastlm2.R 1 - 1127s | *3. unitizer.fastlm.R 1 2 1127s | ................................ 1127s | 4 4 1127s | Legend: 1127s | * `unitizer` requires review 1127s 1127s | Type number of unitizer to review, 'A' to review all that require review 1127s 1127s unitizer> H 1127s 1127s | Available options: 1127s | - 1:3: unitizer number to review 1127s | - A: Review all `unitzers` that require review (*) 1127s | - AA: Review all tests 1127s | - RR: Re-run all tests 1127s | - Q: quit 1127s | 1127s | Pick a unitizer or an option ([A]ll, [Q]uit, [H]elp)? 1127s 1127s unitizer> 1 1127s +------------------------------------------------------------------------------+ 1127s | unitizer for: unitizer/fastlm1.R | 1127s +------------------------------------------------------------------------------+ 1127s 1127s Pass Fail 1127s 2 2 1127s ...................... 1127s 2 2 1127s 1127s - Failed ----------------------------------------------------------------------- 1127s 1127s | The 2 tests in this section failed because the new evaluations do not match 1127s | the reference values from the store. Overwrite with new results ([Y]es, [N]o, 1127s | [P]rev, [B]rowse, [R]erun, [Q]uit, [H]elp)? 1127s 1127s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 1127s > dat <- data.frame(x = 1:100, y = (1:100)^2) 1127s > res <- fastlm(dat$x, dat$y) 1127s 1127s # Our fast computations do not produce the same results as our 1127s # original tests so they fail. If you need more detail than the 1127s # provided diff you may use `.new`/`.NEW` or `.ref`/`.REF`. 1127s # 1127s # You should reject these tests by typing 'N' at the prompt since 1127s # they are incorrect. 1127s 1127s > res 1127s intercept slope rsq 1127s -3.54e+13 7.01e+11 9.39e-01 1127s attr(,"class") 1127s [1] "fastlm" 1127s 1127s | Value mismatch: 1127s 1127s < .ref > .new 1127s @@ 1,4 @@ @@ 1,4 @@ 1127s intercept slope rsq intercept slope rsq 1127s < -1717.000 101.000 0.939 > -3.54e+13 7.01e+11 9.39e-01 1127s attr(,"class") attr(,"class") 1127s [1] "fastlm" [1] "fastlm" 1127s 1127s | State mismatch; see `.DIFF$state` for details. 1127s 1127s unitizer> Q 1127s 1127s = Finalize Unitizer ============================================================ 1127s 1127s | You have 2 unreviewed tests; press `B` to browse tests, `U` to go to first 1127s | unreviewed test. 1127s 1127s | You made no changes to the unitizer so there is no need to update it. While 1127s | unnecessary, you can force an update by typing O at the prompt. 1127s 1127s | Exit unitizer ([Y]es, [P]rev, [B]rowse, [U]nreviewed, [R]erun, f[O]rce)? 1127s 1127s unitizer> Q 1127s 1127s | Changes discarded. 1127s | unitizer unchanged. 1127s 1127s | Summary of files in common directory 'unitizer': 1127s | 1127s | Pass Fail 1127s | *1. fastlm1.R 2 2 1127s | 2. fastlm2.R 1 - 1127s | *3. unitizer.fastlm.R 1 2 1127s | ................................ 1127s | 4 4 1127s | Legend: 1127s | * `unitizer` requires review 1127s 1127s | Type number of unitizer to review, 'A' to review all that require review 1127s 1127s unitizer> Q 1127s 1127s | Are you sure you want to quit? 1127s 1127s unitizer> Y 1127s 1127s > options(old.opt) 1127s > # Failures in non-interactive mode (note, can't run on the actual "fastlm.R" 1127s > # file b/c we need to do this under a `try`): 1127s > try( 1127s + unitize_dir(FLM.TEST.DIR, pattern = "unitize|fastlm2", interactive.mode = FALSE) 1127s + ) 1127s 1127s Warning in check_call_stack() : 1127s It appears you are running unitizer inside an error handling function such as 1127s `withCallingHanlders`, `tryCatch`, or `withRestarts`. This is strongly dis- 1127s couraged as it may cause unpredictable behavior from unitizer in the event tests 1127s produce conditions / errors. We strongly recommend you re-run your tests 1127s outside of such handling functions. 1128s Warning in history_capt(history, interactive.mode) : 1128s Unable to capture history in non-interactive mode. 1128s | Summary of files in common directory 'unitizer': 1128s | 1128s | Pass Fail 1128s | 1. fastlm2.R 1 - 1128s | *2. unitizer.fastlm.R 1 2 1128s | ................................ 1128s | 2 2 1128s | Legend: 1128s | * `unitizer` requires review 1128s 1128s +------------------------------------------------------------------------------+ 1128s | unitizer for: unitizer/unitizer.fastlm.R | 1128s +------------------------------------------------------------------------------+ 1128s 1128s Pass Fail 1128s 1 2 1128s ...................... 1128s 1 2 1128s 1128s - Failed ----------------------------------------------------------------------- 1128s 1128s | The 2 tests in this section failed because the new evaluations do not match 1128s | the reference values from the store. Overwrite with new results ([Y]es, [N]o, 1128s | [P]rev, [B]rowse, [R]erun, [Q]uit, [H]elp)? 1128s 1128s # Extra test file for internal tests; not for DEMO 1128s 1128s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 1128s > x <- 1:10 1128s > y <- x^3 1128s > res <- fastlm(x, y) 1128s > get_slope(res) 1128s [1] 717379 1128s 1128s | Value mismatch: 1128s 1128s < .ref > .new 1128s @@ 1 @@ @@ 1 @@ 1128s < [1] 105 > [1] 717379 1128s 1128s | State mismatch; see `.DIFF$state` for details. 1128s 1128s > get_intercept(res) 1128s [1] -3945281 1128s 1128s | Value mismatch: 1128s 1128s < .ref > .new 1128s @@ 1 @@ @@ 1 @@ 1128s < [1] -277 > [1] -3945281 1128s 1128s | State mismatch; see `.DIFF$state` for details. 1128s 1128s | User input required to proceed, but we are in non-interactive mode. 1128s 1128s | unitizer unchanged. 1128s 1128s | * Fail: get_slope(res) 1128s | * Fail: get_intercept(res) 1128s | in 'unitizer/unitizer.fastlm.R' 1128s 1128s | Newly evaluated tests do not match unitizer (Pass: 2, Fail: 2); see above for 1128s | more info, or run in interactive mode. 1128s 1128s Error in unitize_core(test.files = test.files, store.ids = store.ids, : 1128s Cannot proceed in non-interactive mode. 1128s > # review all that need review, but don't do anything 1128s > unitizer:::read_line_set_vals(c("A", "Q", "Q", "Q")) 1128s > unitize_dir(FLM.TEST.DIR, interactive.mode = TRUE) 1128s 1128s | Summary of files in common directory 'unitizer': 1128s | 1128s | Pass Fail 1128s | *1. fastlm1.R 2 2 1128s | 2. fastlm2.R 1 - 1128s | *3. unitizer.fastlm.R 1 2 1128s | ................................ 1128s | 4 4 1128s | Legend: 1128s | * `unitizer` requires review 1128s 1128s | Type number of unitizer to review, 'A' to review all that require review 1128s 1128s unitizer> A 1128s 1128s +------------------------------------------------------------------------------+ 1128s | unitizer for: unitizer/fastlm1.R | 1128s +------------------------------------------------------------------------------+ 1128s 1128s Pass Fail 1128s 2 2 1128s ...................... 1128s 2 2 1128s 1128s - Failed ----------------------------------------------------------------------- 1128s 1128s | The 2 tests in this section failed because the new evaluations do not match 1128s | the reference values from the store. Overwrite with new results ([Y]es, [N]o, 1128s | [P]rev, [B]rowse, [R]erun, [QQ]uit All, [Q]uit, [H]elp)? 1128s 1128s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 1128s > dat <- data.frame(x = 1:100, y = (1:100)^2) 1128s > res <- fastlm(dat$x, dat$y) 1128s 1128s # Our fast computations do not produce the same results as our 1128s # original tests so they fail. If you need more detail than the 1128s # provided diff you may use `.new`/`.NEW` or `.ref`/`.REF`. 1128s # 1128s # You should reject these tests by typing 'N' at the prompt since 1128s # they are incorrect. 1128s 1128s > res 1128s intercept slope rsq 1128s -3.54e+13 7.01e+11 9.39e-01 1128s attr(,"class") 1128s [1] "fastlm" 1128s 1128s | Value mismatch: 1128s 1128s < .ref > .new 1128s @@ 1,4 @@ @@ 1,4 @@ 1128s intercept slope rsq intercept slope rsq 1128s < -1717.000 101.000 0.939 > -3.54e+13 7.01e+11 9.39e-01 1128s attr(,"class") attr(,"class") 1128s [1] "fastlm" [1] "fastlm" 1128s 1128s | State mismatch; see `.DIFF$state` for details. 1128s 1128s unitizer> Q 1128s 1128s | No changes recorded. 1128s | unitizer unchanged. 1128s 1128s +------------------------------------------------------------------------------+ 1128s | unitizer for: unitizer/unitizer.fastlm.R | 1128s +------------------------------------------------------------------------------+ 1128s 1128s Pass Fail 1128s 1 2 1128s ...................... 1128s 1 2 1128s 1128s - Failed ----------------------------------------------------------------------- 1128s 1128s | The 2 tests in this section failed because the new evaluations do not match 1128s | the reference values from the store. Overwrite with new results ([Y]es, [N]o, 1128s | [P]rev, [B]rowse, [R]erun, [QQ]uit All, [Q]uit, [H]elp)? 1128s 1128s # Extra test file for internal tests; not for DEMO 1128s 1128s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 1128s > x <- 1:10 1128s > y <- x^3 1128s > res <- fastlm(x, y) 1128s > get_slope(res) 1128s [1] 717379 1128s 1128s | Value mismatch: 1128s 1128s < .ref > .new 1128s @@ 1 @@ @@ 1 @@ 1128s < [1] 105 > [1] 717379 1128s 1128s | State mismatch; see `.DIFF$state` for details. 1128s 1128s unitizer> Q 1128s 1128s | No changes recorded. 1128s | unitizer unchanged. 1128s 1128s | Summary of files in common directory 'unitizer': 1128s | 1128s | Pass Fail 1128s | *1. fastlm1.R 2 2 1128s | 2. fastlm2.R 1 - 1128s | *3. unitizer.fastlm.R 1 2 1128s | ................................ 1128s | 4 4 1128s | Legend: 1128s | * `unitizer` requires review 1128s 1128s | Type number of unitizer to review, 'A' to review all that require review 1128s 1128s unitizer> Q 1128s 1128s > # review all, but don't do anything 1128s > unitizer:::read_line_set_vals(c("AA", "Q", "Q", "Q", "Q")) 1128s > unitize_dir(FLM.TEST.DIR, interactive.mode = TRUE) 1128s 1128s | Summary of files in common directory 'unitizer': 1128s | 1128s | Pass Fail 1128s | *1. fastlm1.R 2 2 1128s | 2. fastlm2.R 1 - 1128s | *3. unitizer.fastlm.R 1 2 1128s | ................................ 1128s | 4 4 1128s | Legend: 1128s | * `unitizer` requires review 1128s 1128s | Type number of unitizer to review, 'A' to review all that require review 1128s 1128s unitizer> AA 1128s 1128s +------------------------------------------------------------------------------+ 1128s | unitizer for: unitizer/fastlm1.R | 1128s +------------------------------------------------------------------------------+ 1128s 1128s Pass Fail 1128s 2 2 1128s ...................... 1128s 2 2 1128s 1128s - Failed ----------------------------------------------------------------------- 1128s 1128s | The 2 tests in this section failed because the new evaluations do not match 1128s | the reference values from the store. Overwrite with new results ([Y]es, [N]o, 1128s | [P]rev, [B]rowse, [R]erun, [QQ]uit All, [Q]uit, [H]elp)? 1128s 1128s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 1128s > dat <- data.frame(x = 1:100, y = (1:100)^2) 1128s > res <- fastlm(dat$x, dat$y) 1128s 1128s # Our fast computations do not produce the same results as our 1128s # original tests so they fail. If you need more detail than the 1128s # provided diff you may use `.new`/`.NEW` or `.ref`/`.REF`. 1128s # 1128s # You should reject these tests by typing 'N' at the prompt since 1128s # they are incorrect. 1128s 1128s > res 1128s intercept slope rsq 1128s -3.54e+13 7.01e+11 9.39e-01 1128s attr(,"class") 1128s [1] "fastlm" 1128s 1129s | Value mismatch: 1129s 1129s < .ref > .new 1129s @@ 1,4 @@ @@ 1,4 @@ 1129s intercept slope rsq intercept slope rsq 1129s < -1717.000 101.000 0.939 > -3.54e+13 7.01e+11 9.39e-01 1129s attr(,"class") attr(,"class") 1129s [1] "fastlm" [1] "fastlm" 1129s 1129s | State mismatch; see `.DIFF$state` for details. 1129s 1129s unitizer> Q 1129s 1129s | No changes recorded. 1129s | unitizer unchanged. 1129s 1129s +------------------------------------------------------------------------------+ 1129s | unitizer for: unitizer/fastlm2.R | 1129s +------------------------------------------------------------------------------+ 1129s 1129s Pass Fail 1129s 1 - 1129s ...................... 1129s 1 - 1129s 1129s *1. x <- 1:10 . . . . . . . . . . . . . . . . . . . -:- 1129s *2. y <- 1:10^3 . . . . . . . . . . . . . . . . . . -:- 1129s *3. res <- summary(lm(y ~ x, data.frame(x = x, y = y))) . . . . . -:- 1129s *4. intercept <- res$coefficients[1, 1] . . . . . . . . . . -:- 1129s *5. slope <- res$coefficients[2, 1] . . . . . . . . . . . -:- 1129s *6. rsq <- res$r.squared . . . . . . . . . . . . . . . -:- 1129s 7. structure(c(intercept = intercept, slope = slope, rsq = rsq),... Passed:- 1129s 1129s | What test do you wish to review (input a test number, [U]nreviewed)? 1129s 1129s unitizer> Q 1129s 1129s | No changes recorded. 1129s | unitizer unchanged. 1129s 1129s +------------------------------------------------------------------------------+ 1129s | unitizer for: unitizer/unitizer.fastlm.R | 1129s +------------------------------------------------------------------------------+ 1129s 1129s Pass Fail 1129s 1 2 1129s ...................... 1129s 1 2 1129s 1129s - Failed ----------------------------------------------------------------------- 1129s 1129s | The 2 tests in this section failed because the new evaluations do not match 1129s | the reference values from the store. Overwrite with new results ([Y]es, [N]o, 1129s | [P]rev, [B]rowse, [R]erun, [QQ]uit All, [Q]uit, [H]elp)? 1129s 1129s # Extra test file for internal tests; not for DEMO 1129s 1129s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 1129s > x <- 1:10 1129s > y <- x^3 1129s > res <- fastlm(x, y) 1129s > get_slope(res) 1129s [1] 717379 1129s 1129s | Value mismatch: 1129s 1129s < .ref > .new 1129s @@ 1 @@ @@ 1 @@ 1129s < [1] 105 > [1] 717379 1129s 1129s | State mismatch; see `.DIFF$state` for details. 1129s 1129s unitizer> Q 1129s 1129s | No changes recorded. 1129s | unitizer unchanged. 1129s 1129s | Summary of files in common directory 'unitizer': 1129s | 1129s | Pass Fail 1129s | *1. fastlm1.R 2 2 1129s | 2. fastlm2.R 1 - 1129s | *3. unitizer.fastlm.R 1 2 1129s | ................................ 1129s | 4 4 1129s | Legend: 1129s | * `unitizer` requires review 1129s 1129s | Type number of unitizer to review, 'A' to review all that require review 1129s 1129s unitizer> Q 1129s 1129s > # review one, and Re-eval despite no change 1129s > unitizer:::read_line_set_vals(c("1", "R", "Y", "Q", "Q")) 1129s > unitize_dir(FLM.TEST.DIR, interactive.mode = TRUE) 1129s 1129s | Summary of files in common directory 'unitizer': 1129s | 1129s | Pass Fail 1129s | *1. fastlm1.R 2 2 1129s | 2. fastlm2.R 1 - 1129s | *3. unitizer.fastlm.R 1 2 1129s | ................................ 1129s | 4 4 1129s | Legend: 1129s | * `unitizer` requires review 1129s 1129s | Type number of unitizer to review, 'A' to review all that require review 1129s 1129s unitizer> 1 1129s +------------------------------------------------------------------------------+ 1129s | unitizer for: unitizer/fastlm1.R | 1129s +------------------------------------------------------------------------------+ 1129s 1129s Pass Fail 1129s 2 2 1129s ...................... 1129s 2 2 1129s 1129s - Failed ----------------------------------------------------------------------- 1129s 1129s | The 2 tests in this section failed because the new evaluations do not match 1129s | the reference values from the store. Overwrite with new results ([Y]es, [N]o, 1129s | [P]rev, [B]rowse, [R]erun, [Q]uit, [H]elp)? 1129s 1129s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 1129s > dat <- data.frame(x = 1:100, y = (1:100)^2) 1129s > res <- fastlm(dat$x, dat$y) 1129s 1129s # Our fast computations do not produce the same results as our 1129s # original tests so they fail. If you need more detail than the 1129s # provided diff you may use `.new`/`.NEW` or `.ref`/`.REF`. 1129s # 1129s # You should reject these tests by typing 'N' at the prompt since 1129s # they are incorrect. 1129s 1129s > res 1129s intercept slope rsq 1129s -3.54e+13 7.01e+11 9.39e-01 1129s attr(,"class") 1129s [1] "fastlm" 1129s 1129s | Value mismatch: 1129s 1129s < .ref > .new 1129s @@ 1,4 @@ @@ 1,4 @@ 1129s intercept slope rsq intercept slope rsq 1129s < -1717.000 101.000 0.939 > -3.54e+13 7.01e+11 9.39e-01 1129s attr(,"class") attr(,"class") 1129s [1] "fastlm" [1] "fastlm" 1129s 1129s | State mismatch; see `.DIFF$state` for details. 1129s 1129s unitizer> R 1129s 1129s | Toggling re-run mode ON for this unitizer 1129s 1129s = Finalize Unitizer ============================================================ 1129s 1129s | You have 2 unreviewed tests; press `B` to browse tests, `U` to go to first 1129s | unreviewed test. 1129s 1129s | You made no changes to the unitizer so there is no need to update it. While 1129s | unnecessary, you can force an update by typing O at the prompt. 1129s 1129s | Re-run unitizer ([Y]es, [P]rev, [B]rowse, [U]nreviewed, [R]erun, f[O]rce)? 1129s 1129s unitizer> Y 1129s 1129s | unitizer unchanged. 1129s 1129s +------------------------------------------------------------------------------+ 1129s | unitizer for: unitizer/fastlm1.R | 1129s +------------------------------------------------------------------------------+ 1129s 1129s Pass Fail 1129s 2 2 1129s ...................... 1129s 2 2 1129s 1129s - Failed ----------------------------------------------------------------------- 1129s 1129s | The 2 tests in this section failed because the new evaluations do not match 1129s | the reference values from the store. Overwrite with new results ([Y]es, [N]o, 1129s | [P]rev, [B]rowse, [R]erun, [Q]uit, [H]elp)? 1129s 1129s | Jumping to test #4 because that was the test under review when test re-run was 1129s | requested. 1129s 1129s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 1129s > dat <- data.frame(x = 1:100, y = (1:100)^2) 1129s > res <- fastlm(dat$x, dat$y) 1129s 1129s # Our fast computations do not produce the same results as our 1129s # original tests so they fail. If you need more detail than the 1129s # provided diff you may use `.new`/`.NEW` or `.ref`/`.REF`. 1129s # 1129s # You should reject these tests by typing 'N' at the prompt since 1129s # they are incorrect. 1129s 1129s > res 1129s intercept slope rsq 1129s -3.54e+13 7.01e+11 9.39e-01 1129s attr(,"class") 1129s [1] "fastlm" 1129s 1129s | Value mismatch: 1129s 1129s < .ref > .new 1129s @@ 1,4 @@ @@ 1,4 @@ 1129s intercept slope rsq intercept slope rsq 1129s < -1717.000 101.000 0.939 > -3.54e+13 7.01e+11 9.39e-01 1129s attr(,"class") attr(,"class") 1129s [1] "fastlm" [1] "fastlm" 1129s 1129s | State mismatch; see `.DIFF$state` for details. 1129s 1129s unitizer> Q 1129s 1129s | No changes recorded. 1129s | unitizer unchanged. 1129s 1129s | Summary of files in common directory 'unitizer': 1129s | 1129s | Pass Fail 1130s | *1. fastlm1.R 2 2 1130s | 2. fastlm2.R 1 - 1130s | *3. unitizer.fastlm.R 1 2 1130s | ................................ 1130s | 4 4 1130s | Legend: 1130s | * `unitizer` requires review 1130s 1130s | Type number of unitizer to review, 'A' to review all that require review 1130s 1130s unitizer> Q 1130s 1130s > unitizer:::read_line_set_vals(c("1", "RR", "Y", "Q", "Q")) 1130s > unitize_dir(FLM.TEST.DIR, interactive.mode = TRUE) 1130s 1130s | Summary of files in common directory 'unitizer': 1130s | 1130s | Pass Fail 1130s | *1. fastlm1.R 2 2 1130s | 2. fastlm2.R 1 - 1130s | *3. unitizer.fastlm.R 1 2 1130s | ................................ 1130s | 4 4 1130s | Legend: 1130s | * `unitizer` requires review 1130s 1130s | Type number of unitizer to review, 'A' to review all that require review 1130s 1130s unitizer> 1 1130s +------------------------------------------------------------------------------+ 1130s | unitizer for: unitizer/fastlm1.R | 1130s +------------------------------------------------------------------------------+ 1130s 1130s Pass Fail 1130s 2 2 1130s ...................... 1130s 2 2 1130s 1130s - Failed ----------------------------------------------------------------------- 1130s 1130s | The 2 tests in this section failed because the new evaluations do not match 1130s | the reference values from the store. Overwrite with new results ([Y]es, [N]o, 1130s | [P]rev, [B]rowse, [R]erun, [Q]uit, [H]elp)? 1130s 1130s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 1130s > dat <- data.frame(x = 1:100, y = (1:100)^2) 1130s > res <- fastlm(dat$x, dat$y) 1130s 1130s # Our fast computations do not produce the same results as our 1130s # original tests so they fail. If you need more detail than the 1130s # provided diff you may use `.new`/`.NEW` or `.ref`/`.REF`. 1130s # 1130s # You should reject these tests by typing 'N' at the prompt since 1130s # they are incorrect. 1130s 1130s > res 1130s intercept slope rsq 1130s -3.54e+13 7.01e+11 9.39e-01 1130s attr(,"class") 1130s [1] "fastlm" 1130s 1130s | Value mismatch: 1130s 1130s < .ref > .new 1130s @@ 1,4 @@ @@ 1,4 @@ 1130s intercept slope rsq intercept slope rsq 1130s < -1717.000 101.000 0.939 > -3.54e+13 7.01e+11 9.39e-01 1130s attr(,"class") attr(,"class") 1130s [1] "fastlm" [1] "fastlm" 1130s 1130s | State mismatch; see `.DIFF$state` for details. 1130s 1130s unitizer> RR 1130s 1130s | Toggling re-run mode ON for all loaded unitizers 1130s 1130s = Finalize Unitizer ============================================================ 1130s 1130s | You have 2 unreviewed tests; press `B` to browse tests, `U` to go to first 1130s | unreviewed test. 1130s 1130s | You made no changes to the unitizer so there is no need to update it. While 1130s | unnecessary, you can force an update by typing O at the prompt. 1130s 1130s | Re-run all loaded unitizers ([Y]es, [P]rev, [B]rowse, [U]nreviewed, [R]erun, 1130s | f[O]rce)? 1130s 1130s unitizer> Y 1130s 1130s | unitizer unchanged. 1130s 1130s | Summary of files in common directory 'unitizer': 1130s | 1130s | Pass Fail 1130s | *1. fastlm1.R 2 2 1130s | 2. fastlm2.R 1 - 1130s | *3. unitizer.fastlm.R 1 2 1130s | ................................ 1130s | 4 4 1130s | Legend: 1130s | * `unitizer` requires review 1130s 1130s | Type number of unitizer to review, 'A' to review all that require review 1130s 1130s unitizer> Q 1130s 1130s > # Test force eval 1130s > # first run, force update and accept 1130s > # second run, R from dir summary doesn't set bookmarks 1130s > unitizer:::read_line_set_vals(c("1", "O", "Q", "Y", "R", "1", 1130s + "Q", "Q")) 1130s > unitize_dir(FLM.TEST.DIR, interactive.mode = TRUE) 1130s 1131s | Summary of files in common directory 'unitizer': 1131s | 1131s | Pass Fail 1131s | *1. fastlm1.R 2 2 1131s | 2. fastlm2.R 1 - 1131s | *3. unitizer.fastlm.R 1 2 1131s | ................................ 1131s | 4 4 1131s | Legend: 1131s | * `unitizer` requires review 1131s 1131s | Type number of unitizer to review, 'A' to review all that require review 1131s 1131s unitizer> 1 1131s +------------------------------------------------------------------------------+ 1131s | unitizer for: unitizer/fastlm1.R | 1131s +------------------------------------------------------------------------------+ 1131s 1131s Pass Fail 1131s 2 2 1131s ...................... 1131s 2 2 1131s 1131s - Failed ----------------------------------------------------------------------- 1131s 1131s | The 2 tests in this section failed because the new evaluations do not match 1131s | the reference values from the store. Overwrite with new results ([Y]es, [N]o, 1131s | [P]rev, [B]rowse, [R]erun, [Q]uit, [H]elp)? 1131s 1131s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 1131s > dat <- data.frame(x = 1:100, y = (1:100)^2) 1131s > res <- fastlm(dat$x, dat$y) 1131s 1131s # Our fast computations do not produce the same results as our 1131s # original tests so they fail. If you need more detail than the 1131s # provided diff you may use `.new`/`.NEW` or `.ref`/`.REF`. 1131s # 1131s # You should reject these tests by typing 'N' at the prompt since 1131s # they are incorrect. 1131s 1131s > res 1131s intercept slope rsq 1131s -3.54e+13 7.01e+11 9.39e-01 1131s attr(,"class") 1131s [1] "fastlm" 1131s 1131s | Value mismatch: 1131s 1131s < .ref > .new 1131s @@ 1,4 @@ @@ 1,4 @@ 1131s intercept slope rsq intercept slope rsq 1131s < -1717.000 101.000 0.939 > -3.54e+13 7.01e+11 9.39e-01 1131s attr(,"class") attr(,"class") 1131s [1] "fastlm" [1] "fastlm" 1131s 1131s | State mismatch; see `.DIFF$state` for details. 1131s 1131s unitizer> O 1131s 1131s | Toggling force update mode ON 1131s 1131s unitizer> Q 1131s 1131s = Finalize Unitizer ============================================================ 1131s 1131s | You have 2 unreviewed tests; press `B` to browse tests, `U` to go to first 1131s | unreviewed test. 1131s 1131s | Running in `force.update` mode so `unitizer` will be re-saved even though 1131s | there are no changes to record (see `?unitize` for details). 1131s 1131s | You are about to update 'unitizer/fastlm1.unitizer' with re-evaluated but 1131s | otherwise unchanged tests. 1131s 1131s | Update unitizer ([Y]es, [N]o, [P]rev, [B]rowse, [U]nreviewed, [R]erun, 1131s | f[O]rce)? 1131s 1131s unitizer> Y 1131s 1131s | unitizer updated. 1131s 1131s | Summary of files in common directory 'unitizer': 1131s | 1131s | Pass Fail 1131s | $1. fastlm1.R ? ? 1131s | 2. fastlm2.R 1 - 1131s | *3. unitizer.fastlm.R 1 2 1131s | ................................ 1131s | ? ? 1131s | Legend: 1131s | * `unitizer` requires review 1131s | $ `unitizer` has been modified and needs to be re-run to recompute summary 1131s 1131s | Type number of unitizer to review, 'A' to review all that require review, 'R' 1131s | to re-run all updated 1131s 1131s unitizer> R 1131s 1131s | Summary of files in common directory 'unitizer': 1131s | 1131s | Pass Fail 1131s | *1. fastlm1.R 2 2 1131s | 2. fastlm2.R 1 - 1131s | *3. unitizer.fastlm.R 1 2 1131s | ................................ 1131s | 4 4 1131s | Legend: 1131s | * `unitizer` requires review 1131s 1131s | Type number of unitizer to review, 'A' to review all that require review 1131s 1131s unitizer> 1 1131s +------------------------------------------------------------------------------+ 1131s | unitizer for: unitizer/fastlm1.R | 1131s +------------------------------------------------------------------------------+ 1131s 1131s Pass Fail 1131s 2 2 1131s ...................... 1131s 2 2 1131s 1131s - Failed ----------------------------------------------------------------------- 1131s 1131s | The 2 tests in this section failed because the new evaluations do not match 1131s | the reference values from the store. Overwrite with new results ([Y]es, [N]o, 1131s | [P]rev, [B]rowse, [R]erun, [Q]uit, [H]elp)? 1131s 1131s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 1131s > dat <- data.frame(x = 1:100, y = (1:100)^2) 1131s > res <- fastlm(dat$x, dat$y) 1131s 1131s # Our fast computations do not produce the same results as our 1131s # original tests so they fail. If you need more detail than the 1131s # provided diff you may use `.new`/`.NEW` or `.ref`/`.REF`. 1131s # 1131s # You should reject these tests by typing 'N' at the prompt since 1131s # they are incorrect. 1131s 1131s > res 1131s intercept slope rsq 1131s -3.54e+13 7.01e+11 9.39e-01 1131s attr(,"class") 1131s [1] "fastlm" 1131s 1131s | Value mismatch: 1131s 1131s < .ref > .new 1131s @@ 1,4 @@ @@ 1,4 @@ 1131s intercept slope rsq intercept slope rsq 1131s < -1717.000 101.000 0.939 > -3.54e+13 7.01e+11 9.39e-01 1131s attr(,"class") attr(,"class") 1131s [1] "fastlm" [1] "fastlm" 1131s 1131s | State mismatch; see `.DIFF$state` for details. 1131s 1131s unitizer> Q 1131s 1131s | No changes recorded. 1131s | unitizer unchanged. 1131s 1131s | Summary of files in common directory 'unitizer': 1131s | 1131s | Pass Fail 1131s | *1. fastlm1.R 2 2 1131s | 2. fastlm2.R 1 - 1131s | *3. unitizer.fastlm.R 1 2 1131s | ................................ 1131s | 4 4 1131s | Legend: 1131s | * `unitizer` requires review 1131s 1131s | Type number of unitizer to review, 'A' to review all that require review 1131s 1131s unitizer> Q 1131s 1131s > # Variations on YY, YYY, and YYY 1131s > unitizer:::read_line_set_vals(c("1", "YY", "Y", "Q", "Q")) 1131s > unitize_dir(FLM.TEST.DIR, interactive.mode = TRUE) 1131s 1131s | Summary of files in common directory 'unitizer': 1131s | 1131s | Pass Fail 1131s | *1. fastlm1.R 2 2 1131s | 2. fastlm2.R 1 - 1131s | *3. unitizer.fastlm.R 1 2 1131s | ................................ 1131s | 4 4 1131s | Legend: 1131s | * `unitizer` requires review 1131s 1131s | Type number of unitizer to review, 'A' to review all that require review 1131s 1131s unitizer> 1 1131s +------------------------------------------------------------------------------+ 1131s | unitizer for: unitizer/fastlm1.R | 1131s +------------------------------------------------------------------------------+ 1131s 1131s Pass Fail 1131s 2 2 1131s ...................... 1131s 2 2 1131s 1131s - Failed ----------------------------------------------------------------------- 1131s 1131s | The 2 tests in this section failed because the new evaluations do not match 1131s | the reference values from the store. Overwrite with new results ([Y]es, [N]o, 1131s | [P]rev, [B]rowse, [R]erun, [Q]uit, [H]elp)? 1131s 1131s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 1131s > dat <- data.frame(x = 1:100, y = (1:100)^2) 1131s > res <- fastlm(dat$x, dat$y) 1131s 1131s # Our fast computations do not produce the same results as our 1131s # original tests so they fail. If you need more detail than the 1131s # provided diff you may use `.new`/`.NEW` or `.ref`/`.REF`. 1131s # 1131s # You should reject these tests by typing 'N' at the prompt since 1131s # they are incorrect. 1131s 1131s > res 1131s intercept slope rsq 1131s -3.54e+13 7.01e+11 9.39e-01 1131s attr(,"class") 1131s [1] "fastlm" 1131s 1131s | Value mismatch: 1131s 1131s < .ref > .new 1131s @@ 1,4 @@ @@ 1,4 @@ 1131s intercept slope rsq intercept slope rsq 1131s < -1717.000 101.000 0.939 > -3.54e+13 7.01e+11 9.39e-01 1131s attr(,"class") attr(,"class") 1131s [1] "fastlm" [1] "fastlm" 1131s 1131s | State mismatch; see `.DIFF$state` for details. 1131s 1131s unitizer> YY 1131s 1131s 4. res . . . . . Failed:- 1131s 5. get_slope(res) . Failed:- 1131s 1131s Choose 'Y' for the 2 tests shown above ([Y]es, [N]o)? 1131s unitizer> Y 1131s 1131s = Finalize Unitizer ============================================================ 1131s 1131s | You will IRREVERSIBLY modify 'unitizer/fastlm1.unitizer' by: 1131s | - Replacing 2 out of 2 failed tests 1131s 1131s | Update unitizer ([Y]es, [N]o, [P]rev, [B]rowse, [R]erun)? 1131s 1131s unitizer> Q 1131s 1131s | Changes discarded. 1131s | unitizer unchanged. 1131s 1131s | Summary of files in common directory 'unitizer': 1131s | 1131s | Pass Fail 1131s | *1. fastlm1.R 2 2 1131s | 2. fastlm2.R 1 - 1131s | *3. unitizer.fastlm.R 1 2 1131s | ................................ 1131s | 4 4 1131s | Legend: 1131s | * `unitizer` requires review 1131s 1131s | Type number of unitizer to review, 'A' to review all that require review 1131s 1131s unitizer> Q 1131s 1131s > unitizer:::read_line_set_vals(c("1", "YYY", "Y", "Q", "Q")) 1131s > unitize_dir(FLM.TEST.DIR, interactive.mode = TRUE) 1131s 1132s | Summary of files in common directory 'unitizer': 1132s | 1132s | Pass Fail 1132s | *1. fastlm1.R 2 2 1132s | 2. fastlm2.R 1 - 1132s | *3. unitizer.fastlm.R 1 2 1132s | ................................ 1132s | 4 4 1132s | Legend: 1132s | * `unitizer` requires review 1132s 1132s | Type number of unitizer to review, 'A' to review all that require review 1132s 1132s unitizer> 1 1132s +------------------------------------------------------------------------------+ 1132s | unitizer for: unitizer/fastlm1.R | 1132s +------------------------------------------------------------------------------+ 1132s 1132s Pass Fail 1132s 2 2 1132s ...................... 1132s 2 2 1132s 1132s - Failed ----------------------------------------------------------------------- 1132s 1132s | The 2 tests in this section failed because the new evaluations do not match 1132s | the reference values from the store. Overwrite with new results ([Y]es, [N]o, 1132s | [P]rev, [B]rowse, [R]erun, [Q]uit, [H]elp)? 1132s 1132s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 1132s > dat <- data.frame(x = 1:100, y = (1:100)^2) 1132s > res <- fastlm(dat$x, dat$y) 1132s 1132s # Our fast computations do not produce the same results as our 1132s # original tests so they fail. If you need more detail than the 1132s # provided diff you may use `.new`/`.NEW` or `.ref`/`.REF`. 1132s # 1132s # You should reject these tests by typing 'N' at the prompt since 1132s # they are incorrect. 1132s 1132s > res 1132s intercept slope rsq 1132s -3.54e+13 7.01e+11 9.39e-01 1132s attr(,"class") 1132s [1] "fastlm" 1132s 1132s | Value mismatch: 1132s 1132s < .ref > .new 1132s @@ 1,4 @@ @@ 1,4 @@ 1132s intercept slope rsq intercept slope rsq 1132s < -1717.000 101.000 0.939 > -3.54e+13 7.01e+11 9.39e-01 1132s attr(,"class") attr(,"class") 1132s [1] "fastlm" [1] "fastlm" 1132s 1132s | State mismatch; see `.DIFF$state` for details. 1132s 1132s unitizer> YYY 1132s 1132s 4. res . . . . . Failed:- 1132s 5. get_slope(res) . Failed:- 1132s 1132s Choose 'Y' for the 2 tests shown above ([Y]es, [N]o)? 1132s unitizer> Y 1132s 1132s = Finalize Unitizer ============================================================ 1132s 1132s | You will IRREVERSIBLY modify 'unitizer/fastlm1.unitizer' by: 1132s | - Replacing 2 out of 2 failed tests 1132s 1132s | Update unitizer ([Y]es, [N]o, [P]rev, [B]rowse, [R]erun)? 1132s 1132s unitizer> Q 1132s 1132s | Changes discarded. 1132s | unitizer unchanged. 1132s 1132s | Summary of files in common directory 'unitizer': 1132s | 1132s | Pass Fail 1132s | *1. fastlm1.R 2 2 1132s | 2. fastlm2.R 1 - 1132s | *3. unitizer.fastlm.R 1 2 1132s | ................................ 1132s | 4 4 1132s | Legend: 1132s | * `unitizer` requires review 1132s 1132s | Type number of unitizer to review, 'A' to review all that require review 1132s 1132s unitizer> Q 1132s 1132s > unitizer:::read_line_set_vals(c("1", "YYYY", "Y", "Q", "Q")) 1132s > unitize_dir(FLM.TEST.DIR, interactive.mode = TRUE) 1132s 1132s | Summary of files in common directory 'unitizer': 1132s | 1132s | Pass Fail 1132s | *1. fastlm1.R 2 2 1132s | 2. fastlm2.R 1 - 1132s | *3. unitizer.fastlm.R 1 2 1132s | ................................ 1132s | 4 4 1132s | Legend: 1132s | * `unitizer` requires review 1132s 1132s | Type number of unitizer to review, 'A' to review all that require review 1132s 1132s unitizer> 1 1132s +------------------------------------------------------------------------------+ 1132s | unitizer for: unitizer/fastlm1.R | 1132s +------------------------------------------------------------------------------+ 1132s 1132s Pass Fail 1132s 2 2 1132s ...................... 1132s 2 2 1132s 1132s - Failed ----------------------------------------------------------------------- 1132s 1132s | The 2 tests in this section failed because the new evaluations do not match 1132s | the reference values from the store. Overwrite with new results ([Y]es, [N]o, 1132s | [P]rev, [B]rowse, [R]erun, [Q]uit, [H]elp)? 1132s 1132s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 1132s > dat <- data.frame(x = 1:100, y = (1:100)^2) 1132s > res <- fastlm(dat$x, dat$y) 1132s 1132s # Our fast computations do not produce the same results as our 1132s # original tests so they fail. If you need more detail than the 1132s # provided diff you may use `.new`/`.NEW` or `.ref`/`.REF`. 1132s # 1132s # You should reject these tests by typing 'N' at the prompt since 1132s # they are incorrect. 1132s 1132s > res 1132s intercept slope rsq 1132s -3.54e+13 7.01e+11 9.39e-01 1132s attr(,"class") 1132s [1] "fastlm" 1132s 1132s | Value mismatch: 1132s 1132s < .ref > .new 1132s @@ 1,4 @@ @@ 1,4 @@ 1132s intercept slope rsq intercept slope rsq 1132s < -1717.000 101.000 0.939 > -3.54e+13 7.01e+11 9.39e-01 1132s attr(,"class") attr(,"class") 1132s [1] "fastlm" [1] "fastlm" 1132s 1132s | State mismatch; see `.DIFF$state` for details. 1132s 1132s unitizer> YYYY 1132s 1132s 4. res . . . . . Failed:- 1132s 5. get_slope(res) . Failed:- 1132s 1132s Choose 'Y' for the 2 tests shown above ([Y]es, [N]o)? 1132s unitizer> Y 1132s 1132s = Finalize Unitizer ============================================================ 1132s 1132s | You will IRREVERSIBLY modify 'unitizer/fastlm1.unitizer' by: 1132s | - Replacing 2 out of 2 failed tests 1132s 1132s | Update unitizer ([Y]es, [N]o, [P]rev, [B]rowse, [R]erun)? 1132s 1132s unitizer> Q 1132s 1132s | Changes discarded. 1132s | unitizer unchanged. 1132s 1132s | Summary of files in common directory 'unitizer': 1132s | 1132s | Pass Fail 1132s | *1. fastlm1.R 2 2 1132s | 2. fastlm2.R 1 - 1132s | *3. unitizer.fastlm.R 1 2 1132s | ................................ 1132s | 4 4 1132s | Legend: 1132s | * `unitizer` requires review 1132s 1132s | Type number of unitizer to review, 'A' to review all that require review 1132s 1132s unitizer> Q 1132s 1132s > # review all, accepting all changes, and reevaluting everything; note that this 1132s > # means we're accepting tests that are not correct 1132s > unitizer:::read_line_set_vals(c("A", "Y", "Y", "Y", "Y", "Y", "Y", "RR")) 1132s > unitize_dir(FLM.TEST.DIR, interactive.mode = TRUE) 1132s 1132s | Summary of files in common directory 'unitizer': 1132s | 1132s | Pass Fail 1132s | *1. fastlm1.R 2 2 1132s | 2. fastlm2.R 1 - 1132s | *3. unitizer.fastlm.R 1 2 1132s | ................................ 1132s | 4 4 1132s | Legend: 1132s | * `unitizer` requires review 1132s 1132s | Type number of unitizer to review, 'A' to review all that require review 1132s 1132s unitizer> A 1132s 1132s +------------------------------------------------------------------------------+ 1132s | unitizer for: unitizer/fastlm1.R | 1132s +------------------------------------------------------------------------------+ 1132s 1132s Pass Fail 1132s 2 2 1132s ...................... 1132s 2 2 1132s 1132s - Failed ----------------------------------------------------------------------- 1132s 1132s | The 2 tests in this section failed because the new evaluations do not match 1132s | the reference values from the store. Overwrite with new results ([Y]es, [N]o, 1132s | [P]rev, [B]rowse, [R]erun, [QQ]uit All, [Q]uit, [H]elp)? 1132s 1132s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 1132s > dat <- data.frame(x = 1:100, y = (1:100)^2) 1132s > res <- fastlm(dat$x, dat$y) 1132s 1132s # Our fast computations do not produce the same results as our 1132s # original tests so they fail. If you need more detail than the 1132s # provided diff you may use `.new`/`.NEW` or `.ref`/`.REF`. 1132s # 1132s # You should reject these tests by typing 'N' at the prompt since 1132s # they are incorrect. 1132s 1132s > res 1132s intercept slope rsq 1132s -3.54e+13 7.01e+11 9.39e-01 1132s attr(,"class") 1132s [1] "fastlm" 1132s 1132s | Value mismatch: 1132s 1132s < .ref > .new 1132s @@ 1,4 @@ @@ 1,4 @@ 1132s intercept slope rsq intercept slope rsq 1132s < -1717.000 101.000 0.939 > -3.54e+13 7.01e+11 9.39e-01 1132s attr(,"class") attr(,"class") 1132s [1] "fastlm" [1] "fastlm" 1132s 1132s | State mismatch; see `.DIFF$state` for details. 1132s 1132s unitizer> Y 1132s 1132s # This one is also incorrect; reject with 'N' 1132s 1132s > get_slope(res) 1132s [1] 7.01e+11 1132s 1132s | Value mismatch: 1132s 1132s < .ref > .new 1132s @@ 1 @@ @@ 1 @@ 1132s < [1] 101 > [1] 7.01e+11 1132s 1132s | State mismatch; see `.DIFF$state` for details. 1132s 1132s unitizer> Y 1132s 1132s = Finalize Unitizer ============================================================ 1132s 1132s | You will IRREVERSIBLY modify 'unitizer/fastlm1.unitizer' by: 1132s | - Replacing 2 out of 2 failed tests 1132s 1132s | Update unitizer ([Y]es, [N]o, [P]rev, [B]rowse, [R]erun, [QQ]uit All)? 1132s 1132s unitizer> Y 1132s 1132s | unitizer updated. 1132s 1132s +------------------------------------------------------------------------------+ 1132s | unitizer for: unitizer/unitizer.fastlm.R | 1132s +------------------------------------------------------------------------------+ 1132s 1132s Pass Fail 1132s 1 2 1132s ...................... 1132s 1 2 1132s 1132s - Failed ----------------------------------------------------------------------- 1132s 1132s | The 2 tests in this section failed because the new evaluations do not match 1132s | the reference values from the store. Overwrite with new results ([Y]es, [N]o, 1132s | [P]rev, [B]rowse, [R]erun, [QQ]uit All, [Q]uit, [H]elp)? 1132s 1132s # Extra test file for internal tests; not for DEMO 1132s 1132s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 1132s > x <- 1:10 1132s > y <- x^3 1132s > res <- fastlm(x, y) 1132s > get_slope(res) 1132s [1] 717379 1132s 1132s | Value mismatch: 1132s 1132s < .ref > .new 1132s @@ 1 @@ @@ 1 @@ 1132s < [1] 105 > [1] 717379 1132s 1132s | State mismatch; see `.DIFF$state` for details. 1132s 1132s unitizer> Y 1132s 1132s > get_intercept(res) 1132s [1] -3945281 1132s 1133s | Value mismatch: 1133s 1133s < .ref > .new 1133s @@ 1 @@ @@ 1 @@ 1133s < [1] -277 > [1] -3945281 1133s 1133s | State mismatch; see `.DIFF$state` for details. 1133s 1133s unitizer> Y 1133s 1133s = Finalize Unitizer ============================================================ 1133s 1133s | You will IRREVERSIBLY modify 'unitizer/unitizer.fastlm.unitizer' by: 1133s | - Replacing 2 out of 2 failed tests 1133s 1133s | Update unitizer ([Y]es, [N]o, [P]rev, [B]rowse, [R]erun, [QQ]uit All)? 1133s 1133s unitizer> Y 1133s 1133s | unitizer updated. 1133s 1133s | Summary of files in common directory 'unitizer': 1133s | 1133s | Pass Fail 1133s | $1. fastlm1.R ? ? 1133s | 2. fastlm2.R 1 - 1133s | $3. unitizer.fastlm.R ? ? 1133s | ................................ 1133s | ? ? 1133s | Legend: 1133s | $ `unitizer` has been modified and needs to be re-run to recompute summary 1133s 1133s | Type number of unitizer to review, 'A' to review all that require review, 'R' 1133s | to re-run all updated 1133s 1133s unitizer> RR 1133s 1133s | Summary of files in common directory 'unitizer': 1133s | 1133s | Pass Fail 1133s | 1. fastlm1.R 4 - 1133s | 2. fastlm2.R 1 - 1133s | 3. unitizer.fastlm.R 3 - 1133s | ................................ 1133s | 8 - 1133s 1133s | 8/8 tests passed; nothing to review. 1133s 1133s > 1133s > # - "multi-sect" --------------------------------------------------------------- 1133s > 1133s > # Upgrade again, and try with deleted tests and other things 1133s > update_fastlm(FLM, version = "0.1.2") 1133s > inst_pak(FLM) 1134s > unitizer:::read_line_set_vals(c("3", "ref(res)", "Y", "Y", "B", 1134s + "1", "B", "U", "Y", "RR", "Y", "Q")) 1134s > txt20 <- unitizer:::capture_output(unitize_dir(FLM.TEST.DIR, interactive.mode = TRUE)) 1134s > txt20$output <- gsub("^<\\w+: .*?>", "", txt20$output) 1134s > txt20 1134s - Output ----------------------------------------------------------------------- 1134s 1134s 1134s | Summary of files in common directory 'unitizer': 1134s | 1134s | Pass Fail New Del 1134s | *1. fastlm1.R 2 2 - - 1134s | 2. fastlm2.R 1 - - - 1134s | *3. unitizer.fastlm.R 1 1 1 1 1134s | .......................................... 1134s | 4 3 1 1 1134s | Legend: 1134s | * `unitizer` requires review 1134s 1134s | Type number of unitizer to review, 'A' to review all that require review 1134s 1134s unitizer> 3 1134s +------------------------------------------------------------------------------+ 1134s | unitizer for: unitizer/unitizer.fastlm.R | 1134s +------------------------------------------------------------------------------+ 1134s 1134s Pass Fail New Del 1134s - - - 1 1134s Basic Tests - 1 - - 1134s Advanced Tests 1 - 1 - 1134s .................................... 1134s 1 1 1 1 1134s 1134s = =================================================================== 1134s 1134s - Removed ---------------------------------------------------------------------- 1134s 1134s | The following test exists in the unitizer store but not in the new test 1134s | script. Remove test from store ([Y]es, [N]o, [P]rev, [B]rowse, [R]erun, 1134s | [Q]uit, [H]elp)? 1134s 1134s > get_intercept(res) 1134s [1] -3945281 1134s 1134s unitizer> ref(res) 1134s unitizer> Y 1134s 1134s = Basic Tests ================================================================== 1134s 1134s - Failed ----------------------------------------------------------------------- 1134s 1134s | The following test failed because the new evaluation does not match the 1134s | reference value from the store. Overwrite with new result ([Y]es, [N]o, 1134s | [P]rev, [B]rowse, [R]erun, [Q]uit, [H]elp)? 1134s 1134s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 1134s > x <- 1:10 1134s > y <- x^3 1134s > res <- fastlm(x, y) 1134s > get_slope(res) 1134s [1] 105 1134s 1134s | Value mismatch: 1134s 1134s < .ref > .new 1134s @@ 1 @@ @@ 1 @@ 1134s < [1] 717379 > [1] 105 1134s 1134s | State mismatch; see `.DIFF$state` for details. 1134s 1134s unitizer> Y 1134s 1134s = Advanced Tests =============================================================== 1134s 1134s - New -------------------------------------------------------------------------- 1134s 1134s | The following test is new. Add test to store ([Y]es, [N]o, [P]rev, [B]rowse, 1134s | [R]erun, [Q]uit, [H]elp)? 1134s 1134s > 2 * get_slope(res) + get_intercept(res) 1134s [1] -66.4 1134s 1134s unitizer> B 1134s 1134s = =================================================================== 1134s 8. get_intercept(res) . . . . . . . . . . . . . . . Removed:Y 1134s = Basic Tests ================================================================== 1134s *1. library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) . -:- 1134s *2. x <- 1:10 . . . . . . . . . . . . . . . . . . -:- 1134s *3. y <- x^3 . . . . . . . . . . . . . . . . . . -:- 1134s *4. res <- fastlm(x, y) . . . . . . . . . . . . . . -:- 1134s 5. get_slope(res) . . . . . . . . . . . . . . . . Failed:Y 1134s = Advanced Tests =============================================================== 1134s 6. 2 * get_slope(res) + get_intercept(res) . . . . . . . . New:- 1134s 7. get_rsq(res) . . . . . . . . . . . . . . . . . Passed:- 1134s 1134s | What test do you wish to review (input a test number, [U]nreviewed)? 1134s 1134s unitizer> 1 1134s 1134s = Basic Tests ================================================================== 1134s 1134s - Failed ----------------------------------------------------------------------- 1134s 1134s | The following test failed because the new evaluation does not match the 1134s | reference value from the store. Overwrite with new result ([Y]es, [N]o, 1134s | [P]rev, [B]rowse, [R]erun, [Q]uit, [H]elp)? 1134s 1134s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 1134s unitizer> B 1134s 1134s = =================================================================== 1134s 8. get_intercept(res) . . . . . . . . . . . . . . . Removed:Y 1134s = Basic Tests ================================================================== 1134s *1. library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) . -:- 1134s *2. x <- 1:10 . . . . . . . . . . . . . . . . . . -:- 1134s *3. y <- x^3 . . . . . . . . . . . . . . . . . . -:- 1134s *4. res <- fastlm(x, y) . . . . . . . . . . . . . . -:- 1134s 5. get_slope(res) . . . . . . . . . . . . . . . . Failed:Y 1134s = Advanced Tests =============================================================== 1134s 6. 2 * get_slope(res) + get_intercept(res) . . . . . . . . New:- 1134s 7. get_rsq(res) . . . . . . . . . . . . . . . . . Passed:- 1134s 1134s | What test do you wish to review (input a test number, [U]nreviewed)? 1134s 1134s unitizer> U 1134s 1134s = Advanced Tests =============================================================== 1134s 1134s - New -------------------------------------------------------------------------- 1134s 1134s | The following test is new. Add test to store ([Y]es, [N]o, [P]rev, [B]rowse, 1134s | [R]erun, [Q]uit, [H]elp)? 1134s 1134s > 2 * get_slope(res) + get_intercept(res) 1134s [1] -66.4 1134s 1134s unitizer> Y 1134s 1134s = Finalize Unitizer ============================================================ 1134s 1134s | Update unitizer ([Y]es, [N]o, [P]rev, [B]rowse, [R]erun)? 1134s 1134s unitizer> RR 1134s 1134s | Update unitizer and re-run all loaded unitizers ([Y]es, [N]o, [P]rev, [B] 1134s | rowse, [R]erun)? 1134s 1134s unitizer> Y 1134s 1134s | Summary of files in common directory 'unitizer': 1134s | 1134s | Pass Fail 1134s | *1. fastlm1.R 2 2 1134s | 2. fastlm2.R 1 - 1134s | 3. unitizer.fastlm.R 3 - 1134s | ................................ 1134s | 6 2 1134s | Legend: 1134s | * `unitizer` requires review 1134s 1134s | Type number of unitizer to review, 'A' to review all that require review 1134s 1134s unitizer> Q 1134s 1134s - Message ---------------------------------------------------------------------- 1134s 1134s `ref` is only active when there is an active secondary environment 1134s | You selected a test that is not normally reviewed in this mode; 1134s | as such, upon test completion, you will be brought back to this menu 1134s | instead of being taken to the next reviewable test. 1134s 1134s | You will IRREVERSIBLY modify 'unitizer/unitizer.fastlm.unitizer' by: 1134s | - Replacing 1 out of 1 failed tests 1134s | - Adding 1 out of 1 new tests 1134s | - Removing 1 out of 1 removed tests 1134s 1134s | Toggling re-run mode ON for all loaded unitizers 1134s 1134s | You will IRREVERSIBLY modify 'unitizer/unitizer.fastlm.unitizer' by: 1134s | - Replacing 1 out of 1 failed tests 1134s | - Adding 1 out of 1 new tests 1134s | - Removing 1 out of 1 removed tests 1134s 1134s | unitizer updated. 1134s 1134s > 1134s > # - "Load Fail" ---------------------------------------------------------------- 1134s > 1134s > # Purposefully mess up one of the unitizers to see if the load fail stuff works 1134s > saveRDS(list(1, 2, 3), file.path(FLM.TEST.DIR, "fastlm1.unitizer", 1134s + "data.rds")) 1134s > try(unitize_dir(FLM.TEST.DIR, interactive.mode = TRUE)) 1134s 1134s Warning in check_call_stack() : 1134s It appears you are running unitizer inside an error handling function such as 1134s `withCallingHanlders`, `tryCatch`, or `withRestarts`. This is strongly dis- 1134s couraged as it may cause unpredictable behavior from unitizer in the event tests 1134s produce conditions / errors. We strongly recommend you re-run your tests 1134s outside of such handling functions. 1134s | 1134s | The following unitizer could not be loaded: 1134s | - unitizer/fastlm1.unitizer: `get_unitizer` error: Retrieved object is not a 1134s | unitizer store 1134s 1134s Error in load_unitizers(store.ids[active], test.files[active], par.frame = util.frame, : 1134s Cannot proceed with invalid or out of date unitizers. You must either fix or remove them. 1134s > unitizer:::read_line_set_vals(NULL) 1134s > 1134s PASS 1134s Begin testing t-utz2.R 1135s 1135s R version 4.3.2 (2023-10-31) -- "Eye Holes" 1135s Copyright (C) 2023 The R Foundation for Statistical Computing 1135s Platform: x86_64-pc-linux-gnu (64-bit) 1135s 1135s R is free software and comes with ABSOLUTELY NO WARRANTY. 1135s You are welcome to redistribute it under certain conditions. 1135s Type 'license()' or 'licence()' for distribution details. 1135s 1135s R is a collaborative project with many contributors. 1135s Type 'contributors()' for more information and 1135s 'citation()' on how to cite R or R packages in publications. 1135s 1135s Type 'demo()' for some demos, 'help()' for on-line help, or 1135s 'help.start()' for an HTML browser interface to help. 1135s Type 'q()' to quit R. 1135s 1135s > # Overflow tests from testthat.unitize.R 1135s > 1135s > source(file.path("_helper", "init.R")) 1135s > source(file.path("_helper", "pkgs.R")) 1135s Install Packages 1138s Setup Demos 1138s > 1138s > library(unitizer) 1138s > 1138s > # /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ 1138s > # - "unreviewed variations" ---------------------------------------------------- 1138s > # /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ 1138s > 1138s > # Test unreviewed 1138s > # Accept one and go to unreviewed 1138s > # Accept one more and browse and go to unreviewed 1138s > # Accept two remaining and confirm no unreviewed 1138s > # No unreviewed tests 1138s > unitizer:::read_line_set_vals( 1138s + c("Y", "Q", "U", "Y", "B", "U", "Y", "Y", "U", "B", "U", "Q") 1138s + ) 1138s > out <- unitizer:::capture_output(unitize(FLM.TEST.FILE, interactive.mode = TRUE)) 1139s > unitizer:::clean_eval_exp(out) 1139s - Output ----------------------------------------------------------------------- 1139s 1139s 1139s +------------------------------------------------------------------------------+ 1139s | unitizer for: unitizer/fastlm1.R | 1139s +------------------------------------------------------------------------------+ 1139s 1139s Pass Fail New 1139s - - 4 1139s ........................... 1139s - - 4 1139s 1139s - New -------------------------------------------------------------------------- 1139s 1139s | The 4 tests in this section are new. Add tests to store ([Y]es, [N]o, [P]rev, 1139s | [B]rowse, [R]erun, [Q]uit, [H]elp)? 1139s 1139s # Assignments and calls to `library` are not considered tests by 1139s # `unitizer` so you will not need to review them 1139s 1139s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 1139s > dat <- data.frame(x = 1:100, y = (1:100)^2) 1139s > res <- fastlm(dat$x, dat$y) 1139s 1139s # The `unitizer>` prompt is like the standard R prompt. You may 1139s # enter expressions such as `lm(y ~ x, dat)$coefficients`, or 1139s # `str(res)`. 1139s # 1139s # Once you are done reviewing, you need to tell `unitizer` you 1139s # accept the test by typing 'Y' at the prompt. Enter 'H' for help. 1139s 1139s > res 1139s intercept slope rsq 1139s -1717.000 101.000 0.939 1139s attr(,"class") 1139s [1] "fastlm" 1139s 1139s unitizer> Y 1139s 1139s # There are three more tests to review; accept them with 'Y' 1139s 1139s > get_slope(res) 1139s [1] 101 1139s 1139s unitizer> Q 1139s 1139s = Finalize Unitizer ============================================================ 1139s 1139s | You have 3 unreviewed tests; press `B` to browse tests, `U` to go to first 1139s | unreviewed test. 1139s 1139s | Update unitizer ([Y]es, [N]o, [P]rev, [B]rowse, [U]nreviewed, [R]erun)? 1139s 1139s unitizer> U 1139s 1139s # There are three more tests to review; accept them with 'Y' 1139s 1139s > get_slope(res) 1139s [1] 101 1139s 1139s unitizer> Y 1139s 1139s > get_rsq(res) 1139s [1] 0.939 1139s 1139s unitizer> B 1139s 1139s *1. library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) . -:- 1139s *2. dat <- data.frame(x = 1:100, y = (1:100)^2) . . . . . . -:- 1139s *3. res <- fastlm(dat$x, dat$y) . . . . . . . . . . . . -:- 1139s 4. res . . . . . . . . . . . . . . . . . . . . New:Y 1139s 5. get_slope(res) . . . . . . . . . . . . . . . . New:Y 1139s 6. get_rsq(res) . . . . . . . . . . . . . . . . . New:- 1139s 7. fastlm(1:100, 1:10) . . . . . . . . . . . . . . New:- 1139s 1139s | What test do you wish to review (input a test number, [U]nreviewed)? 1139s 1139s unitizer> U 1139s 1139s - New -------------------------------------------------------------------------- 1139s 1139s | The 4 tests in this section are new. Add tests to store ([Y]es, [N]o, [P]rev, 1139s | [B]rowse, [R]erun, [Q]uit, [H]elp)? 1139s 1139s > get_rsq(res) 1139s [1] 0.939 1139s 1139s unitizer> Y 1139s 1139s # This last test is expected to cause an error; press 'Y' to 1139s # accept it so future checks can confirm the same error persists 1139s 1139s > fastlm(1:100, 1:10) 1139s 1139s unitizer> Y 1139s 1139s = Finalize Unitizer ============================================================ 1139s 1139s | Update unitizer ([Y]es, [N]o, [P]rev, [B]rowse, [R]erun)? 1139s 1139s unitizer> U 1139s 1139s | Update unitizer ([Y]es, [N]o, [P]rev, [B]rowse, [R]erun, [Q]uit, [H]elp)? 1139s 1139s unitizer> B 1139s 1139s *1. library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) . -:- 1139s *2. dat <- data.frame(x = 1:100, y = (1:100)^2) . . . . . . -:- 1139s *3. res <- fastlm(dat$x, dat$y) . . . . . . . . . . . . -:- 1139s 4. res . . . . . . . . . . . . . . . . . . . . New:Y 1139s 5. get_slope(res) . . . . . . . . . . . . . . . . New:Y 1139s 6. get_rsq(res) . . . . . . . . . . . . . . . . . New:Y 1139s 7. fastlm(1:100, 1:10) . . . . . . . . . . . . . . New:Y 1139s 1139s | What test do you wish to review (input a test number, [U]nreviewed)? 1139s 1139s unitizer> U 1139s 1139s = Finalize Unitizer ============================================================ 1139s 1139s | Update unitizer ([Y]es, [N]o, [P]rev, [B]rowse, [R]erun)? 1139s 1139s unitizer> Q 1139s 1139s | unitizer unchanged. 1139s 1139s - Message ---------------------------------------------------------------------- 1139s 1139s | You will IRREVERSIBLY modify 'unitizer/fastlm1.unitizer' by: 1139s | - Adding 1 out of 4 new tests 1139s 1139s Error in fastlm(1:100, 1:10) : 1139s Arguments `x` and `y` must be the same length. 1139s | You will IRREVERSIBLY modify 'unitizer/fastlm1.unitizer' by: 1139s | - Adding 4 out of 4 new tests 1139s 1139s Error in : object 'U' not found 1139s | No unreviewed tests. 1139s 1139s | You will IRREVERSIBLY modify 'unitizer/fastlm1.unitizer' by: 1139s | - Adding 4 out of 4 new tests 1139s 1139s | Changes discarded. 1139s > 1139s > # /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ 1139s > # - "Re-eval" ------------------------------------------------------------------ 1139s > # /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ 1139s > 1139s > # Test re-eval 1139s > # Re-eval and jump back to file 1 1139s > # Quit from file 1 and back to main menu 1139s > # Accept one test in file 2 and quit 1139s > # Go to file 3, accept one, and Re-eval all 1139s > 1139s > unitizer:::read_line_set_vals( 1139s + c("1", "Y", "R", "Y", "Q", "2", "Y", "Y", "3", "Y", "RR", "Y", "Q", "Q") 1139s + ) 1139s > untz1 <- unitize_dir(FLM.TEST.DIR, interactive.mode = TRUE) 1139s 1139s | Summary of files in common directory 'unitizer': 1139s | 1139s | Pass Fail New 1139s | *1. fastlm1.R - - 4 1139s | *2. fastlm2.R - - 1 1139s | *3. unitizer.fastlm.R - - 3 1139s | ..................................... 1139s | - - 8 1139s | Legend: 1139s | * `unitizer` requires review 1139s 1139s | Type number of unitizer to review, 'A' to review all that require review 1139s 1139s unitizer> 1 1139s +------------------------------------------------------------------------------+ 1139s | unitizer for: unitizer/fastlm1.R | 1139s +------------------------------------------------------------------------------+ 1139s 1139s Pass Fail New 1139s - - 4 1139s ........................... 1139s - - 4 1139s 1139s - New -------------------------------------------------------------------------- 1139s 1139s | The 4 tests in this section are new. Add tests to store ([Y]es, [N]o, [P]rev, 1139s | [B]rowse, [R]erun, [Q]uit, [H]elp)? 1139s 1139s # Assignments and calls to `library` are not considered tests by 1139s # `unitizer` so you will not need to review them 1139s 1139s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 1139s > dat <- data.frame(x = 1:100, y = (1:100)^2) 1139s > res <- fastlm(dat$x, dat$y) 1139s 1139s # The `unitizer>` prompt is like the standard R prompt. You may 1139s # enter expressions such as `lm(y ~ x, dat)$coefficients`, or 1139s # `str(res)`. 1139s # 1139s # Once you are done reviewing, you need to tell `unitizer` you 1139s # accept the test by typing 'Y' at the prompt. Enter 'H' for help. 1139s 1139s > res 1139s intercept slope rsq 1139s -1717.000 101.000 0.939 1139s attr(,"class") 1139s [1] "fastlm" 1139s 1139s unitizer> Y 1139s 1139s # There are three more tests to review; accept them with 'Y' 1139s 1139s > get_slope(res) 1139s [1] 101 1139s 1139s unitizer> R 1139s 1139s | Toggling re-run mode ON for this unitizer 1139s 1139s = Finalize Unitizer ============================================================ 1139s 1139s | You have 3 unreviewed tests; press `B` to browse tests, `U` to go to first 1139s | unreviewed test. 1139s 1139s | You will IRREVERSIBLY modify 'unitizer/fastlm1.unitizer' by: 1139s | - Adding 1 out of 4 new tests 1139s 1139s | Update unitizer and re-run unitizer ([Y]es, [N]o, [P]rev, [B]rowse, [U] 1139s | nreviewed, [R]erun)? 1139s 1139s unitizer> Y 1139s 1140s | unitizer updated. 1140s 1140s +------------------------------------------------------------------------------+ 1140s | unitizer for: unitizer/fastlm1.R | 1140s +------------------------------------------------------------------------------+ 1140s 1140s Pass Fail New 1140s 1 - 3 1140s ........................... 1140s 1 - 3 1140s 1140s - New -------------------------------------------------------------------------- 1140s 1140s | The 3 tests in this section are new. Add tests to store ([Y]es, [N]o, [P]rev, 1140s | [B]rowse, [R]erun, [Q]uit, [H]elp)? 1140s 1140s | Jumping to test #5 because that was the test under review when test re-run was 1140s | requested. 1140s 1140s # There are three more tests to review; accept them with 'Y' 1140s 1140s > get_slope(res) 1140s [1] 101 1140s 1140s unitizer> Q 1140s 1140s | No changes recorded. 1140s | unitizer unchanged. 1140s 1140s | Summary of files in common directory 'unitizer': 1140s | 1140s | Pass Fail New 1140s | *1. fastlm1.R 1 - 3 1140s | *2. fastlm2.R - - 1 1140s | *3. unitizer.fastlm.R - - 3 1140s | ..................................... 1140s | 1 - 7 1140s | Legend: 1140s | * `unitizer` requires review 1140s 1140s | Type number of unitizer to review, 'A' to review all that require review 1140s 1140s unitizer> 2 1140s +------------------------------------------------------------------------------+ 1140s | unitizer for: unitizer/fastlm2.R | 1140s +------------------------------------------------------------------------------+ 1140s 1140s Pass Fail New 1140s - - 1 1140s ........................... 1140s - - 1 1140s 1140s - New -------------------------------------------------------------------------- 1140s 1140s | The following test is new. Add test to store ([Y]es, [N]o, [P]rev, [B]rowse, 1140s | [R]erun, [Q]uit, [H]elp)? 1140s 1140s # For internal tests only; not for demo 1140s 1140s > x <- 1:10 1140s > y <- 1:10^3 1140s > res <- summary(lm(y ~ x, data.frame(x = x, y = y))) 1140s > intercept <- res$coefficients[1, 1] 1140s > slope <- res$coefficients[2, 1] 1140s > rsq <- res$r.squared 1140s > structure(c(intercept = intercept, slope = slope, rsq = rsq), 1140s + class = "fastlm") 1140s intercept slope rsq 1140s 4.95e+02 1.00e+00 9.90e-05 1140s attr(,"class") 1140s [1] "fastlm" 1140s 1140s unitizer> Y 1140s 1140s = Finalize Unitizer ============================================================ 1140s 1140s | You will IRREVERSIBLY modify 'unitizer/fastlm2.unitizer' by: 1140s | - Adding 1 out of 1 new tests 1140s 1140s | Update unitizer ([Y]es, [N]o, [P]rev, [B]rowse, [R]erun)? 1140s 1140s unitizer> Y 1140s 1140s | unitizer updated. 1140s 1140s | Summary of files in common directory 'unitizer': 1140s | 1140s | Pass Fail New 1140s | *1. fastlm1.R 1 - 3 1140s | $2. fastlm2.R ? ? ? 1140s | *3. unitizer.fastlm.R - - 3 1140s | ..................................... 1140s | ? ? ? 1140s | Legend: 1140s | * `unitizer` requires review 1140s | $ `unitizer` has been modified and needs to be re-run to recompute summary 1140s 1140s | Type number of unitizer to review, 'A' to review all that require review, 'R' 1140s | to re-run all updated 1140s 1140s unitizer> 3 1140s +------------------------------------------------------------------------------+ 1140s | unitizer for: unitizer/unitizer.fastlm.R | 1140s +------------------------------------------------------------------------------+ 1140s 1140s Pass Fail New 1140s - - 3 1140s ........................... 1140s - - 3 1140s 1140s - New -------------------------------------------------------------------------- 1140s 1140s | The 3 tests in this section are new. Add tests to store ([Y]es, [N]o, [P]rev, 1140s | [B]rowse, [R]erun, [Q]uit, [H]elp)? 1140s 1140s # Extra test file for internal tests; not for DEMO 1140s 1140s > library(utzflm, lib.loc = getOption("unitizer.tmp.lib.loc")) 1140s > x <- 1:10 1140s > y <- x^3 1140s > res <- fastlm(x, y) 1140s > get_slope(res) 1140s [1] 105 1140s 1140s unitizer> Y 1140s 1140s > get_rsq(res) 1140s [1] 0.862 1140s 1140s unitizer> RR 1140s 1140s | Toggling re-run mode ON for all loaded unitizers 1140s 1140s = Finalize Unitizer ============================================================ 1140s 1140s | You have 2 unreviewed tests; press `B` to browse tests, `U` to go to first 1140s | unreviewed test. 1140s 1140s | You will IRREVERSIBLY modify 'unitizer/unitizer.fastlm.unitizer' by: 1140s | - Adding 1 out of 3 new tests 1140s 1140s | Update unitizer and re-run all loaded unitizers ([Y]es, [N]o, [P]rev, [B] 1140s | rowse, [U]nreviewed, [R]erun)? 1140s 1140s unitizer> Y 1140s 1140s | unitizer updated. 1140s 1140s | Summary of files in common directory 'unitizer': 1140s | 1140s | Pass Fail New 1140s | *1. fastlm1.R 1 - 3 1140s | 2. fastlm2.R 1 - - 1140s | *3. unitizer.fastlm.R 1 - 2 1140s | ..................................... 1140s | 3 - 5 1140s | Legend: 1140s | * `unitizer` requires review 1140s 1140s | Type number of unitizer to review, 'A' to review all that require review 1140s 1140s unitizer> Q 1140s 1140s > print(untz1) 1140s Summary of tests (accept/total): 1140s 1140s id test.file New Passed Totals 1140s 1 fastlm1.R 0/3 1/1 1/4 $ 1140s 2 fastlm2.R 0/0 1/1 1/1 $ 1140s 3 unitizer.fastlm.R 0/2 1/1 1/3 $ 1140s ----------------------------------------------------- 1140s 0 Totals 0/5 3/3 3/8 1140s 1140s $ unitizer was saved in prior evaluation 1140s 1140s Test files in common directory 'tests/unitizer' 1140s > # remove temp file names and display 1140s > invisible(lapply(untz1, function(x) {print(x); cat('\n')})) 1140s Test File: tests/unitizer/fastlm1.R 1140s Store ID: tests/unitizer/fastlm1.unitizer 1140s 1140s id call ignored status user reviewed 1140s 1 4 library(utzflm, lib.loc = g... * Passed Y FALSE 1140s 2 5 dat <- data.frame(x = 1:100... * Passed Y FALSE 1140s 3 6 res <- fastlm(dat$x, dat$y) * Passed Y FALSE 1140s 4 7 res Passed Y FALSE 1140s 5 1 get_slope(res) New N FALSE 1140s 6 2 get_rsq(res) New N FALSE 1140s 7 3 fastlm(1:100, 1:10) New N FALSE 1140s 1140s You chose NOT to save these changes to the unitizer store 1140s 1140s Test File: tests/unitizer/fastlm2.R 1140s Store ID: tests/unitizer/fastlm2.unitizer 1140s 1140s id call ignored status user reviewed 1140s 1 1 x <- 1:10 * Passed Y FALSE 1140s 2 2 y <- 1:10^3 * Passed Y FALSE 1140s 3 3 res <- summary(lm(y ~ x, da... * Passed Y FALSE 1140s 4 4 intercept <- res$coefficien... * Passed Y FALSE 1140s 5 5 slope <- res$coefficients[2... * Passed Y FALSE 1140s 6 6 rsq <- res$r.squared * Passed Y FALSE 1140s 7 7 structure(c(intercept = int... Passed Y FALSE 1140s 1140s You chose NOT to save these changes to the unitizer store 1140s 1140s Test File: tests/unitizer/unitizer.fastlm.R 1140s Store ID: tests/unitizer/unitizer.fastlm.unitizer 1140s 1140s id call ignored status user reviewed 1140s 1 3 library(utzflm, lib.loc = g... * Passed Y FALSE 1140s 2 4 x <- 1:10 * Passed Y FALSE 1140s 3 5 y <- x^3 * Passed Y FALSE 1140s 4 6 res <- fastlm(x, y) * Passed Y FALSE 1140s 5 7 get_slope(res) Passed Y FALSE 1140s 6 1 get_rsq(res) New N FALSE 1140s 7 2 get_intercept(res) New N FALSE 1140s 1140s You chose NOT to save these changes to the unitizer store 1140s 1140s > 1140s > # /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ 1140s > # - "Section Extra" ------------------------------------------------------------ 1140s > # /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ 1140s > 1140s > # Make sure that deleted items from a section are still marked from that 1140s > # section upgrade to version two to use the files that are set up for that 1140s > # there; notice update_fastlm_*extra* 1140s > # Re-set by dropping unitizers 1140s > 1140s > unlink(list.dirs(FLM.TEST.DIR, recursive = FALSE), recursive = TRUE) 1140s > unitizer:::update_fastlm_extra(FLM) 1140s > inst_pak(FLM) 1141s > test.file.1 <- file.path(FLM.TEST.DIR, "unitizer.fastlm.R") 1141s > test.file.2 <- file.path(FLM.TEST.DIR, "unitizer.fastlm2.R") 1141s > test.store <- file.path(FLM.TEST.DIR, "store2.unitizer") 1141s > # First auto accept all initial tests, and then re-run with second version to 1141s > # make sure deleted tests are where we think they should be 1141s > out.1 <- 1141s + unitizer:::capture_output(unitize(test.file.1, test.store, auto.accept = "new")) 1141s > unitizer:::read_line_set_vals(c("B", "Q")) 1141s > out.2 <- unitizer:::capture_output( 1141s + untz.2 <- unitize(test.file.2, test.store, interactive.mode = TRUE) 1141s + ) 1142s > attributes(untz.2) <- NULL 1142s > untz.2 1142s [[1]] 1142s [1] 1 2 3 4 5 6 7 1142s 1142s [[2]] 1142s [1] "library(utzflm, lib.loc = getOption(\"unitizer.tmp.lib.loc\"))" 1142s [2] "x <- 1:10" 1142s [3] "y <- x^2" 1142s [4] "res <- fastlm(x, y)" 1142s [5] "get_slope(res)" 1142s [6] "get_rsq(res)" 1142s [7] "2 * get_slope(res) + get_intercept(res)" 1142s 1142s [[3]] 1142s [1] "Basic Tests" "Basic Tests" "Basic Tests" "Basic Tests" 1142s [5] "Basic Tests" "Advanced Tests" "Advanced Tests" 1142s 1142s [[4]] 1142s [1] TRUE TRUE TRUE TRUE FALSE FALSE FALSE 1142s 1142s [[5]] 1142s [1] Failed Failed Failed Failed Failed Failed Removed 1142s Levels: New Passed Failed Removed Corrupted 1142s 1142s [[6]] 1142s [1] N N N N N N N 1142s Levels: Y N 1142s 1142s [[7]] 1142s [1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE 1142s 1142s > 1142s > # /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ 1142s > # - "warning when comp funs produce output" ------------------------------------ 1142s > # /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ 1142s > 1142s > # Sections with comp funs that output to stdout/stderr 1142s > temp.loc <- tempfile() 1142s > dir.create(temp.loc) 1142s > file.copy(file.path(START.DIR, "_helper", "unitizers", "sects.R"), temp.loc) 1142s [1] TRUE 1142s > f.sec <- file.path(temp.loc, "sects.R") 1142s > odir <- setwd(temp.loc) 1142s > out <- unitizer:::capture_output( 1142s + unitize(f.sec, auto.accept = "new", interactive.mode = FALSE 1142s + ) ) 1142s > 1142s > unitize(f.sec, interactive.mode = FALSE) 1142s 1142s Warning in close_and_clear(e1@global$cons) : 1142s 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: 1142s I'm outputting to stdout 1142s I'm outputting to stderr 1142s I'm outputting to both 1 1142s I'm outputting to both 2 1142s 1142s Warning in history_capt(history, interactive.mode) : 1142s Unable to capture history in non-interactive mode. 1142s | 3/3 tests passed; nothing to review. 1142s 1142s > setwd(odir) 1142s > unlink(temp.loc, recursive = TRUE) 1142s > 1142s > # - "Corner Case Files" -------------------------------------------------------- 1142s > 1142s > # Corner case files 1142s > # empty 1142s > temp.empty <- paste0(tempfile(), "-empty.R") 1142s > cat("\n", file = temp.empty) 1142s > empty.capt <- unitizer:::capture_output(unitize(temp.empty, force = TRUE)) 1142s > # File, but does not end in .R 1142s > temp.bad <- paste0(tempfile()) 1142s > 1142s > cat("\n", file = temp.bad) 1142s > badname.capt <- unitizer:::capture_output(try(unitize(temp.bad))) 1142s > any(grepl("`get_unitizer` error", out$message)) 1142s [1] FALSE 1142s > 1142s > any(grepl("Empty unitizer", empty.capt$output)) 1142s [1] TRUE 1142s > any(grepl("No valid unitizers available", badname.capt$message)) 1142s [1] FALSE 1142s > unlink(c(temp.empty, temp.bad)) 1142s > 1142s > # /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ 1142s > # - "Re-eval change" ----------------------------------------------------------- 1142s > # /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ 1142s > 1142s > # re-eval reeval with a modified file 1142s > temp.reeval.base <- paste0(tempfile(), "-reeval") 1142s > temp.reeval <- paste0(temp.reeval.base, ".R") 1142s > temp.reeval.utz <- paste0(temp.reeval.base, ".unitizer") 1142s > cat("1 + 1\n2 + 2\n", file = temp.reeval) 1142s > # force re-review 1142s > unitizer:::read_line_set_vals(c("Y", "P", "Y", "cat(\"1 + 1\n2 + 3\n\", file=temp.reeval)", 1142s + "R", "Y", "Q")) 1142s > # state = environment() so we can access variables from this local 1142s > reeval.capt <- unitizer:::capture_output(unitize(temp.reeval, 1142s + state = environment(), interactive.mode = TRUE)) 1142s > unlink(c(temp.reeval, temp.reeval.utz), recursive = TRUE) 1142s > 1142s > # /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ 1142s > # - "Condition fail" ----------------------------------------------------------- 1142s > # /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ 1142s > 1142s > # Fail test with conditions 1142s > temp.cond.base <- paste0(tempfile(), "-cond") 1142s > temp.cond <- paste0(tempfile(), ".R") 1142s > temp.cond.utz <- paste0(tempfile(), ".unitizer") 1142s > cond.message <- "hello world" 1142s > cat("warning(cond.message)", file = temp.cond) 1142s > unitizer:::read_line_set_vals(c("Y", "Y")) 1142s > # state = environment() so we can access variables from this local 1142s > unitizer:::capture_output( 1142s + unitize(temp.cond, state = environment(), interactive.mode = TRUE) 1142s + ) 1142s > cond.message <- "goodbye world" 1142s > unitizer:::read_line_set_vals("Q") 1142s > cond.capt <- 1142s + unitizer:::capture_output( 1142s + unitize(temp.cond, state = environment(), interactive.mode = TRUE) 1142s + ) 1143s > sum(grepl("Conditions mismatch", cond.capt$output)) == 1L 1143s [1] TRUE 1143s > unlink(c(temp.cond, temp.cond.utz), recursive = TRUE) 1143s > 1143s > # /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ 1143s > # - "Force" -------------------------------------------------------------------- 1143s > # /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ 1143s > # 1143s > # Toggle force update, in order for this to work we need to create a situation 1143s > # where in a `unitize_dir`, one file passes, the other doesn't, and we review 1143s > # the file that passes. Otherwise the only other way to do it is to set force 1143s > # from the beginning, but that ruins the toggle effect. One possible issue 1143s > # here is that we don't have a great way to check the file actually changed. 1143s > 1143s > temp.forceup.base.dir <- tempfile() 1143s > dir.create(temp.forceup.base.dir) 1143s > temp.forceup.1 <- file.path(temp.forceup.base.dir, "force1.R") 1143s > temp.forceup.2 <- file.path(temp.forceup.base.dir, "force2.R") 1143s > cat("force.var\n", file = temp.forceup.1) 1143s > cat("4 + 1\n", file = temp.forceup.2) 1143s > force.var <- 1 1143s > unitizer:::capture_output({ 1143s + unitize(temp.forceup.1, auto.accept = "new", state = environment()) 1143s + unitize(temp.forceup.2, auto.accept = "new", state = environment()) 1143s + }) 1143s > force.var <- 2 1143s > unitizer:::read_line_set_vals(c("2", "1", "Y", "O", "Q", "Q")) 1143s > force.capt <- unitizer:::capture_output(unitize_dir(temp.forceup.base.dir, 1143s + state = environment(), interactive.mode = TRUE)) 1143s > unlink(temp.forceup.base.dir, recursive = TRUE) 1143s > sum(grepl("Toggling force update mode ON", force.capt$message)) == 1143s + 1L 1143s [1] TRUE 1143s > sum(grepl("You are about to .* with re-evaluated", force.capt$message)) == 1143s + 1L 1143s [1] TRUE 1143s > 1143s > # /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ 1143s > # - "Compare Funs" ------------------------------------------------------------- 1143s > # /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ 1143s > 1143s > # Bad comparison functions 1143s > temp.bad.comp <- paste0(tempfile(), ".R") 1143s > cat("\n unitizer_sect(\n 'bad comp', {1 + 1; 2 + 2},\n compare=function(x, y) list('failed', 'comparison')\n )\n", 1143s + file = temp.bad.comp) 1143s > unitizer:::capture_output(unitize(temp.bad.comp, auto.accept = "new")) 1143s > unitizer:::read_line_set_vals(c("Q")) 1143s > bad.comp.capt <- unitizer:::capture_output(unitize(temp.bad.comp, 1143s + interactive.mode = TRUE)) 1143s > unlink(temp.bad.comp) 1143s > 1143s > sum(grepl("Unable to compare value", bad.comp.capt$message)) == 1L 1143s [1] TRUE 1143s > sum(grepl("Corrupted", bad.comp.capt$output)) >= 1L 1143s [1] TRUE 1143s > 1143s > # /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ 1143s > # - "bad map" ------------------------------------------------------------------ 1143s > # /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ 1143s > 1143s > # Bad store mapping functions 1143s > 1143s > try(unitize_dir(FLM.TEST.DIR, store.ids = function(x) stop("Bad store map fun"))) 1143s 1143s Error in FUN(X[[i]], ...) : Bad store map fun 1143s Error in unitize_dir(FLM.TEST.DIR, store.ids = function(x) stop("Bad store map fun")) : 1143s Argument `store.ids` is a function, but caused an error when attempting to use it to convert test file names to `unitizer` ids. 1143s > 1143s > unitizer:::read_line_set_vals(NULL) 1143s > 1143s > # /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ 1143s > # - "Multiple Bookmarks" ------------------------------------------------------- 1143s > # /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ 1143s > 1143s > # Issue 245: In review-all mode should not move to next unitizer until the 1143s > # review bookmark is cleared. 1143s > 1143s > temp.dir <- tempfile() 1143s > dir.create(temp.dir) 1143s > writeLines("'hello'\n'world'", file.path(temp.dir, "a.R")) 1143s > writeLines("2 + 1\n3 + 2", file.path(temp.dir, "b.R")) 1143s > writeLines("pi\n2 * pi\nsqrt(pi)", file.path(temp.dir, "c.R")) 1143s > unitizer:::read_line_set_vals( 1143s + c("A","N","N","Y","Y","R","Y","Q","Y","R","Y","Y","Y","Y","Q") 1143s + ) 1143s > unitize_dir(temp.dir, interactive.mode=TRUE) 1143s 1143s | Summary of files in common directory '.': 1143s | 1143s | Pass Fail New 1143s | *1. a.R - - 2 1143s | *2. b.R - - 2 1143s | *3. c.R - - 3 1143s | ....................... 1143s | - - 7 1143s | Legend: 1143s | * `unitizer` requires review 1143s 1143s | Type number of unitizer to review, 'A' to review all that require review 1143s 1143s unitizer> A 1143s 1143s +------------------------------------------------------------------------------+ 1143s | unitizer for: a.R | 1143s +------------------------------------------------------------------------------+ 1143s 1143s Pass Fail New 1143s - - 2 1143s ........................... 1143s - - 2 1143s 1143s - New -------------------------------------------------------------------------- 1143s 1143s | The 2 tests in this section are new. Add tests to store ([Y]es, [N]o, [P]rev, 1143s | [B]rowse, [R]erun, [QQ]uit All, [Q]uit, [H]elp)? 1143s 1143s > "hello" 1143s [1] "hello" 1143s 1143s unitizer> N 1143s 1143s > "world" 1143s [1] "world" 1143s 1143s unitizer> N 1143s 1143s = Finalize Unitizer ============================================================ 1143s 1143s | You made no changes to the unitizer so there is no need to update it. While 1143s | unnecessary, you can force an update by typing O at the prompt. 1143s 1143s | Exit unitizer ([Y]es, [P]rev, [B]rowse, [R]erun, f[O]rce, [QQ]uit All)? 1143s 1143s unitizer> Y 1143s 1143s | unitizer unchanged. 1143s 1143s +------------------------------------------------------------------------------+ 1143s | unitizer for: b.R | 1143s +------------------------------------------------------------------------------+ 1143s 1143s Pass Fail New 1143s - - 2 1143s ........................... 1143s - - 2 1143s 1143s - New -------------------------------------------------------------------------- 1143s 1143s | The 2 tests in this section are new. Add tests to store ([Y]es, [N]o, [P]rev, 1143s | [B]rowse, [R]erun, [QQ]uit All, [Q]uit, [H]elp)? 1143s 1143s > 2 + 1 1143s [1] 3 1143s 1143s unitizer> Y 1143s 1143s > 3 + 2 1143s [1] 5 1143s 1143s unitizer> R 1143s 1143s | Toggling re-run mode ON for this unitizer 1143s 1144s = Finalize Unitizer ============================================================ 1144s 1144s | You have 1 unreviewed tests; press `B` to browse tests, `U` to go to first 1144s | unreviewed test. 1144s 1144s | You will IRREVERSIBLY modify 'b.unitizer' by: 1144s | - Adding 1 out of 2 new tests 1144s 1144s | Update unitizer and re-run unitizer ([Y]es, [N]o, [P]rev, [B]rowse, [U] 1144s | nreviewed, [R]erun, [QQ]uit All)? 1144s 1144s unitizer> Y 1144s 1144s | unitizer updated. 1144s 1144s +------------------------------------------------------------------------------+ 1144s | unitizer for: b.R | 1144s +------------------------------------------------------------------------------+ 1144s 1144s Pass Fail New 1144s 1 - 1 1144s ........................... 1144s 1 - 1 1144s 1144s - New -------------------------------------------------------------------------- 1144s 1144s | The following test is new. Add test to store ([Y]es, [N]o, [P]rev, [B]rowse, 1144s | [R]erun, [QQ]uit All, [Q]uit, [H]elp)? 1144s 1144s | Jumping to test #2 because that was the test under review when test re-run was 1144s | requested. 1144s 1144s > 3 + 2 1144s [1] 5 1144s 1144s unitizer> Q 1144s 1144s | No changes recorded. 1144s | unitizer unchanged. 1144s 1144s +------------------------------------------------------------------------------+ 1144s | unitizer for: c.R | 1144s +------------------------------------------------------------------------------+ 1144s 1144s Pass Fail New 1144s - - 3 1144s ........................... 1144s - - 3 1144s 1144s - New -------------------------------------------------------------------------- 1144s 1144s | The 3 tests in this section are new. Add tests to store ([Y]es, [N]o, [P]rev, 1144s | [B]rowse, [R]erun, [QQ]uit All, [Q]uit, [H]elp)? 1144s 1144s > pi 1144s [1] 3.14 1144s 1144s unitizer> Y 1144s 1144s > 2 * pi 1144s [1] 6.28 1144s 1144s unitizer> R 1144s 1144s | Toggling re-run mode ON for this unitizer 1144s 1144s = Finalize Unitizer ============================================================ 1144s 1144s | You have 2 unreviewed tests; press `B` to browse tests, `U` to go to first 1144s | unreviewed test. 1144s 1144s | You will IRREVERSIBLY modify 'c.unitizer' by: 1144s | - Adding 1 out of 3 new tests 1144s 1144s | Update unitizer and re-run unitizer ([Y]es, [N]o, [P]rev, [B]rowse, [U] 1144s | nreviewed, [R]erun, [QQ]uit All)? 1144s 1144s unitizer> Y 1144s 1144s | unitizer updated. 1144s 1144s +------------------------------------------------------------------------------+ 1144s | unitizer for: c.R | 1144s +------------------------------------------------------------------------------+ 1144s 1144s Pass Fail New 1144s 1 - 2 1144s ........................... 1144s 1 - 2 1144s 1144s - New -------------------------------------------------------------------------- 1144s 1144s | The 2 tests in this section are new. Add tests to store ([Y]es, [N]o, [P]rev, 1144s | [B]rowse, [R]erun, [Q]uit, [H]elp)? 1144s 1144s | Jumping to test #2 because that was the test under review when test re-run was 1144s | requested. 1144s 1144s > 2 * pi 1144s [1] 6.28 1144s 1144s unitizer> Y 1144s 1144s > sqrt(pi) 1144s [1] 1.77 1144s 1144s unitizer> Y 1144s 1144s = Finalize Unitizer ============================================================ 1144s 1144s | You will IRREVERSIBLY modify 'c.unitizer' by: 1144s | - Adding 2 out of 2 new tests 1144s 1144s | Update unitizer ([Y]es, [N]o, [P]rev, [B]rowse, [R]erun)? 1144s 1144s unitizer> Y 1144s 1144s | unitizer updated. 1144s 1144s | Summary of files in common directory '.': 1144s | 1144s | Pass Fail New 1144s | *1. a.R - - 2 1144s | *2. b.R 1 - 1 1144s | $3. c.R ? ? ? 1144s | ....................... 1144s | ? ? ? 1144s | Legend: 1144s | * `unitizer` requires review 1144s | $ `unitizer` has been modified and needs to be re-run to recompute summary 1144s 1144s | Type number of unitizer to review, 'A' to review all that require review, 'R' 1144s | to re-run all updated 1144s 1144s unitizer> Q 1144s 1144s > 1144s > # Make sure re-eval all clears all bookmarks 1144s > unlink( 1144s + list.files(temp.dir, full.names=TRUE, pattern="\\.unitizer$"), 1144s + recursive=TRUE 1144s + ) 1144s > unitizer:::read_line_set_vals(c("A","Q","Y","RR","Y","Q")) 1144s > unitize_dir(temp.dir, interactive.mode=TRUE) 1144s 1144s | Summary of files in common directory '.': 1144s | 1144s | Pass Fail New 1144s | *1. a.R - - 2 1144s | *2. b.R - - 2 1144s | *3. c.R - - 3 1144s | ....................... 1144s | - - 7 1144s | Legend: 1144s | * `unitizer` requires review 1144s 1144s | Type number of unitizer to review, 'A' to review all that require review 1144s 1144s unitizer> A 1144s 1144s +------------------------------------------------------------------------------+ 1144s | unitizer for: a.R | 1144s +------------------------------------------------------------------------------+ 1144s 1144s Pass Fail New 1144s - - 2 1144s ........................... 1144s - - 2 1144s 1144s - New -------------------------------------------------------------------------- 1144s 1144s | The 2 tests in this section are new. Add tests to store ([Y]es, [N]o, [P]rev, 1144s | [B]rowse, [R]erun, [QQ]uit All, [Q]uit, [H]elp)? 1144s 1144s > "hello" 1144s [1] "hello" 1144s 1144s unitizer> Q 1144s 1144s | No changes recorded. 1144s | unitizer unchanged. 1144s 1144s +------------------------------------------------------------------------------+ 1144s | unitizer for: b.R | 1144s +------------------------------------------------------------------------------+ 1144s 1144s Pass Fail New 1144s - - 2 1144s ........................... 1144s - - 2 1144s 1144s - New -------------------------------------------------------------------------- 1144s 1144s | The 2 tests in this section are new. Add tests to store ([Y]es, [N]o, [P]rev, 1144s | [B]rowse, [R]erun, [QQ]uit All, [Q]uit, [H]elp)? 1144s 1144s > 2 + 1 1144s [1] 3 1144s 1144s unitizer> Y 1144s 1144s > 3 + 2 1144s [1] 5 1144s 1144s unitizer> RR 1144s 1144s | Toggling re-run mode ON for all loaded unitizers 1144s 1144s = Finalize Unitizer ============================================================ 1144s 1144s | You have 1 unreviewed tests; press `B` to browse tests, `U` to go to first 1144s | unreviewed test. 1144s 1144s | You will IRREVERSIBLY modify 'b.unitizer' by: 1144s | - Adding 1 out of 2 new tests 1144s 1144s | Update unitizer and re-run all loaded unitizers ([Y]es, [N]o, [P]rev, [B] 1144s | rowse, [U]nreviewed, [R]erun, [QQ]uit All)? 1144s 1144s unitizer> Y 1144s 1144s | unitizer updated. 1144s 1145s | Summary of files in common directory '.': 1145s | 1145s | Pass Fail New 1145s | *1. a.R - - 2 1145s | *2. b.R 1 - 1 1145s | *3. c.R - - 3 1145s | ....................... 1145s | 1 - 6 1145s | Legend: 1145s | * `unitizer` requires review 1145s 1145s | Type number of unitizer to review, 'A' to review all that require review 1145s 1145s unitizer> Q 1145s 1145s > 1145s > unitizer:::read_line_set_vals(NULL) 1145s > unlink(temp.dir, recursive=TRUE) 1145s > 1145s > # /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ 1145s > # - "Non-Standard Conditions" -------------------------------------------------- 1145s > # /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ 1145s > 1145s > # Issue 272: some conditions don't produce any output, but for `unitizer` we 1145s > # consider normally non-test expressions that produce conditions as tests. So 1145s > # we need a mechanism for clarifying what happened. 1145s > 1145s > temp.dir <- tempfile() 1145s > temp.file <- file.path(temp.dir, 'a.R') 1145s > dir.create(temp.dir) 1145s > 1145s > unitizer:::read_line_set_vals("Q") 1145s > writeLines( 1145s + c( 1145s + "cond <- simpleCondition('hello')", 1145s + "class(cond) <- c('svgchop_unsupported', 'svgchop', class(cond))", 1145s + "invisible(signalCondition(cond))" 1145s + ), 1145s + temp.file 1145s + ) 1145s > unitize(temp.file, interactive.mode=TRUE) 1145s 1145s +------------------------------------------------------------------------------+ 1145s | unitizer for: a.R | 1145s +------------------------------------------------------------------------------+ 1145s 1145s Pass Fail New 1145s - - 1 1145s ........................... 1145s - - 1 1145s 1145s - New -------------------------------------------------------------------------- 1145s 1145s | The following test is new. Add test to store ([Y]es, [N]o, [P]rev, [B]rowse, 1145s | [R]erun, [Q]uit, [H]elp)? 1145s 1145s > cond <- simpleCondition("hello") 1145s > class(cond) <- c("svgchop_unsupported", "svgchop", class(cond)) 1145s > invisible(signalCondition(cond)) 1145s 1145s | Test silently signalled conditions (use e.g. .NEW$conditions[[1]] to inspect): 1145s 1145s Condition list with 1 condition: 1145s 1. svgchop_unsupported: hello 1145s 1145s unitizer> Q 1145s 1145s | No changes recorded. 1145s | unitizer unchanged. 1145s 1145s > 1145s > unitizer:::read_line_set_vals(NULL) 1145s > unlink(temp.dir, recursive=TRUE) 1145s > 1145s > # /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ 1145s > # - "Output Transcript in non-Interactive" ------------------------------------- 1145s > # /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ 1145s > 1145s > # Issue 286: don't capture output in non-interactive. 1145s > # We need `try` because we're testing what happens when the unitizer fails. 1145s > 1145s > temp.dir <- tempfile() 1145s > temp.file <- file.path(temp.dir, 'a.R') 1145s > dir.create(temp.dir) 1145s > writeLines('warning("boom")', temp.file) # can't use error b/c try below 1145s > old.opt <- options(unitizer.transcript=NULL, unitizer.show.progress=TRUE) 1145s > try(unitize(temp.file)) 1145s 1145s Warning in check_call_stack() : 1145s It appears you are running unitizer inside an error handling function such as 1145s `withCallingHanlders`, `tryCatch`, or `withRestarts`. This is strongly dis- 1145s couraged as it may cause unpredictable behavior from unitizer in the event tests 1145s produce conditions / errors. We strongly recommend you re-run your tests 1145s outside of such handling functions. 1145s Preloads... 1145s Loading unitizer data... 1145s Parsing tests... 1145s Parsing a.R 1145s Evaluating tests... 1145s 1145s warning("boom") 1145s Warning in withVisible(warning("boom")) : boom 1145s 1145s Prepping Unitizers... 1145s Warning in history_capt(history, interactive.mode) : 1145s Unable to capture history in non-interactive mode. 1145s 1145s +------------------------------------------------------------------------------+ 1145s | unitizer for: a.R | 1145s +------------------------------------------------------------------------------+ 1145s 1145s Pass Fail New 1145s - - 1 1145s ........................... 1145s - - 1 1145s 1145s - New -------------------------------------------------------------------------- 1145s 1145s | The following test is new. Add test to store ([Y]es, [N]o, [P]rev, [B]rowse, 1145s | [R]erun, [Q]uit, [H]elp)? 1145s 1145s > warning("boom") 1145s 1145s | Test signalled conditions (use e.g. .NEW$conditions[[1]] to inspect): 1145s 1145s Condition list with 1 condition: 1145s 1. Warning: boom 1145s 1145s | User input required to proceed, but we are in non-interactive mode. 1145s 1145s | unitizer unchanged. 1145s 1145s | * New: warning("boom") 1145s | in 'a.R' 1145s 1145s | Newly evaluated tests do not match unitizer (New: 1); see above for more info, 1145s | or run in interactive mode. 1145s 1145s | Running in transcript mode: only stderr text that is also part of a signalled 1145s | condition is in the test review section (scroll up to the evaluation section 1145s | for the rest). See `transcript` parameter in `?unitize`. 1145s 1145s Error in unitize_core(test.file.inf, list(store.id.inf), state = state, : 1145s Cannot proceed in non-interactive mode. 1145s > options(old.opt) 1145s > unlink(temp.dir, recursive=TRUE) 1145s > 1145s > # /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ 1145s > # - "Display All Tests in non-Interactive" ------------------------------------- 1145s > # /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ 1145s > 1145s > # Issue 293: don't stop after first failing test 1145s > # We need `try` because we're testing what happens when the unitizer fails. 1145s > 1145s > temp.dir <- tempfile() 1145s > temp.file.a <- file.path(temp.dir, 'a.R') 1145s > temp.file.b <- file.path(temp.dir, 'b.R') 1145s > dir.create(temp.dir) 1145s > writeLines(c("1 + 1", "warning('hello')"), temp.file.a) 1145s > writeLines(c("2 + 1", "warning('goodbye')"), temp.file.b) 1145s > try(unitize_dir(temp.dir, transcript=FALSE)) 1145s 1145s Warning in check_call_stack() : 1145s It appears you are running unitizer inside an error handling function such as 1145s `withCallingHanlders`, `tryCatch`, or `withRestarts`. This is strongly dis- 1145s couraged as it may cause unpredictable behavior from unitizer in the event tests 1145s produce conditions / errors. We strongly recommend you re-run your tests 1145s outside of such handling functions. 1145s Warning in history_capt(history, interactive.mode) : 1145s Unable to capture history in non-interactive mode. 1145s | Summary of files in common directory '.': 1145s | 1145s | Pass Fail New 1145s | *1. a.R - - 2 1145s | *2. b.R - - 2 1145s | ....................... 1145s | - - 4 1145s | Legend: 1145s | * `unitizer` requires review 1145s 1145s +------------------------------------------------------------------------------+ 1145s | unitizer for: a.R | 1145s +------------------------------------------------------------------------------+ 1145s 1145s Pass Fail New 1145s - - 2 1145s ........................... 1145s - - 2 1145s 1145s - New -------------------------------------------------------------------------- 1145s 1145s | The 2 tests in this section are new. Add tests to store ([Y]es, [N]o, [P]rev, 1145s | [B]rowse, [R]erun, [QQ]uit All, [Q]uit, [H]elp)? 1145s 1145s > 1 + 1 1145s [1] 2 1145s 1145s > warning("hello") 1145s Warning: hello 1145s 1145s | User input required to proceed, but we are in non-interactive mode. 1145s 1145s | unitizer unchanged. 1145s 1145s +------------------------------------------------------------------------------+ 1145s | unitizer for: b.R | 1145s +------------------------------------------------------------------------------+ 1145s 1145s Pass Fail New 1145s - - 2 1145s ........................... 1145s - - 2 1145s 1145s - New -------------------------------------------------------------------------- 1145s 1145s | The 2 tests in this section are new. Add tests to store ([Y]es, [N]o, [P]rev, 1145s | [B]rowse, [R]erun, [QQ]uit All, [Q]uit, [H]elp)? 1145s 1145s > 2 + 1 1145s [1] 3 1145s 1145s > warning("goodbye") 1145s Warning: goodbye 1145s 1145s | User input required to proceed, but we are in non-interactive mode. 1145s 1145s | unitizer unchanged. 1145s 1145s | * New: 1 + 1 1145s | * New: warning("hello") 1145s | in 'a.R' 1145s 1145s | * New: 2 + 1 1145s | * New: warning("goodbye") 1145s | in 'b.R' 1145s 1145s | Newly evaluated tests do not match unitizer (New: 4); see above for more info, 1145s | or run in interactive mode. 1145s 1145s Error in unitize_core(test.files = test.files, store.ids = store.ids, : 1145s Cannot proceed in non-interactive mode. 1145s > options(old.opt) 1145s > unlink(temp.dir, recursive=TRUE) 1145s > 1145s > 1145s PASS 1145s Begin testing zz-check.R 1145s 1145s R version 4.3.2 (2023-10-31) -- "Eye Holes" 1145s Copyright (C) 2023 The R Foundation for Statistical Computing 1145s Platform: x86_64-pc-linux-gnu (64-bit) 1145s 1145s R is free software and comes with ABSOLUTELY NO WARRANTY. 1145s You are welcome to redistribute it under certain conditions. 1145s Type 'license()' or 'licence()' for distribution details. 1145s 1145s R is a collaborative project with many contributors. 1145s Type 'contributors()' for more information and 1145s 'citation()' on how to cite R or R packages in publications. 1145s 1145s Type 'demo()' for some demos, 'help()' for on-line help, or 1145s 'help.start()' for an HTML browser interface to help. 1145s Type 'q()' to quit R. 1145s 1145s > source('aammrtf/check.R') 1145s 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?" 1145s Warning message: 1145s In eval(ei, envir) : Some outputs contain non-ASCII: 1145s 't-text.Rout' 1145s > 1145s PASS 1146s autopkgtest [02:43:12]: test run-unit-test: -----------------------] 1146s autopkgtest [02:43:12]: test run-unit-test: - - - - - - - - - - results - - - - - - - - - - 1146s run-unit-test PASS 1146s autopkgtest [02:43:12]: test pkg-r-autopkgtest: preparing testbed 1148s Note, using file '/tmp/autopkgtest.YT3vEq/3-autopkgtest-satdep.dsc' to get the build dependencies 1148s Reading package lists... 1148s Building dependency tree... 1148s Reading state information... 1148s Starting pkgProblemResolver with broken count: 0 1148s Starting 2 pkgProblemResolver with broken count: 0 1148s Done 1148s The following NEW packages will be installed: 1148s dctrl-tools gfortran gfortran-13 gfortran-13-x86-64-linux-gnu 1148s gfortran-x86-64-linux-gnu icu-devtools libblas-dev libbz2-dev 1148s libgfortran-13-dev libicu-dev libjpeg-dev libjpeg-turbo8-dev libjpeg8-dev 1148s liblapack-dev liblzma-dev libncurses-dev libpcre2-16-0 libpcre2-32-0 1148s libpcre2-dev libpcre2-posix3 libpkgconf3 libpng-dev libreadline-dev 1148s pkg-config pkg-r-autopkgtest pkgconf pkgconf-bin r-base-dev zlib1g-dev 1149s 0 upgraded, 29 newly installed, 0 to remove and 0 not upgraded. 1149s Need to get 33.6 MB of archives. 1149s After this operation, 130 MB of additional disk space will be used. 1149s Get:1 http://ftpmaster.internal/ubuntu noble/main amd64 dctrl-tools amd64 2.24-3build2 [66.9 kB] 1149s Get:2 http://ftpmaster.internal/ubuntu noble/main amd64 libgfortran-13-dev amd64 13.2.0-17ubuntu2 [942 kB] 1149s Get:3 http://ftpmaster.internal/ubuntu noble/main amd64 gfortran-13-x86-64-linux-gnu amd64 13.2.0-17ubuntu2 [11.6 MB] 1149s Get:4 http://ftpmaster.internal/ubuntu noble/main amd64 gfortran-13 amd64 13.2.0-17ubuntu2 [10.3 kB] 1149s Get:5 http://ftpmaster.internal/ubuntu noble/main amd64 gfortran-x86-64-linux-gnu amd64 4:13.2.0-7ubuntu1 [1024 B] 1149s Get:6 http://ftpmaster.internal/ubuntu noble/main amd64 gfortran amd64 4:13.2.0-7ubuntu1 [1176 B] 1149s Get:7 http://ftpmaster.internal/ubuntu noble/main amd64 icu-devtools amd64 74.2-1ubuntu1 [212 kB] 1149s Get:8 http://ftpmaster.internal/ubuntu noble/main amd64 libblas-dev amd64 3.12.0-3 [170 kB] 1149s Get:9 http://ftpmaster.internal/ubuntu noble/main amd64 libbz2-dev amd64 1.0.8-5ubuntu1 [33.6 kB] 1149s Get:10 http://ftpmaster.internal/ubuntu noble/main amd64 libicu-dev amd64 74.2-1ubuntu1 [11.9 MB] 1149s Get:11 http://ftpmaster.internal/ubuntu noble/main amd64 libjpeg-turbo8-dev amd64 2.1.5-2ubuntu1 [294 kB] 1149s Get:12 http://ftpmaster.internal/ubuntu noble/main amd64 libjpeg8-dev amd64 8c-2ubuntu11 [1484 B] 1149s Get:13 http://ftpmaster.internal/ubuntu noble/main amd64 libjpeg-dev amd64 8c-2ubuntu11 [1482 B] 1149s Get:14 http://ftpmaster.internal/ubuntu noble/main amd64 liblapack-dev amd64 3.12.0-3 [5196 kB] 1149s Get:15 http://ftpmaster.internal/ubuntu noble/main amd64 libncurses-dev amd64 6.4+20240113-1ubuntu1 [384 kB] 1149s Get:16 http://ftpmaster.internal/ubuntu noble/main amd64 libpcre2-16-0 amd64 10.42-4ubuntu1 [211 kB] 1149s Get:17 http://ftpmaster.internal/ubuntu noble/main amd64 libpcre2-32-0 amd64 10.42-4ubuntu1 [198 kB] 1149s Get:18 http://ftpmaster.internal/ubuntu noble/main amd64 libpcre2-posix3 amd64 10.42-4ubuntu1 [6808 B] 1149s Get:19 http://ftpmaster.internal/ubuntu noble/main amd64 libpcre2-dev amd64 10.42-4ubuntu1 [743 kB] 1149s Get:20 http://ftpmaster.internal/ubuntu noble/main amd64 libpkgconf3 amd64 1.8.1-2 [31.1 kB] 1149s Get:21 http://ftpmaster.internal/ubuntu noble/main amd64 zlib1g-dev amd64 1:1.3.dfsg-3ubuntu1 [896 kB] 1149s Get:22 http://ftpmaster.internal/ubuntu noble/main amd64 libpng-dev amd64 1.6.43-1 [264 kB] 1149s Get:23 http://ftpmaster.internal/ubuntu noble/main amd64 libreadline-dev amd64 8.2-3 [167 kB] 1149s Get:24 http://ftpmaster.internal/ubuntu noble/main amd64 pkgconf-bin amd64 1.8.1-2 [20.7 kB] 1149s Get:25 http://ftpmaster.internal/ubuntu noble/main amd64 pkgconf amd64 1.8.1-2 [16.8 kB] 1149s Get:26 http://ftpmaster.internal/ubuntu noble/main amd64 pkg-config amd64 1.8.1-2 [7170 B] 1149s Get:27 http://ftpmaster.internal/ubuntu noble/main amd64 liblzma-dev amd64 5.4.5-0.3 [205 kB] 1149s Get:28 http://ftpmaster.internal/ubuntu noble/universe amd64 r-base-dev all 4.3.2-1build1 [4336 B] 1149s Get:29 http://ftpmaster.internal/ubuntu noble/universe amd64 pkg-r-autopkgtest all 20231212ubuntu1 [6448 B] 1149s Fetched 33.6 MB in 0s (117 MB/s) 1149s Selecting previously unselected package dctrl-tools. 1149s (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 ... 88182 files and directories currently installed.) 1149s Preparing to unpack .../00-dctrl-tools_2.24-3build2_amd64.deb ... 1149s Unpacking dctrl-tools (2.24-3build2) ... 1149s Selecting previously unselected package libgfortran-13-dev:amd64. 1149s Preparing to unpack .../01-libgfortran-13-dev_13.2.0-17ubuntu2_amd64.deb ... 1149s Unpacking libgfortran-13-dev:amd64 (13.2.0-17ubuntu2) ... 1149s Selecting previously unselected package gfortran-13-x86-64-linux-gnu. 1149s Preparing to unpack .../02-gfortran-13-x86-64-linux-gnu_13.2.0-17ubuntu2_amd64.deb ... 1149s Unpacking gfortran-13-x86-64-linux-gnu (13.2.0-17ubuntu2) ... 1149s Selecting previously unselected package gfortran-13. 1149s Preparing to unpack .../03-gfortran-13_13.2.0-17ubuntu2_amd64.deb ... 1149s Unpacking gfortran-13 (13.2.0-17ubuntu2) ... 1149s Selecting previously unselected package gfortran-x86-64-linux-gnu. 1149s Preparing to unpack .../04-gfortran-x86-64-linux-gnu_4%3a13.2.0-7ubuntu1_amd64.deb ... 1149s Unpacking gfortran-x86-64-linux-gnu (4:13.2.0-7ubuntu1) ... 1149s Selecting previously unselected package gfortran. 1149s Preparing to unpack .../05-gfortran_4%3a13.2.0-7ubuntu1_amd64.deb ... 1149s Unpacking gfortran (4:13.2.0-7ubuntu1) ... 1149s Selecting previously unselected package icu-devtools. 1149s Preparing to unpack .../06-icu-devtools_74.2-1ubuntu1_amd64.deb ... 1149s Unpacking icu-devtools (74.2-1ubuntu1) ... 1150s Selecting previously unselected package libblas-dev:amd64. 1150s Preparing to unpack .../07-libblas-dev_3.12.0-3_amd64.deb ... 1150s Unpacking libblas-dev:amd64 (3.12.0-3) ... 1150s Selecting previously unselected package libbz2-dev:amd64. 1150s Preparing to unpack .../08-libbz2-dev_1.0.8-5ubuntu1_amd64.deb ... 1150s Unpacking libbz2-dev:amd64 (1.0.8-5ubuntu1) ... 1150s Selecting previously unselected package libicu-dev:amd64. 1150s Preparing to unpack .../09-libicu-dev_74.2-1ubuntu1_amd64.deb ... 1150s Unpacking libicu-dev:amd64 (74.2-1ubuntu1) ... 1150s Selecting previously unselected package libjpeg-turbo8-dev:amd64. 1150s Preparing to unpack .../10-libjpeg-turbo8-dev_2.1.5-2ubuntu1_amd64.deb ... 1150s Unpacking libjpeg-turbo8-dev:amd64 (2.1.5-2ubuntu1) ... 1150s Selecting previously unselected package libjpeg8-dev:amd64. 1150s Preparing to unpack .../11-libjpeg8-dev_8c-2ubuntu11_amd64.deb ... 1150s Unpacking libjpeg8-dev:amd64 (8c-2ubuntu11) ... 1150s Selecting previously unselected package libjpeg-dev:amd64. 1150s Preparing to unpack .../12-libjpeg-dev_8c-2ubuntu11_amd64.deb ... 1150s Unpacking libjpeg-dev:amd64 (8c-2ubuntu11) ... 1150s Selecting previously unselected package liblapack-dev:amd64. 1150s Preparing to unpack .../13-liblapack-dev_3.12.0-3_amd64.deb ... 1150s Unpacking liblapack-dev:amd64 (3.12.0-3) ... 1150s Selecting previously unselected package libncurses-dev:amd64. 1150s Preparing to unpack .../14-libncurses-dev_6.4+20240113-1ubuntu1_amd64.deb ... 1150s Unpacking libncurses-dev:amd64 (6.4+20240113-1ubuntu1) ... 1150s Selecting previously unselected package libpcre2-16-0:amd64. 1150s Preparing to unpack .../15-libpcre2-16-0_10.42-4ubuntu1_amd64.deb ... 1150s Unpacking libpcre2-16-0:amd64 (10.42-4ubuntu1) ... 1150s Selecting previously unselected package libpcre2-32-0:amd64. 1150s Preparing to unpack .../16-libpcre2-32-0_10.42-4ubuntu1_amd64.deb ... 1150s Unpacking libpcre2-32-0:amd64 (10.42-4ubuntu1) ... 1150s Selecting previously unselected package libpcre2-posix3:amd64. 1150s Preparing to unpack .../17-libpcre2-posix3_10.42-4ubuntu1_amd64.deb ... 1150s Unpacking libpcre2-posix3:amd64 (10.42-4ubuntu1) ... 1150s Selecting previously unselected package libpcre2-dev:amd64. 1150s Preparing to unpack .../18-libpcre2-dev_10.42-4ubuntu1_amd64.deb ... 1150s Unpacking libpcre2-dev:amd64 (10.42-4ubuntu1) ... 1150s Selecting previously unselected package libpkgconf3:amd64. 1150s Preparing to unpack .../19-libpkgconf3_1.8.1-2_amd64.deb ... 1150s Unpacking libpkgconf3:amd64 (1.8.1-2) ... 1150s Selecting previously unselected package zlib1g-dev:amd64. 1150s Preparing to unpack .../20-zlib1g-dev_1%3a1.3.dfsg-3ubuntu1_amd64.deb ... 1150s Unpacking zlib1g-dev:amd64 (1:1.3.dfsg-3ubuntu1) ... 1150s Selecting previously unselected package libpng-dev:amd64. 1150s Preparing to unpack .../21-libpng-dev_1.6.43-1_amd64.deb ... 1150s Unpacking libpng-dev:amd64 (1.6.43-1) ... 1150s Selecting previously unselected package libreadline-dev:amd64. 1150s Preparing to unpack .../22-libreadline-dev_8.2-3_amd64.deb ... 1150s Unpacking libreadline-dev:amd64 (8.2-3) ... 1150s Selecting previously unselected package pkgconf-bin. 1150s Preparing to unpack .../23-pkgconf-bin_1.8.1-2_amd64.deb ... 1150s Unpacking pkgconf-bin (1.8.1-2) ... 1150s Selecting previously unselected package pkgconf:amd64. 1150s Preparing to unpack .../24-pkgconf_1.8.1-2_amd64.deb ... 1150s Unpacking pkgconf:amd64 (1.8.1-2) ... 1150s Selecting previously unselected package pkg-config:amd64. 1150s Preparing to unpack .../25-pkg-config_1.8.1-2_amd64.deb ... 1150s Unpacking pkg-config:amd64 (1.8.1-2) ... 1150s Selecting previously unselected package liblzma-dev:amd64. 1150s Preparing to unpack .../26-liblzma-dev_5.4.5-0.3_amd64.deb ... 1150s Unpacking liblzma-dev:amd64 (5.4.5-0.3) ... 1150s Selecting previously unselected package r-base-dev. 1150s Preparing to unpack .../27-r-base-dev_4.3.2-1build1_all.deb ... 1150s Unpacking r-base-dev (4.3.2-1build1) ... 1150s Selecting previously unselected package pkg-r-autopkgtest. 1150s Preparing to unpack .../28-pkg-r-autopkgtest_20231212ubuntu1_all.deb ... 1150s Unpacking pkg-r-autopkgtest (20231212ubuntu1) ... 1151s Setting up libjpeg-turbo8-dev:amd64 (2.1.5-2ubuntu1) ... 1151s Setting up libncurses-dev:amd64 (6.4+20240113-1ubuntu1) ... 1151s Setting up libreadline-dev:amd64 (8.2-3) ... 1151s Setting up libpcre2-16-0:amd64 (10.42-4ubuntu1) ... 1151s Setting up libpcre2-32-0:amd64 (10.42-4ubuntu1) ... 1151s Setting up libpkgconf3:amd64 (1.8.1-2) ... 1151s Setting up icu-devtools (74.2-1ubuntu1) ... 1151s Setting up pkgconf-bin (1.8.1-2) ... 1151s Setting up liblzma-dev:amd64 (5.4.5-0.3) ... 1151s Setting up zlib1g-dev:amd64 (1:1.3.dfsg-3ubuntu1) ... 1151s Setting up libpcre2-posix3:amd64 (10.42-4ubuntu1) ... 1151s Setting up libjpeg8-dev:amd64 (8c-2ubuntu11) ... 1151s Setting up libgfortran-13-dev:amd64 (13.2.0-17ubuntu2) ... 1151s Setting up libicu-dev:amd64 (74.2-1ubuntu1) ... 1151s Setting up libblas-dev:amd64 (3.12.0-3) ... 1151s update-alternatives: using /usr/lib/x86_64-linux-gnu/blas/libblas.so to provide /usr/lib/x86_64-linux-gnu/libblas.so (libblas.so-x86_64-linux-gnu) in auto mode 1151s Setting up dctrl-tools (2.24-3build2) ... 1151s Setting up libbz2-dev:amd64 (1.0.8-5ubuntu1) ... 1151s Setting up libpcre2-dev:amd64 (10.42-4ubuntu1) ... 1151s Setting up libpng-dev:amd64 (1.6.43-1) ... 1151s Setting up libjpeg-dev:amd64 (8c-2ubuntu11) ... 1151s Setting up gfortran-13-x86-64-linux-gnu (13.2.0-17ubuntu2) ... 1151s Setting up pkgconf:amd64 (1.8.1-2) ... 1151s Setting up gfortran-13 (13.2.0-17ubuntu2) ... 1151s Setting up liblapack-dev:amd64 (3.12.0-3) ... 1151s update-alternatives: using /usr/lib/x86_64-linux-gnu/lapack/liblapack.so to provide /usr/lib/x86_64-linux-gnu/liblapack.so (liblapack.so-x86_64-linux-gnu) in auto mode 1151s Setting up pkg-config:amd64 (1.8.1-2) ... 1151s Setting up gfortran-x86-64-linux-gnu (4:13.2.0-7ubuntu1) ... 1151s Setting up gfortran (4:13.2.0-7ubuntu1) ... 1151s update-alternatives: using /usr/bin/gfortran to provide /usr/bin/f95 (f95) in auto mode 1151s 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 1151s update-alternatives: using /usr/bin/gfortran to provide /usr/bin/f77 (f77) in auto mode 1151s 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 1151s Setting up r-base-dev (4.3.2-1build1) ... 1151s Setting up pkg-r-autopkgtest (20231212ubuntu1) ... 1151s Processing triggers for libc-bin (2.39-0ubuntu6) ... 1151s Processing triggers for man-db (2.12.0-3) ... 1151s Processing triggers for install-info (7.1-3) ... 1157s Reading package lists... 1157s Building dependency tree... 1157s Reading state information... 1157s Starting pkgProblemResolver with broken count: 0 1157s Starting 2 pkgProblemResolver with broken count: 0 1157s Done 1157s The following NEW packages will be installed: 1157s autopkgtest-satdep 1157s 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. 1157s Need to get 0 B/696 B of archives. 1157s After this operation, 0 B of additional disk space will be used. 1157s Get:1 /tmp/autopkgtest.YT3vEq/4-autopkgtest-satdep.deb autopkgtest-satdep amd64 0 [696 B] 1158s Selecting previously unselected package autopkgtest-satdep. 1158s (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 ... 88911 files and directories currently installed.) 1158s Preparing to unpack .../4-autopkgtest-satdep.deb ... 1158s Unpacking autopkgtest-satdep (0) ... 1158s Setting up autopkgtest-satdep (0) ... 1159s (Reading database ... 88911 files and directories currently installed.) 1159s Removing autopkgtest-satdep (0) ... 1159s autopkgtest [02:43:25]: test pkg-r-autopkgtest: /usr/share/dh-r/pkg-r-autopkgtest 1159s autopkgtest [02:43:25]: test pkg-r-autopkgtest: [----------------------- 1159s Test: Try to load the R library unitizer 1159s 1159s R version 4.3.2 (2023-10-31) -- "Eye Holes" 1159s Copyright (C) 2023 The R Foundation for Statistical Computing 1159s Platform: x86_64-pc-linux-gnu (64-bit) 1159s 1159s R is free software and comes with ABSOLUTELY NO WARRANTY. 1159s You are welcome to redistribute it under certain conditions. 1159s Type 'license()' or 'licence()' for distribution details. 1159s 1159s R is a collaborative project with many contributors. 1159s Type 'contributors()' for more information and 1159s 'citation()' on how to cite R or R packages in publications. 1159s 1159s Type 'demo()' for some demos, 'help()' for on-line help, or 1159s 'help.start()' for an HTML browser interface to help. 1159s Type 'q()' to quit R. 1159s 1160s > library('unitizer') 1160s 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. 1160s > 1160s > 1160s Other tests are currently unsupported! 1160s They will be progressively added. 1160s autopkgtest [02:43:26]: test pkg-r-autopkgtest: -----------------------] 1160s autopkgtest [02:43:26]: test pkg-r-autopkgtest: - - - - - - - - - - results - - - - - - - - - - 1160s pkg-r-autopkgtest PASS 1161s autopkgtest [02:43:27]: @@@@@@@@@@@@@@@@@@@@ summary 1161s run-unit-test PASS 1161s pkg-r-autopkgtest PASS 1170s Creating nova instance adt-noble-i386-r-cran-unitizer-20240324-022406-juju-7f2275-prod-proposed-migration-environment-3 from image adt/ubuntu-noble-amd64-server-20240323.img (UUID 5df8a563-0957-4fdd-8453-862df650aaf8)...