Diff of the two buildlogs: -- --- b1/build.log 2023-05-05 07:14:43.040808744 +0000 +++ b2/build.log 2023-05-05 07:19:15.468857978 +0000 @@ -1,6 +1,6 @@ I: pbuilder: network access will be disabled during build -I: Current time: Thu May 4 19:12:54 -12 2023 -I: pbuilder-time-stamp: 1683270774 +I: Current time: Fri May 5 21:14:51 +14 2023 +I: pbuilder-time-stamp: 1683270891 I: Building the build Environment I: extracting base tarball [/var/cache/pbuilder/bookworm-reproducible-base.tgz] I: copying local configuration @@ -16,7 +16,7 @@ I: copying [./ruby-rubocop-ast_1.24.0.orig.tar.gz] I: copying [./ruby-rubocop-ast_1.24.0-2.debian.tar.xz] I: Extracting source -gpgv: Signature made Wed Dec 21 09:30:59 2022 -12 +gpgv: Signature made Thu Dec 22 11:30:59 2022 +14 gpgv: using RSA key 8ED6C3F8BAC9DB7FC130A870F823A2729883C97C gpgv: issuer "kanashiro@debian.org" gpgv: Can't check signature: No public key @@ -29,135 +29,167 @@ dpkg-source: info: applying 0002-Fix-compile-task.patch I: Not using root during the build. I: Installing the build-deps -I: user script /srv/workspace/pbuilder/8631/tmp/hooks/D02_print_environment starting +I: user script /srv/workspace/pbuilder/27715/tmp/hooks/D01_modify_environment starting +debug: Running on virt32a. +I: Changing host+domainname to test build reproducibility +I: Adding a custom variable just for the fun of it... +I: Changing /bin/sh to bash +'/bin/sh' -> '/bin/bash' +lrwxrwxrwx 1 root root 9 May 5 21:15 /bin/sh -> /bin/bash +I: Setting pbuilder2's login shell to /bin/bash +I: Setting pbuilder2's GECOS to second user,second room,second work-phone,second home-phone,second other +I: user script /srv/workspace/pbuilder/27715/tmp/hooks/D01_modify_environment finished +I: user script /srv/workspace/pbuilder/27715/tmp/hooks/D02_print_environment starting I: set - BUILDDIR='/build' - BUILDUSERGECOS='first user,first room,first work-phone,first home-phone,first other' - BUILDUSERNAME='pbuilder1' - BUILD_ARCH='armhf' - DEBIAN_FRONTEND='noninteractive' - DEB_BUILD_OPTIONS='buildinfo=+all reproducible=+all parallel=3' - DISTRIBUTION='bookworm' - HOME='/root' - HOST_ARCH='armhf' + BASH=/bin/sh + BASHOPTS=checkwinsize:cmdhist:complete_fullquote:extquote:force_fignore:globasciiranges:globskipdots:hostcomplete:interactive_comments:patsub_replacement:progcomp:promptvars:sourcepath + BASH_ALIASES=() + BASH_ARGC=() + BASH_ARGV=() + BASH_CMDS=() + BASH_LINENO=([0]="12" [1]="0") + BASH_LOADABLES_PATH=/usr/local/lib/bash:/usr/lib/bash:/opt/local/lib/bash:/usr/pkg/lib/bash:/opt/pkg/lib/bash:. + BASH_SOURCE=([0]="/tmp/hooks/D02_print_environment" [1]="/tmp/hooks/D02_print_environment") + BASH_VERSINFO=([0]="5" [1]="2" [2]="15" [3]="1" [4]="release" [5]="arm-unknown-linux-gnueabihf") + BASH_VERSION='5.2.15(1)-release' + BUILDDIR=/build + BUILDUSERGECOS='second user,second room,second work-phone,second home-phone,second other' + BUILDUSERNAME=pbuilder2 + BUILD_ARCH=armhf + DEBIAN_FRONTEND=noninteractive + DEB_BUILD_OPTIONS='buildinfo=+all reproducible=+all parallel=4' + DIRSTACK=() + DISTRIBUTION=bookworm + EUID=0 + FUNCNAME=([0]="Echo" [1]="main") + GROUPS=() + HOME=/root + HOSTNAME=i-capture-the-hostname + HOSTTYPE=arm + HOST_ARCH=armhf IFS=' ' - INVOCATION_ID='d491b0fa8b4844398caaa736e2a646f3' - LANG='C' - LANGUAGE='en_US:en' - LC_ALL='C' - MAIL='/var/mail/root' - OPTIND='1' - PATH='/usr/sbin:/usr/bin:/sbin:/bin:/usr/games' - PBCURRENTCOMMANDLINEOPERATION='build' - PBUILDER_OPERATION='build' - PBUILDER_PKGDATADIR='/usr/share/pbuilder' - PBUILDER_PKGLIBDIR='/usr/lib/pbuilder' - PBUILDER_SYSCONFDIR='/etc' - PPID='8631' - PS1='# ' - PS2='> ' + INVOCATION_ID=2ad2e4a2e6394e2eaecfff5e4fff3108 + LANG=C + LANGUAGE=it_CH:it + LC_ALL=C + MACHTYPE=arm-unknown-linux-gnueabihf + MAIL=/var/mail/root + OPTERR=1 + OPTIND=1 + OSTYPE=linux-gnueabihf + PATH=/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/i/capture/the/path + PBCURRENTCOMMANDLINEOPERATION=build + PBUILDER_OPERATION=build + PBUILDER_PKGDATADIR=/usr/share/pbuilder + PBUILDER_PKGLIBDIR=/usr/lib/pbuilder + PBUILDER_SYSCONFDIR=/etc + PIPESTATUS=([0]="0") + POSIXLY_CORRECT=y + PPID=27715 PS4='+ ' - PWD='/' - SHELL='/bin/bash' - SHLVL='2' - SUDO_COMMAND='/usr/bin/timeout -k 18.1h 18h /usr/bin/ionice -c 3 /usr/bin/nice /usr/sbin/pbuilder --build --configfile /srv/reproducible-results/rbuild-debian/r-b-build.9lBxm50F/pbuilderrc_BHia --distribution bookworm --hookdir /etc/pbuilder/first-build-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/bookworm-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/r-b-build.9lBxm50F/b1 --logfile b1/build.log ruby-rubocop-ast_1.24.0-2.dsc' - SUDO_GID='114' - SUDO_UID='108' - SUDO_USER='jenkins' - TERM='unknown' - TZ='/usr/share/zoneinfo/Etc/GMT+12' - USER='root' - _='/usr/bin/systemd-run' - http_proxy='http://10.0.0.15:3142/' + PWD=/ + SHELL=/bin/bash + SHELLOPTS=braceexpand:errexit:hashall:interactive-comments:posix + SHLVL=3 + SUDO_COMMAND='/usr/bin/timeout -k 24.1h 24h /usr/bin/ionice -c 3 /usr/bin/nice -n 11 /usr/bin/unshare --uts -- /usr/sbin/pbuilder --build --configfile /srv/reproducible-results/rbuild-debian/r-b-build.9lBxm50F/pbuilderrc_2xV4 --distribution bookworm --hookdir /etc/pbuilder/rebuild-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/bookworm-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/r-b-build.9lBxm50F/b2 --logfile b2/build.log --extrapackages usrmerge ruby-rubocop-ast_1.24.0-2.dsc' + SUDO_GID=113 + SUDO_UID=107 + SUDO_USER=jenkins + TERM=unknown + TZ=/usr/share/zoneinfo/Etc/GMT-14 + UID=0 + USER=root + _='I: set' + http_proxy=http://10.0.0.15:3142/ I: uname -a - Linux jtx1c 5.10.0-22-arm64 #1 SMP Debian 5.10.178-3 (2023-04-22) aarch64 GNU/Linux + Linux i-capture-the-hostname 5.10.0-22-armmp-lpae #1 SMP Debian 5.10.178-3 (2023-04-22) armv7l GNU/Linux I: ls -l /bin - total 5072 - -rwxr-xr-x 1 root root 838488 Apr 23 09:24 bash - -rwxr-xr-x 3 root root 67144 Sep 18 2022 bunzip2 - -rwxr-xr-x 3 root root 67144 Sep 18 2022 bzcat - lrwxrwxrwx 1 root root 6 Sep 18 2022 bzcmp -> bzdiff - -rwxr-xr-x 1 root root 2225 Sep 18 2022 bzdiff - lrwxrwxrwx 1 root root 6 Sep 18 2022 bzegrep -> bzgrep - -rwxr-xr-x 1 root root 4893 Nov 27 2021 bzexe - lrwxrwxrwx 1 root root 6 Sep 18 2022 bzfgrep -> bzgrep - -rwxr-xr-x 1 root root 3775 Sep 18 2022 bzgrep - -rwxr-xr-x 3 root root 67144 Sep 18 2022 bzip2 - -rwxr-xr-x 1 root root 67112 Sep 18 2022 bzip2recover - lrwxrwxrwx 1 root root 6 Sep 18 2022 bzless -> bzmore - -rwxr-xr-x 1 root root 1297 Sep 18 2022 bzmore - -rwxr-xr-x 1 root root 67632 Sep 20 2022 cat - -rwxr-xr-x 1 root root 67676 Sep 20 2022 chgrp - -rwxr-xr-x 1 root root 67644 Sep 20 2022 chmod - -rwxr-xr-x 1 root root 67684 Sep 20 2022 chown - -rwxr-xr-x 1 root root 133532 Sep 20 2022 cp - -rwxr-xr-x 1 root root 132868 Jan 5 01:20 dash - -rwxr-xr-x 1 root root 133220 Sep 20 2022 date - -rwxr-xr-x 1 root root 67732 Sep 20 2022 dd - -rwxr-xr-x 1 root root 68104 Sep 20 2022 df - -rwxr-xr-x 1 root root 133632 Sep 20 2022 dir - -rwxr-xr-x 1 root root 59128 Mar 22 21:02 dmesg - lrwxrwxrwx 1 root root 8 Dec 19 01:33 dnsdomainname -> hostname - lrwxrwxrwx 1 root root 8 Dec 19 01:33 domainname -> hostname - -rwxr-xr-x 1 root root 67560 Sep 20 2022 echo - -rwxr-xr-x 1 root root 41 Jan 24 02:43 egrep - -rwxr-xr-x 1 root root 67548 Sep 20 2022 false - -rwxr-xr-x 1 root root 41 Jan 24 02:43 fgrep - -rwxr-xr-x 1 root root 55748 Mar 22 21:02 findmnt - -rwsr-xr-x 1 root root 26208 Mar 22 20:15 fusermount - -rwxr-xr-x 1 root root 128608 Jan 24 02:43 grep - -rwxr-xr-x 2 root root 2346 Apr 9 2022 gunzip - -rwxr-xr-x 1 root root 6447 Apr 9 2022 gzexe - -rwxr-xr-x 1 root root 64220 Apr 9 2022 gzip - -rwxr-xr-x 1 root root 67032 Dec 19 01:33 hostname - -rwxr-xr-x 1 root root 67720 Sep 20 2022 ln - -rwxr-xr-x 1 root root 35132 Mar 22 21:51 login - -rwxr-xr-x 1 root root 133632 Sep 20 2022 ls - -rwxr-xr-x 1 root root 136808 Mar 22 21:02 lsblk - -rwxr-xr-x 1 root root 67800 Sep 20 2022 mkdir - -rwxr-xr-x 1 root root 67764 Sep 20 2022 mknod - -rwxr-xr-x 1 root root 67596 Sep 20 2022 mktemp - -rwxr-xr-x 1 root root 38504 Mar 22 21:02 more - -rwsr-xr-x 1 root root 38496 Mar 22 21:02 mount - -rwxr-xr-x 1 root root 9824 Mar 22 21:02 mountpoint - -rwxr-xr-x 1 root root 133532 Sep 20 2022 mv - lrwxrwxrwx 1 root root 8 Dec 19 01:33 nisdomainname -> hostname - lrwxrwxrwx 1 root root 14 Apr 2 18:25 pidof -> /sbin/killall5 - -rwxr-xr-x 1 root root 67608 Sep 20 2022 pwd - lrwxrwxrwx 1 root root 4 Apr 23 09:24 rbash -> bash - -rwxr-xr-x 1 root root 67600 Sep 20 2022 readlink - -rwxr-xr-x 1 root root 67672 Sep 20 2022 rm - -rwxr-xr-x 1 root root 67600 Sep 20 2022 rmdir - -rwxr-xr-x 1 root root 67400 Nov 2 2022 run-parts - -rwxr-xr-x 1 root root 133372 Jan 5 07:55 sed - lrwxrwxrwx 1 root root 4 Jan 5 01:20 sh -> dash - -rwxr-xr-x 1 root root 67584 Sep 20 2022 sleep - -rwxr-xr-x 1 root root 67644 Sep 20 2022 stty - -rwsr-xr-x 1 root root 50800 Mar 22 21:02 su - -rwxr-xr-x 1 root root 67584 Sep 20 2022 sync - -rwxr-xr-x 1 root root 336764 Apr 6 02:25 tar - -rwxr-xr-x 1 root root 67144 Nov 2 2022 tempfile - -rwxr-xr-x 1 root root 133224 Sep 20 2022 touch - -rwxr-xr-x 1 root root 67548 Sep 20 2022 true - -rwxr-xr-x 1 root root 9768 Mar 22 20:15 ulockmgr_server - -rwsr-xr-x 1 root root 22108 Mar 22 21:02 umount - -rwxr-xr-x 1 root root 67572 Sep 20 2022 uname - -rwxr-xr-x 2 root root 2346 Apr 9 2022 uncompress - -rwxr-xr-x 1 root root 133632 Sep 20 2022 vdir - -rwxr-xr-x 1 root root 42608 Mar 22 21:02 wdctl - lrwxrwxrwx 1 root root 8 Dec 19 01:33 ypdomainname -> hostname - -rwxr-xr-x 1 root root 1984 Apr 9 2022 zcat - -rwxr-xr-x 1 root root 1678 Apr 9 2022 zcmp - -rwxr-xr-x 1 root root 6460 Apr 9 2022 zdiff - -rwxr-xr-x 1 root root 29 Apr 9 2022 zegrep - -rwxr-xr-x 1 root root 29 Apr 9 2022 zfgrep - -rwxr-xr-x 1 root root 2081 Apr 9 2022 zforce - -rwxr-xr-x 1 root root 8103 Apr 9 2022 zgrep - -rwxr-xr-x 1 root root 2206 Apr 9 2022 zless - -rwxr-xr-x 1 root root 1842 Apr 9 2022 zmore - -rwxr-xr-x 1 root root 4577 Apr 9 2022 znew -I: user script /srv/workspace/pbuilder/8631/tmp/hooks/D02_print_environment finished + total 5092 + -rwxr-xr-x 1 root root 838488 Apr 24 11:24 bash + -rwxr-xr-x 3 root root 67144 Sep 19 2022 bunzip2 + -rwxr-xr-x 3 root root 67144 Sep 19 2022 bzcat + lrwxrwxrwx 1 root root 6 Sep 19 2022 bzcmp -> bzdiff + -rwxr-xr-x 1 root root 2225 Sep 19 2022 bzdiff + lrwxrwxrwx 1 root root 6 Sep 19 2022 bzegrep -> bzgrep + -rwxr-xr-x 1 root root 4893 Nov 28 2021 bzexe + lrwxrwxrwx 1 root root 6 Sep 19 2022 bzfgrep -> bzgrep + -rwxr-xr-x 1 root root 3775 Sep 19 2022 bzgrep + -rwxr-xr-x 3 root root 67144 Sep 19 2022 bzip2 + -rwxr-xr-x 1 root root 67112 Sep 19 2022 bzip2recover + lrwxrwxrwx 1 root root 6 Sep 19 2022 bzless -> bzmore + -rwxr-xr-x 1 root root 1297 Sep 19 2022 bzmore + -rwxr-xr-x 1 root root 67632 Sep 21 2022 cat + -rwxr-xr-x 1 root root 67676 Sep 21 2022 chgrp + -rwxr-xr-x 1 root root 67644 Sep 21 2022 chmod + -rwxr-xr-x 1 root root 67684 Sep 21 2022 chown + -rwxr-xr-x 1 root root 133532 Sep 21 2022 cp + -rwxr-xr-x 1 root root 132868 Jan 6 03:20 dash + -rwxr-xr-x 1 root root 133220 Sep 21 2022 date + -rwxr-xr-x 1 root root 67732 Sep 21 2022 dd + -rwxr-xr-x 1 root root 68104 Sep 21 2022 df + -rwxr-xr-x 1 root root 133632 Sep 21 2022 dir + -rwxr-xr-x 1 root root 59128 Mar 23 23:02 dmesg + lrwxrwxrwx 1 root root 8 Dec 20 03:33 dnsdomainname -> hostname + lrwxrwxrwx 1 root root 8 Dec 20 03:33 domainname -> hostname + -rwxr-xr-x 1 root root 67560 Sep 21 2022 echo + -rwxr-xr-x 1 root root 41 Jan 25 04:43 egrep + -rwxr-xr-x 1 root root 67548 Sep 21 2022 false + -rwxr-xr-x 1 root root 41 Jan 25 04:43 fgrep + -rwxr-xr-x 1 root root 55748 Mar 23 23:02 findmnt + -rwsr-xr-x 1 root root 26208 Mar 23 22:15 fusermount + -rwxr-xr-x 1 root root 128608 Jan 25 04:43 grep + -rwxr-xr-x 2 root root 2346 Apr 10 2022 gunzip + -rwxr-xr-x 1 root root 6447 Apr 10 2022 gzexe + -rwxr-xr-x 1 root root 64220 Apr 10 2022 gzip + -rwxr-xr-x 1 root root 67032 Dec 20 03:33 hostname + -rwxr-xr-x 1 root root 67720 Sep 21 2022 ln + -rwxr-xr-x 1 root root 35132 Mar 23 23:51 login + -rwxr-xr-x 1 root root 133632 Sep 21 2022 ls + -rwxr-xr-x 1 root root 136808 Mar 23 23:02 lsblk + -rwxr-xr-x 1 root root 67800 Sep 21 2022 mkdir + -rwxr-xr-x 1 root root 67764 Sep 21 2022 mknod + -rwxr-xr-x 1 root root 67596 Sep 21 2022 mktemp + -rwxr-xr-x 1 root root 38504 Mar 23 23:02 more + -rwsr-xr-x 1 root root 38496 Mar 23 23:02 mount + -rwxr-xr-x 1 root root 9824 Mar 23 23:02 mountpoint + -rwxr-xr-x 1 root root 133532 Sep 21 2022 mv + lrwxrwxrwx 1 root root 8 Dec 20 03:33 nisdomainname -> hostname + lrwxrwxrwx 1 root root 14 Apr 3 20:25 pidof -> /sbin/killall5 + -rwxr-xr-x 1 root root 67608 Sep 21 2022 pwd + lrwxrwxrwx 1 root root 4 Apr 24 11:24 rbash -> bash + -rwxr-xr-x 1 root root 67600 Sep 21 2022 readlink + -rwxr-xr-x 1 root root 67672 Sep 21 2022 rm + -rwxr-xr-x 1 root root 67600 Sep 21 2022 rmdir + -rwxr-xr-x 1 root root 67400 Nov 3 2022 run-parts + -rwxr-xr-x 1 root root 133372 Jan 6 09:55 sed + lrwxrwxrwx 1 root root 9 May 5 21:15 sh -> /bin/bash + -rwxr-xr-x 1 root root 67584 Sep 21 2022 sleep + -rwxr-xr-x 1 root root 67644 Sep 21 2022 stty + -rwsr-xr-x 1 root root 50800 Mar 23 23:02 su + -rwxr-xr-x 1 root root 67584 Sep 21 2022 sync + -rwxr-xr-x 1 root root 336764 Apr 7 04:25 tar + -rwxr-xr-x 1 root root 67144 Nov 3 2022 tempfile + -rwxr-xr-x 1 root root 133224 Sep 21 2022 touch + -rwxr-xr-x 1 root root 67548 Sep 21 2022 true + -rwxr-xr-x 1 root root 9768 Mar 23 22:15 ulockmgr_server + -rwsr-xr-x 1 root root 22108 Mar 23 23:02 umount + -rwxr-xr-x 1 root root 67572 Sep 21 2022 uname + -rwxr-xr-x 2 root root 2346 Apr 10 2022 uncompress + -rwxr-xr-x 1 root root 133632 Sep 21 2022 vdir + -rwxr-xr-x 1 root root 42608 Mar 23 23:02 wdctl + lrwxrwxrwx 1 root root 8 Dec 20 03:33 ypdomainname -> hostname + -rwxr-xr-x 1 root root 1984 Apr 10 2022 zcat + -rwxr-xr-x 1 root root 1678 Apr 10 2022 zcmp + -rwxr-xr-x 1 root root 6460 Apr 10 2022 zdiff + -rwxr-xr-x 1 root root 29 Apr 10 2022 zegrep + -rwxr-xr-x 1 root root 29 Apr 10 2022 zfgrep + -rwxr-xr-x 1 root root 2081 Apr 10 2022 zforce + -rwxr-xr-x 1 root root 8103 Apr 10 2022 zgrep + -rwxr-xr-x 1 root root 2206 Apr 10 2022 zless + -rwxr-xr-x 1 root root 1842 Apr 10 2022 zmore + -rwxr-xr-x 1 root root 4577 Apr 10 2022 znew +I: user script /srv/workspace/pbuilder/27715/tmp/hooks/D02_print_environment finished -> Attempting to satisfy build-dependencies -> Creating pbuilder-satisfydepends-dummy package Package: pbuilder-satisfydepends-dummy @@ -340,7 +372,7 @@ Get: 133 http://deb.debian.org/debian bookworm/main armhf ruby-rspec-mocks all 3.12.0c0e1m1s0-1 [79.5 kB] Get: 134 http://deb.debian.org/debian bookworm/main armhf ruby-rspec all 3.12.0c0e1m1s0-1 [5084 B] Get: 135 http://deb.debian.org/debian bookworm/main armhf ruby-whitequark-parser all 3.1.3.0-1 [424 kB] -Fetched 45.1 MB in 4s (11.7 MB/s) +Fetched 45.1 MB in 2s (27.1 MB/s) debconf: delaying package configuration, since apt-utils is not installed Selecting previously unselected package libpython3.11-minimal:armhf. (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 ... 19329 files and directories currently installed.) @@ -903,8 +935,19 @@ Writing extended state information... Building tag database... -> Finished parsing the build-deps +Reading package lists... +Building dependency tree... +Reading state information... +usrmerge is already the newest version (35). +0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. I: Building the package -I: Running cd /build/ruby-rubocop-ast-1.24.0/ && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games" HOME="/nonexistent/first-build" dpkg-buildpackage -us -uc -b && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games" HOME="/nonexistent/first-build" dpkg-genchanges -S > ../ruby-rubocop-ast_1.24.0-2_source.changes +I: user script /srv/workspace/pbuilder/27715/tmp/hooks/A99_set_merged_usr starting +Re-configuring usrmerge... +removed '/etc/unsupported-skip-usrmerge-conversion' +The system has been successfully converted. +I: user script /srv/workspace/pbuilder/27715/tmp/hooks/A99_set_merged_usr finished +hostname: Name or service not known +I: Running cd /build/ruby-rubocop-ast-1.24.0/ && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/i/capture/the/path" HOME="/nonexistent/second-build" dpkg-buildpackage -us -uc -b && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/i/capture/the/path" HOME="/nonexistent/second-build" dpkg-genchanges -S > ../ruby-rubocop-ast_1.24.0-2_source.changes dpkg-buildpackage: info: source package ruby-rubocop-ast dpkg-buildpackage: info: source version 1.24.0-2 dpkg-buildpackage: info: source distribution unstable @@ -939,7 +982,7 @@ dh_prep -O--buildsystem=ruby dh_auto_install --destdir=debian/ruby-rubocop-ast/ -O--buildsystem=ruby dh_ruby --install /build/ruby-rubocop-ast-1.24.0/debian/ruby-rubocop-ast -/usr/bin/ruby3.1 -S gem build --config-file /dev/null --verbose /tmp/d20230504-13576-khh6ks/gemspec +/usr/bin/ruby3.1 -S gem build --config-file /dev/null --verbose /tmp/d20230505-9778-98u9zk/gemspec Failed to load /dev/null because it doesn't contain valid YAML hash WARNING: open-ended dependency on parser (>= 3.1.1.0) is not recommended if parser is semantically versioned, use: @@ -949,7 +992,7 @@ Name: rubocop-ast Version: 1.24.0 File: rubocop-ast-1.24.0.gem -/usr/bin/ruby3.1 -S gem install --config-file /dev/null --verbose --local --verbose --no-document --ignore-dependencies --install-dir debian/ruby-rubocop-ast/usr/share/rubygems-integration/all /tmp/d20230504-13576-khh6ks/rubocop-ast-1.24.0.gem +/usr/bin/ruby3.1 -S gem install --config-file /dev/null --verbose --local --verbose --no-document --ignore-dependencies --install-dir debian/ruby-rubocop-ast/usr/share/rubygems-integration/all /tmp/d20230505-9778-98u9zk/rubocop-ast-1.24.0.gem Failed to load /dev/null because it doesn't contain valid YAML hash /build/ruby-rubocop-ast-1.24.0/debian/ruby-rubocop-ast/usr/share/rubygems-integration/all/gems/rubocop-ast-1.24.0/lib/rubocop-ast.rb /build/ruby-rubocop-ast-1.24.0/debian/ruby-rubocop-ast/usr/share/rubygems-integration/all/gems/rubocop-ast-1.24.0/lib/rubocop/ast.rb @@ -1076,580 +1119,13 @@ warning: parser/current is loading parser/ruby31, which recognizes3.1.3-compliant syntax, but you are running 3.1.2. Please see https://github.com/whitequark/parser#compatibility-with-ruby-mri. -Randomized with seed 34265 - -RuboCop::AST::ForNode - #collection - is expected to be sym type - #keyword - is expected to eq "for" - #do? - without a do keyword - is expected not to be do - with a do keyword - is expected to be do - #body - is expected to be sym type - #post_condition_loop? - is expected not to be post condition loop - .new - is expected to be a kind of RuboCop::AST::ForNode - #void_context? - with a do keyword - is expected to be void context - without a do keyword - is expected to be void context - #variable - is expected to be lvasgn type - #loop_keyword? - is expected to be loop keyword - -RuboCop::AST::CasgnNode - #expression - is expected to eq s(:send, nil, :value) - .new - with a `casgn` node - is expected to be a kind of RuboCop::AST::CasgnNode - #namespace - when the parent is a `const` - is expected to eq s(:const, nil, :FOO) - when the parent is a `cbase` - is expected to eq s(:cbase) - when there is no parent - is expected to be nil - #name - is expected to eq :VAR - -RuboCop::AST::SuperNode - #bang_method? - is expected not to be bang method - #receiver - is expected to be nil - .new - with a zsuper node - is expected to be a kind of RuboCop::AST::SuperNode - with a super node - is expected to be a kind of RuboCop::AST::SuperNode - #comparison_method? - is expected not to be comparison method - #method_name - is expected to eq :super - #parenthesized? - with no arguments - when not using parentheses - is expected not to be parenthesized - when using parentheses - is expected to be parenthesized - with arguments - when using parentheses - is expected to be parenthesized - when not using parentheses - is expected not to be parenthesized - #self_receiver? - is expected not to be self receiver - #const_receiver? - is expected not to be const receiver - #dot? - is expected not to be dot - #arguments - with multiple mixed arguments - is expected to eq 2 - with a single literal argument - is expected to eq 1 - with no arguments - is expected to be empty - with a single splat argument - is expected to eq 1 - with multiple literal arguments - is expected to eq 2 - #setter_method? - is expected not to be setter method - #arguments? - with a single splat argument - is expected to be arguments - with a single literal argument - is expected to be arguments - with multiple mixed arguments - is expected to be arguments - with multiple literal arguments - is expected to be arguments - with no arguments - is expected not to be arguments - #method? - when message matches - when argument is a symbol - is expected to be method :super - when argument is a string - is expected to be method "super" - when message does not match - when argument is a string - is expected not to be method "foo" - when argument is a symbol - is expected not to be method :foo - #operator_method? - is expected not to be operator method - #last_argument - with multiple literal arguments - is expected to be sym type - with a single literal argument - is expected to be sym type - with a single splat argument - is expected to be splat type - with no arguments - is expected to be nil - with multiple mixed arguments - is expected to be splat type - #splat_argument? - with mixed arguments - is expected to be splat argument - with regular arguments - is expected not to be splat argument - with no arguments - is expected not to be splat argument - with a splat argument - is expected to be splat argument - #block_node - with a block literal - is expected to be block type - with a block argument - is expected to be nil - with no block - is expected to be nil - #block_argument? - with a block argument - is expected to be block argument - with no arguments - is expected not to be block argument - with regular arguments - is expected not to be block argument - with mixed arguments - is expected to be block argument - #implicit_call? - is expected not to be implicit call - #command? - when argument is a symbol - is expected to be command :super - when argument is a string - is expected to be command "super" - #block_literal? - with no block - is expected not to be block literal - with a block literal - is expected to be block literal - with a block argument - is expected not to be block literal - #first_argument - with multiple literal arguments - is expected to be sym type - with a single literal argument - is expected to be sym type - with no arguments - is expected to be nil - with a single splat argument - is expected to be splat type - with multiple mixed arguments - is expected to be sym type - #macro? - is expected not to be macro - #double_colon? - is expected not to be double colon - #camel_case_method? - is expected not to be camel case method - #assignment_method? - is expected not to be assignment method - #predicate_method? - is expected not to be predicate method - -Set#=== - tests for inclusion - -RuboCop::AST::ClassNode - .new - is expected to be a kind of RuboCop::AST::ClassNode - #identifier - is expected to be const type - #parent_class - when no parent class is specified - is expected to be nil - when a parent class is specified - is expected to be const type - #body - with a single expression body - is expected to be send type - with an empty body - is expected to be nil - with a multi-expression body - is expected to be begin type - -RuboCop::AST::AndAsgnNode - #assignment_node - is expected to be a kind of RuboCop::AST::AsgnNode - #name - is expected to eq :var - .new - is expected to be a kind of RuboCop::AST::AndAsgnNode - #expression - is expected to eq s(:send, nil, :value) - #operator - is expected to eq :"&&" - -RuboCop::AST::StrNode - #character_literal? - with a normal string literal - is expected not to be character literal - with a character literal - is expected to be character literal - with a heredoc - is expected not to be character literal - #heredoc? - with a normal string - is expected not to be heredoc - with a string with interpolation - is expected not to be heredoc - with a heredoc - is expected to be heredoc - .new - with a normal string - is expected to be a kind of RuboCop::AST::StrNode - with a heredoc - is expected to be a kind of RuboCop::AST::StrNode - with a string with interpolation - is expected to be a kind of RuboCop::AST::StrNode - -RuboCop::AST::WhileNode - #loop_keyword? - with a statement while - is expected to be loop keyword - with a modifier while - is expected to be loop keyword - .new - with a modifier while - is expected to be a kind of RuboCop::AST::WhileNode - with a statement while - is expected to be a kind of RuboCop::AST::WhileNode - #keyword - is expected to eq "while" - #post_condition_loop? - with a statement while - is expected not to be post condition loop - with a modifier while - is expected to be post condition loop - #do? - with a do keyword - is expected to be do - without a do keyword - is expected not to be do - #inverse_keyword - is expected to eq "until" - -RuboCop::AST::NodePattern::Parser - sequences - expands ... in sequence head deep inside unions - parses capture vs repetition with correct priority - generates specialized nodes - parses simple sequences properly - parses unions of literals as a set - parses function calls - -RuboCop::AST::CaseNode - .new - is expected to be a kind of RuboCop::AST::CaseNode - #keyword - is expected to eq "case" - #else? - without an else statement - is expected not to be else - with an else statement - is expected to be else - #else_branch - #else? - with an empty else statement - is expected to be nil - without an else statement - is expected to be nil - with an else statement - is expected to be sym type - #branches - when compared to an IfNode - returns the same - when there is no else keyword - returns only then when bodies - when there is an else - returns all the bodies - with an empty else - returns all the bodies - #each_when - when passed a block - yields all the conditions - when not passed a block - is expected to be a kind of Enumerator - #when_branches - is expected to eq 3 - is expected to all be when type - -RuboCop::AST::IntNode - #value - is expected to eq 10 - .new - is expected to be a kind of RuboCop::AST::IntNode - #sign? - explicit positive int - is expected to be sign - explicit negative int - is expected to be sign - -RuboCop::AST::OpAsgnNode - #operator - with **= - is expected to eq :** - with %= - is expected to eq :% - with += - is expected to eq :+ - with /= - is expected to eq :/ - with |= - is expected to eq :| - with &= - is expected to eq :& - with *= - is expected to eq :* - with -= - is expected to eq :- - .new - with an `op_asgn_node` node - is expected to be a kind of RuboCop::AST::OpAsgnNode - #assignment_node - is expected to be a kind of RuboCop::AST::AsgnNode - #expression - is expected to eq s(:send, nil, :value) - #name - is expected to eq :var - -RuboCop::AST::Ext::Range - #line_span - returns the range of lines a range occupies - accepts an `exclude_end` keyword argument - -RuboCop::AST::InPatternNode - when using Ruby 2.7 or newer - #branch_index - is expected to eq 2 - is expected to eq 1 - is expected to eq 0 - #then? - with a then keyword - is expected to be then - without a then keyword - is expected not to be then - #body - with a then keyword - is expected to be sym type - without a then keyword - is expected to be array type - #pattern - with a value pattern - is expected to be int type - with a variable pattern - is expected to be match var type - with an as pattern - is expected to be match as type - with a hash pattern - is expected to be hash pattern type - with an array pattern - is expected to be array pattern type - with a pin operator - is expected to be pin type - with an alternative pattern - is expected to be match alt type - .new - is expected to be a kind of RuboCop::AST::InPatternNode - -RuboCop::AST::EnsureNode - .new - is expected to be a kind of RuboCop::AST::EnsureNode - #body - is expected to be sym type - -RuboCop::AST::YieldNode - #parenthesized? - with no arguments - when not using parentheses - is expected not to be parenthesized - when using parentheses - is expected to be parenthesized - with arguments - when using parentheses - is expected to be parenthesized - when not using parentheses - is expected not to be parenthesized - #first_argument - with a single splat argument - is expected to be splat type - with multiple mixed arguments - is expected to be sym type - with a single literal argument - is expected to be sym type - with no arguments - is expected to be nil - with multiple literal arguments - is expected to be sym type - #operator_method? - is expected not to be operator method - #macro? - is expected not to be macro - #last_argument - with no arguments - is expected to be nil - with a single literal argument - is expected to be sym type - with multiple mixed arguments - is expected to be splat type - with multiple literal arguments - is expected to be sym type - with a single splat argument - is expected to be splat type - #receiver - is expected to be nil - #dot? - is expected not to be dot - #bang_method? - is expected not to be bang method - #block_argument? - is expected not to be block argument - #comparison_method? - is expected not to be comparison method - #camel_case_method? - is expected not to be camel case method - #block_literal? - is expected not to be block literal - #self_receiver? - is expected not to be self receiver - #splat_argument? - with mixed arguments - is expected to be splat argument - with a splat argument - is expected to be splat argument - with regular arguments - is expected not to be splat argument - with no arguments - is expected not to be splat argument - #arguments? - with multiple literal arguments - is expected to be arguments - with a single literal argument - is expected to be arguments - with no arguments - is expected not to be arguments - with a single splat argument - is expected to be arguments - with multiple mixed arguments - is expected to be arguments - #setter_method? - is expected not to be setter method - #command? - when argument is a string - is expected to be command "yield" - when argument is a symbol - is expected to be command :yield - #arguments - with no arguments - is expected to be empty - with multiple mixed arguments - is expected to eq 2 - with multiple literal arguments - is expected to eq 2 - with a single literal argument - is expected to eq 1 - with a single splat argument - is expected to eq 1 - #method? - when message does not match - when argument is a string - is expected not to be method "foo" - when argument is a symbol - is expected not to be method :foo - when message matches - when argument is a string - is expected to be method "yield" - when argument is a symbol - is expected to be method :yield - #predicate_method? - is expected not to be predicate method - #implicit_call? - is expected not to be implicit call - #double_colon? - is expected not to be double colon - #block_node - is expected to be nil - .new - is expected to be a kind of RuboCop::AST::YieldNode - #assignment_method? - is expected not to be assignment method - #const_receiver? - is expected not to be const receiver - #method_name - is expected to eq :yield - -Changelog - merges correctly - parses correctly - Changelog::Entry - generates correct content - -RuboCop::AST::ModuleNode - #identifier - is expected to be const type - #body - with an empty body - is expected to be nil - with a multi-expression body - is expected to be begin type - with a single expression body - is expected to be send type - .new - is expected to be a kind of RuboCop::AST::ModuleNode - -RuboCop::AST::ConstNode - #short_name - is expected to eq :BAZ - #each_path - yields all parts of the namespace - #module_name? - is expected not to be module name - with a constant with a lowercase letter - is expected to be module name - #relative? - with a non-namespaced constant - is expected to be relative - #absolute? - is expected to be absolute - with a non-namespaced constant - is expected not to be absolute - with a constant not starting with :: - is expected not to be absolute - #namespace - is expected to eq "::Foo::Bar" +Randomized with seed 49970 RuboCop::AST::CaseMatchNode when using Ruby 2.7 or newer - .new - is expected to be a kind of RuboCop::AST::CaseMatchNode - #each_in_pattern - when passed a block - yields all the conditions - when not passed a block - is expected to be a kind of Enumerator - #else? - with an else statement - is expected to be else - without an else statement - is expected not to be else #in_pattern_branches - is expected to all be in pattern type is expected to eq 3 - #keyword - is expected to eq "case" + is expected to all be in pattern type #branches when there is an else with else body @@ -1660,1202 +1136,957 @@ returns only then when bodies #else_branch #else? - without an else statement - is expected to be nil - with an else statement - is expected to be sym type with an empty else statement is expected to be empty else type - -RuboCop::AST::RegexpNode - #ignore_case? - with only i option - is expected to be ignore case - with no options - is expected not to be ignore case - with other options - is expected not to be ignore case - with i and other options - is expected to be ignore case - #content - with a multi-line regexp with option - is expected to eq "\n.+\n" - with an empty regexp - is expected to eq "" - with a multi-line regexp without option - is expected to eq "\n.+\n" - with a regexp with option - is expected to eq ".+" - with an empty regexp with option - is expected to eq "" - with a regexp without option - is expected to eq ".+" - #percent_r_literal? - with %r{-delimiters - is expected to be percent r literal - with %r/-delimiters - is expected to be percent r literal - with /-delimiters - is expected not to be percent r literal - with %r<-delimiters - is expected to be percent r literal - with multi-line %r{-delimiters - is expected to be percent r literal - #no_encoding? - with other options - is expected not to be no encoding - with n and other options - is expected to be no encoding - with only n option - is expected to be no encoding - with no options - is expected not to be no encoding - #to_regexp - with a multi-line regexp without option - is expected to eq / -.+ -/ - with a regexp with an "u" option - is expected to eq "/abc/" - with a regexp without option - is expected to eq /.+/ - with a regexp with an "n" option - is expected to eq "/abc/n" - with a multi-line regexp with option - is expected to eq / -.+ -/ix - with a regexp with option - is expected to eq /.+/mix - with a regexp with an "o" option - is expected to eq "/abc/i" - with an empty regexp with option - is expected to eq //ix - with an empty regexp - is expected to eq // - #interpolation? - with regexp quote - is expected to be interpolation - with no interpolation returns false - is expected not to be interpolation - with direct variable interpoation - is expected to be interpolation - #delimiter? - with %r/-delimiters - is expected not to be delimiter "r" - is expected not to be delimiter "%r/" - is expected to be delimiter "/" - is expected not to be delimiter "}" - is expected not to be delimiter "{" - is expected not to be delimiter "%" - is expected not to be delimiter "%r" - with /-delimiters - is expected not to be delimiter "{" - is expected to be delimiter "/" - with %r<-delimiters - is expected to be delimiter "<" - is expected not to be delimiter "r" - is expected not to be delimiter "%r{" - is expected not to be delimiter "%r/" - is expected not to be delimiter "{" - is expected not to be delimiter "%r<" - is expected not to be delimiter "/" - is expected not to be delimiter "%r" - is expected not to be delimiter "%" - is expected to be delimiter ">" - is expected not to be delimiter "}" - with multi-line %r{-delimiters - is expected to be delimiter "}" - is expected not to be delimiter "%r/" - is expected not to be delimiter "%" - is expected not to be delimiter "r" - is expected not to be delimiter "%r{" - is expected not to be delimiter "/" - is expected not to be delimiter "%r" - is expected to be delimiter "{" - with %r{-delimiters - is expected not to be delimiter "%r/" - is expected not to be delimiter "%r" - is expected not to be delimiter "%r{" - is expected to be delimiter "{" - is expected not to be delimiter "%" - is expected not to be delimiter "/" - is expected to be delimiter "}" - is expected not to be delimiter "r" - #options - with a regexp with multiple options - is expected to eq 3 - with a regexp with "o" option - is expected to eq 0 - with a regexp with single option - is expected to eq 1 - with a regexp without option - is expected to eq 0 - with an empty regexp - is expected to eq 0 - #regopt - with a multi-line regexp without option - is expected to be regopt type - is expected to be empty - with an empty regexp - is expected to be regopt type - is expected to be empty - with a regexp without option - is expected to be regopt type - is expected to be empty - with an empty regexp with option - is expected to eq [:i, :x] - is expected to be regopt type - with a multi-line regexp with option - is expected to eq [:i, :m, :x] - is expected to be regopt type - with a regexp with option - is expected to eq [:i, :m, :x] - is expected to be regopt type - #slash_literal? - with %r{-delimiters - is expected not to be slash literal - with %r/-delimiters - is expected not to be slash literal - with %r<-delimiters - is expected not to be slash literal - with /-delimiters - is expected to be slash literal - with multi-line %r{-delimiters - is expected not to be slash literal - #single_interpolation? - with only o option - is expected to be single interpolation - with o and other options - is expected to be single interpolation - with other options - is expected not to be single interpolation - with no options - is expected not to be single interpolation - #delimiters - with %r{-delimiters - is expected to eq ["{", "}"] - with %r<-delimiters - is expected to eq ["<", ">"] - with /-delimiters - is expected to eq ["/", "/"] - with %r/-delimiters - is expected to eq ["/", "/"] - with multi-line %r{-delimiters - is expected to eq ["{", "}"] - #multiline_mode? - with m and other options - is expected to be multiline mode - with other options - is expected not to be multiline mode - with only m option - is expected to be multiline mode - with no options - is expected not to be multiline mode - .new - is expected to be a kind of RuboCop::AST::RegexpNode - #extended? - with x and other options - is expected to be extended - with other options - is expected not to be extended - with only x option - is expected to be extended - with no options - is expected not to be extended - #fixed_encoding? - with only u option - is expected to be fixed encoding - with u and other options - is expected to be fixed encoding - with no options - is expected not to be fixed encoding - with other options - is expected not to be fixed encoding - -RuboCop::AST::BlockNode - #keywords? - when enclosed in do-end keywords - is expected to be keywords - when enclosed in braces - is expected not to be keywords - #opening_delimiter - when enclosed in do-end keywords - is expected to eq "do" - when enclosed in braces - is expected to eq "{" - #argument_list - with no arguments - is expected to be empty - >= Ruby 2.7 - using numbered parameters - with skipped params - is expected to eq [:_1, :_2, :_3, :_4, :_5, :_6, :_7] - with sequential params - is expected to eq [:_1, :_2] - all argument types - is expected to eq [:a, :b, :c, :d, :e, :f, :g, :h, :i] - #single_line? - when block is on a single line - is expected to be single line - when block is on several lines - is expected not to be single line - #receiver - with dot operator call - is expected to eq "foo" - with safe navigation operator call - is expected to eq "foo" - #closing_delimiter - when enclosed in do-end keywords - is expected to eq "end" - when enclosed in braces - is expected to eq "}" - #multiline? - when block is on several lines - is expected to be multiline - when block is on a single line - is expected not to be multiline - #void_context? - when block method is each - is expected to be void context - when block method is not each - is expected not to be void context - when block method is tap - is expected to be void context - #delimiters - when enclosed in do-end keywords - is expected to eq ["do", "end"] - when enclosed in braces - is expected to eq ["{", "}"] - #arguments? - with destructuring arguments - is expected to be arguments - with a single splat argument - is expected to be arguments - with multiple mixed arguments - is expected to be arguments - with a single argument - is expected to be arguments - with no arguments - is expected not to be arguments - >= Ruby 2.7 - using numbered parameters - is expected not to be arguments - #lambda? - when block belongs to a method lambda - is expected to be lambda - when block belongs to a stabby lambda - is expected to be lambda - when block belongs to a non-lambda method - is expected not to be lambda - #arguments - with a single literal argument - is expected to eq 1 - with a single splat argument - is expected to eq 1 - with destructured arguments - is expected to eq 2 - with multiple mixed arguments - is expected to eq 2 - with no arguments - is expected to be empty - >= Ruby 2.7 - using numbered parameters - is expected to be empty - #braces? - when enclosed in braces - is expected to be braces - when enclosed in do-end keywords - is expected not to be braces - .new - is expected to be a kind of RuboCop::AST::BlockNode - -RuboCop::AST::Token - type predicates - #new_line? - returns false for non new line tokens - returns true for new line tokens - #right_bracket? - returns true for all right_bracket tokens - returns false for non right_bracket tokens - #left_bracket? - returns true for all left_bracket tokens - returns false for non left_bracket tokens - #semicolon? - returns false for non semicolon tokens - returns true for semicolon tokens - #left_brace? - returns true for right_bracket tokens - returns false for non right_bracket tokens - #left_ref_bracket? - returns false for non left_ref_bracket tokens - returns true for left_ref_bracket tokens - #comma? - returns false for non comma tokens - returns true for comma tokens - #rescue_modifier? - returns true for rescue modifier tokens - returns false for non rescue modifier tokens - #comment? - returns true for comment tokens - returns false for non comment tokens - #regexp_dots? - returns false for non comma tokens - returns true for regexp tokens - #dot? - returns false for non dot tokens - returns true for dot tokens - with braces & parens - #left_parens? - returns false for non left parens tokens - returns true for left parens tokens - #left_curly_brace? - returns false for non left block brace tokens - returns true for left block brace tokens - #right_parens? - returns true for right parens tokens - returns false for non right parens tokens - #left_brace? - returns true for left hash brace tokens - returns false for non left hash brace tokens - #right_curly_brace? - returns false for non right brace tokens - returns true for all right brace tokens - #equals_sign? - returns false for non equals sign tokens - returns true for equals sign tokens - #left_array_bracket? - returns false for non left_array_bracket tokens - returns true for left_array_bracket tokens - #end? - returns false for non end tokens - returns true for end tokens - #space_before - returns truthy MatchData when there is a space before token - returns nil when it is on the first line - returns nil when there is not a space before token - #column - returns index of first char in token range on that line - #end_pos - returns index of last char in token range of entire source - #space_after - returns truthy MatchData when there is a space after token - returns nil when there is not a space after token - #to_s - returns string of token data - #line - returns line of token - .from_parser_token - sets parser token's range to rubocop token's pos - sets parser token's text to rubocop token's text - sets parser token's type to rubocop token's type - returns a #to_s useful for debugging - #begin_pos - returns index of first char in token range of entire source - -RuboCop::AST::SelfClassNode - .new - is expected to be a kind of RuboCop::AST::SelfClassNode - #identifier - is expected to be self type - #body - with an empty body - is expected to be nil - with a multi-expression body - is expected to be begin type - with a single expression body - is expected to be send type - -RuboCop::AST::ArgNode - #name - with a double splatted argument - is expected to eq :x - with an optional keyword argument - is expected to eq :x - with argument forwarding - with Ruby >= 2.7 - is expected to be nil - with Ruby >= 3.0 - is expected to be nil - with a keyword argument - is expected to eq :x - with a block - is expected to eq :x - with a splatted argument - is expected to eq :x - with a nameless double splatted argument - is expected to be nil - with a regular argument - is expected to eq :x - with a nameless splatted argument - is expected to be nil - with a block argument - is expected to eq :x - with a shadow argument - is expected to eq :x - with an optional argument - is expected to eq :x - #default? - with argument forwarding - with Ruby >= 2.7 - is expected to equal false - with Ruby >= 3.0 - is expected to equal false - with a block - is expected to equal false - with a regular argument - is expected to equal false - with an optional argument - is expected to equal true - with a block argument - is expected to equal false - with a splatted argument - is expected to equal false - with an optional keyword argument - is expected to equal true - with a shadow argument - is expected to equal false - with a double splatted argument - is expected to equal false - .new - with a block - is expected to be a kind of RuboCop::AST::ArgNode - with a keyword argument - is expected to be a kind of RuboCop::AST::ArgNode - with a splatted argument - is expected to be a kind of RuboCop::AST::ArgNode - with an optional keyword argument - is expected to be a kind of RuboCop::AST::ArgNode - with a shadow argument - is expected to be a kind of RuboCop::AST::ArgNode - with an optional argument - is expected to be a kind of RuboCop::AST::ArgNode - with a double splatted argument - is expected to be a kind of RuboCop::AST::ArgNode - with argument forwarding - with Ruby >= 3.0 - is expected to be a kind of RuboCop::AST::ArgNode - with Ruby >= 2.7 - is expected to be a kind of RuboCop::AST::ArgNode - with a lambda literal - is expected to be a kind of RuboCop::AST::ArgNode - with a block argument - is expected to be a kind of RuboCop::AST::ArgNode - with a method definition - is expected to be a kind of RuboCop::AST::ArgNode - #default_value - with a regular argument - is expected to be nil - with an optional argument - is expected to eq s(:int, 42) - with a block - is expected to be nil - with a double splatted argument - is expected to be nil - with argument forwarding - with Ruby >= 3.0 - is expected to be nil - with Ruby >= 2.7 - is expected to be nil - with a block argument - is expected to be nil - with an optional keyword argument - is expected to eq s(:int, 42) - with a splatted argument - is expected to be nil - with a shadow argument - is expected to be nil - -RuboCop::AST::NextNode - behaves like wrapped arguments node + with an else statement + is expected to be sym type + without an else statement + is expected to be nil + #keyword + is expected to eq "case" + #else? + without an else statement + is expected not to be else + with an else statement + is expected to be else + #each_in_pattern + when not passed a block + is expected to be a kind of Enumerator + when passed a block + yields all the conditions .new - with arguments - is expected to be a kind of RuboCop::AST::NextNode - without arguments - is expected to be a kind of RuboCop::AST::NextNode - #arguments - with no arguments - is expected to be empty - with a single argument and braces - is expected to eq 1 - with a single argument - is expected to eq 1 - with multiple literal arguments - is expected to eq 2 - with a single splat argument - is expected to eq 1 - with no arguments and braces - is expected to be empty - -RuboCop::AST::RuboCopCompatibility - when ran from an incompatible version of Rubocop - issues a warning - when ran from a compatible version of Rubocop - issues a warning + is expected to be a kind of RuboCop::AST::CaseMatchNode -RuboCop::AST::RescueNode - #body - is expected to be send type - #else? - without an else statement - is expected not to be else - with an else statement - is expected to be else - #branches - when there is an else - returns all the bodies - with an empty else - returns all the bodies - when there is no else keyword - returns only then rescue bodies - .new - is expected to be a kind of RuboCop::AST::RescueNode - #resbody_branches - is expected to eq 2 - is expected to all be resbody type - #else_branch - without an else statement - is expected to be nil - with an else statement - is expected to be send type +RuboCop::AST::NodePattern + regexp + matches symbols or strings + captures on ... + after a child + behaves like single capture + yields captured value(s) and returns true if there is a block + returns captured values if there is no block + with a remaining set at the end + behaves like single capture + returns captured values if there is no block + yields captured value(s) and returns true if there is a block + with a remaining node type at the end + behaves like single capture + yields captured value(s) and returns true if there is a block + returns captured values if there is no block + with a remaining [] at the end + behaves like single capture + returns captured values if there is no block + yields captured value(s) and returns true if there is a block + with a remaining wildcard at the end + behaves like single capture + yields captured value(s) and returns true if there is a block + returns captured values if there is no block + with a remaining literal at the end + behaves like single capture + returns captured values if there is no block + yields captured value(s) and returns true if there is a block + with a remaining sequence at the end + behaves like single capture + yields captured value(s) and returns true if there is a block + returns captured values if there is no block + with a remaining capture at the end + behaves like multiple capture + returns captured values if there is no block + yields captured value(s) and returns true if there is a block + at the very beginning of a sequence + behaves like single capture + returns captured values if there is no block + yields captured value(s) and returns true if there is a block + with no remaining pattern at the end + behaves like single capture + yields captured value(s) and returns true if there is a block + returns captured values if there is no block + with remaining patterns at the end + behaves like single capture + yields captured value(s) and returns true if there is a block + returns captured values if there is no block + macros + with a pattern with a namespaced call + is expected to match code :hello + when the value is not in the set + behaves like nonmatching + doesn't match + with a pattern with a constant + is expected to match code :hello + when the value is not in the set + behaves like nonmatching + doesn't match + with a pattern without captures + def_node_search + returns the method name + without a predicate name + when called on matching code + returns an enumerator yielding the matches + when called on non-matching code + returns an enumerator yielding nothing + when it errors + raises an error with the right location + with a predicate name + when called on non-matching code + behaves like nonmatching + doesn't match + when it errors + raises an error with the right location + when called on matching code + is expected to match code nil, :foo, s(:sym, :hello), and s(:sym, :world) + def_node_matcher + returns the method name + when called on matching code + is expected to match code :hello + when it errors + raises an error with the right location + when called on non-matching code + behaves like nonmatching + doesn't match + with a pattern with captures + def_node_search + with a predicate name + when called on matching code + is expected to match code nil, :foo, s(:sym, :hello), and s(:sym, :world) + when called on non-matching code + behaves like nonmatching + doesn't match + when it errors + raises an error with the right location + without a predicate name + when called on matching code + returns an enumerator yielding the captures + when the pattern contains keyword_params + returns an enumerator yielding the captures + when helper is called with default keyword_params + is overridden when calling the matcher + some defaults are not params + raises an error + and no value is given to the matcher + uses the defaults + when it errors + raises an error with the right location + when called on non-matching code + returns an enumerator yielding nothing + def_node_matcher + when called on non-matching code + behaves like nonmatching + doesn't match + when called on matching code + is expected to eq :hello + when it errors + raises an error with the right location + commas + with commas randomly strewn around + behaves like invalid + is invalid + comments + behaves like single capture + returns captured values if there is no block + yields captured value(s) and returns true if there is a block + captures within union + with a different number of captures in each branch + behaves like invalid + is invalid + on simple subpatterns + behaves like single capture + returns captured values if there is no block + yields captured value(s) and returns true if there is a block + within nested sequences + behaves like multiple capture + yields captured value(s) and returns true if there is a block + returns captured values if there is no block + with complex nesting + behaves like multiple capture + returns captured values if there is no block + yields captured value(s) and returns true if there is a block + captures which also perform a match + on a set + behaves like single capture + yields captured value(s) and returns true if there is a block + returns captured values if there is no block + when nested + behaves like multiple capture + returns captured values if there is no block + yields captured value(s) and returns true if there is a block + on a sequence + behaves like single capture + yields captured value(s) and returns true if there is a block + returns captured values if there is no block + on [] + behaves like single capture + returns captured values if there is no block + yields captured value(s) and returns true if there is a block + on a literal + behaves like single capture + returns captured values if there is no block + yields captured value(s) and returns true if there is a block + on a node type + behaves like single capture + yields captured value(s) and returns true if there is a block + returns captured values if there is no block + bad syntax + with doubled comma in arg list + behaves like invalid + is invalid + with unsupported subsequence in seq head within union + behaves like invalid + is invalid + with empty union + behaves like invalid + is invalid + with unmatched opening paren and `...` + behaves like invalid + is invalid + with doubled ellipsis + is expected to match code "foo" + with leading comma in arg list + behaves like invalid + is invalid + with empty parentheses + behaves like invalid + is invalid + with negated ellipsis + behaves like invalid + is invalid + with unmatched opening paren + behaves like invalid + is invalid + with empty union subsequence in seq head + behaves like invalid + is invalid + with unmatched closing paren + behaves like invalid + is invalid + with empty intersection + behaves like invalid + is invalid + with unmatched opening curly + behaves like invalid + is invalid + with variadic unions where not supported + behaves like invalid + is invalid + with unmatched closing curly + behaves like invalid + is invalid + with negated closing paren + behaves like invalid + is invalid + with negated closing curly + behaves like invalid + is invalid + predicates + in root position + is expected to match code s(:int, 1) and :inc + with name containing a numeral + is expected to match code s(:int, 1) and :inc + when in last-child position, but all children have already been matched + behaves like nonmatching + doesn't match + when negated + is expected to match code s(:int, 1) and :inc + with a constant argument + for which the predicate is true + is expected to match code s(:int, 1), :+, and s(:int, 2) + for which the predicate is false + behaves like nonmatching + doesn't match + at head position of a sequence + is expected to match code s(:int, 1) and :inc + with one extra argument + for which the predicate is true + is expected to match code s(:send, + s(:int, 1), :+, + s(:int, 2)) and 1 + for which the predicate is false + behaves like nonmatching + doesn't match + with an expression argument + for which the predicate is true + is expected to match code s(:int, 2), :+, and s(:float, 2.0) + for which the predicate is false + behaves like nonmatching + doesn't match + applied to an integer for which the predicate is false + behaves like nonmatching + doesn't match + when captured + behaves like single capture + returns captured values if there is no block + yields captured value(s) and returns true if there is a block + applied to an integer for which the predicate is true + is expected to match code s(:int, 1) and :inc + with a named argument + when not given + raises an error + for which the predicate is false + behaves like nonmatching + doesn't match + for which the predicate is true + is expected to match code s(:send, + s(:int, 1), :+, + s(:int, 2)) and {:param=>1} + with extra arguments + raises an error + with multiple arguments + for which the predicate is false + behaves like nonmatching + doesn't match + for which the predicate is true + is expected to match code s(:str, "c"), "a", and "d" + literals + positive float literals + is expected to match code 1.0 + bare literal + on a matching literal + is expected to match code :bar + on a node + behaves like nonmatching + doesn't match + double quoted string literals + is expected to match code "foo" + single quoted string literals + is expected to match code "foo" + negative float literals + is expected to match code -2.5 + symbol literals + is expected to match code :foo + negative integer literals + is expected to match code -100 + nil + against a node pattern (bug #5470) + behaves like nonmatching + doesn't match + nil value in AST, use nil? method + is expected to match code nil and :foo + nil value in AST + behaves like nonmatching + doesn't match + nil literals + is expected to match code + in any order + without ellipsis + with too many children + behaves like nonmatching + doesn't match + with too few children + behaves like nonmatching + doesn't match + with matching children + behaves like multiple capture + returns captured values if there is no block + yields captured value(s) and returns true if there is a block + with a captured ellipsis + matching non sequential children + behaves like single capture + yields captured value(s) and returns true if there is a block + returns captured values if there is no block + matching all children + behaves like single capture + returns captured values if there is no block + yields captured value(s) and returns true if there is a block + nested + behaves like multiple capture + returns captured values if there is no block + yields captured value(s) and returns true if there is a block + doubled + separated by an ellipsis + behaves like multiple capture + yields captured value(s) and returns true if there is a block + returns captured values if there is no block + separated by fixed argument + behaves like multiple capture + returns captured values if there is no block + yields captured value(s) and returns true if there is a block + captured + without ellipsis + behaves like single capture + returns captured values if there is no block + yields captured value(s) and returns true if there is a block + with an ellipsis + behaves like single capture + yields captured value(s) and returns true if there is a block + returns captured values if there is no block + invalid + doubled with ellipsis in wrong order + behaves like nonmatching + doesn't match + at the beginning of a sequence + behaves like invalid + is invalid + with an ellipsis inside and outside + behaves like multiple capture + returns captured values if there is no block + yields captured value(s) and returns true if there is a block + containing ellipsis not at the end + behaves like invalid + is invalid + doubled with ellipsis + behaves like multiple capture + yields captured value(s) and returns true if there is a block + returns captured values if there is no block + nested + behaves like invalid + is invalid + node type + for a child + on a child with a different type + behaves like nonmatching + doesn't match + on a child litteral + behaves like nonmatching + doesn't match + on a child with the same type + is expected to match code s(:send, nil, :foo) and :bar + in seq head + on a node with the same type + is expected to match code s(:ivar, :@ivar), :+, and s(:int, 2) + on a child with a different type + behaves like nonmatching + doesn't match + .descend + yields the given argument if it is not a Node + yields all children depth first + bare node type + on a node with the same type + is expected to match code s(:send, nil, :obj) and :method + #pattern + returns the pattern + on a node with a matching, hyphenated type + is expected to match code s(:lvasgn, :a), :+, and s(:int, 1) + yaml compatibility + is expected to match code s(:send, nil, :obj) and :method + #== + returns true iff the patterns are similar + #dup + is expected to match code s(:send, nil, :obj) and :method + marshal compatibility + is expected to match code s(:send, nil, :obj) and :method + #to_s + is instructive + on a node with a different type + behaves like nonmatching + doesn't match + unions + nested inside a sequence + is expected to match code s(:const, nil, :Const) and :method + at the top level + containing string literals + is expected to match code s(:str, "a") and :upcase + containing symbol literals + when the AST has a matching symbol + is expected to match code s(:send, nil, :obj) and :b + when the AST does not have a matching symbol + behaves like nonmatching + doesn't match + containing mixed node and literals + is expected to match code nil and :obj + containing multiple [] + on a node which meets some requirements but not all + behaves like nonmatching + doesn't match + on a node which meets all requirements of the second [] + is expected to match code 2.4 + on a node which meets all requirements of the first [] + is expected to match code 3 + containing integer literals + is expected to match code s(:int, 10) and :abs + variadic + with fixed terms + works for cases with fixed arity before and after union + works for cases with variadic terms after union + works for cases with variadic terms before and after union + multiple + works for complex cases + with variadic terms + works for cases with variadic terms after union + works for cases with fixed arity before and after union + works for cases with variadic terms before and after union + with a nested sequence + is expected to match code s(:const, nil, :Const) and :method + funcalls + with multiple arguments + is expected to match code s(:str, "c"), "a", and "d" + without extra arguments + is expected to match code :a and s(:int, 1) + with one argument + is expected to match code s(:str, "foo") and "foo" + simple sequence + with a nested sequence in non-head position + is expected to match code s(:send, + s(:send, nil, :obj), :a) and :b + on a node with the same type and non-matching children + with non-matching selector + behaves like nonmatching + doesn't match + with non-matching receiver type + behaves like nonmatching + doesn't match + on a node with a different type + behaves like nonmatching + doesn't match + on a node with too many children + behaves like nonmatching + doesn't match + on a node with the same type and matching children + is expected to match code s(:int, 1), :+, and s(:int, 1) + with a nested sequence in head position + behaves like invalid + is invalid + descend + with a match multiple levels, depth first + behaves like single capture + returns captured values if there is no block + yields captured value(s) and returns true if there is a block + nested + behaves like single capture + yields captured value(s) and returns true if there is a block + returns captured values if there is no block + with an immediate match + behaves like single capture + yields captured value(s) and returns true if there is a block + returns captured values if there is no block + without match + behaves like nonmatching + doesn't match + with a literal match + is expected to match code s(:int, 1) and s(:array, + s(:array, + s(:int, 2), + s(:int, 3), + s(:array, + s(:array, + s(:int, 5)))), + s(:int, 4)) + ellipsis + preceding multiple captures + behaves like multiple capture + returns captured values if there is no block + yields captured value(s) and returns true if there is a block + with a wildcard at the end, but no remaining child to match it + behaves like nonmatching + doesn't match + with [] at the end, but no remaining child to match it + behaves like nonmatching + doesn't match + with a set at the end, but no remaining child to match it + behaves like nonmatching + doesn't match + at the very beginning of a sequence + is expected to match code s(:int, 10), :*, and s(:int, 1) + with a nested sequence at the end, but no remaining child + behaves like nonmatching + doesn't match + preceding a capture + behaves like single capture + yields captured value(s) and returns true if there is a block + returns captured values if there is no block + with a nodetype at the end, but no remaining child to match it + behaves like nonmatching + doesn't match + wildcards + unnamed wildcards + in head position of a sequence + is expected to match code s(:int, 1), :+, and s(:send, nil, :a) + within a sequence + is expected to match code nil and :Const + negated + behaves like nonmatching + doesn't match + at the root level + is expected to match code s(:sclass, + s(:self), + s(:def, :something, + s(:args), + s(:int, 1))) and :freeze + within a sequence with other patterns intervening + is expected to match code :@abc and s(:int, 22) + named wildcards + within a union + with a succeeding unifying constraint + with branches without the wildcard + encountered first + behaves like invalid + is invalid + encountered after + behaves like invalid + is invalid + with all branches with the wildcard + that can not be unified + behaves like nonmatching + doesn't match + matching another branch + is expected to match code s(:array, + s(:int, 2), + s(:int, 1)) and s(:int, 2) + matching the first branch + is expected to match code s(:array, + s(:int, 1), + s(:int, 2)) and s(:int, 2) + with a preceding unifying constraint + that can not be unified + behaves like nonmatching + doesn't match + matching a branch + is expected to match code s(:int, 2) and s(:array, + s(:int, 2), + s(:int, 1)) + confined to the union + without unification + is expected to match code s(:int, 2) and s(:int, 1) + with partial unification + matching the unified branch + is expected to match code s(:int, 5) and s(:int, 5) + matching the free branch + is expected to match code s(:int, 2) and s(:int, 1) + that can not be unified + behaves like nonmatching + doesn't match + within a sequence with other patterns intervening + is expected to match code :@abc and s(:int, 22) + within a sequence + with values which cannot be unified + behaves like nonmatching + doesn't match + with values which can be unified + is expected to match code s(:int, 5), :+, and s(:int, 5) + unifying the node type with an argument + is expected to match code s(:send, nil, :obj) and :send + at the root level + is expected to match code s(:sclass, + s(:self), + s(:def, :something, + s(:args), + s(:int, 1))) and :freeze + in head position of a sequence + is expected to match code s(:int, 1), :+, and s(:send, nil, :a) + captures on a wildcard + at the root level + behaves like single capture + yields captured value(s) and returns true if there is a block + returns captured values if there is no block + in non-head position in a sequence + behaves like single capture + yields captured value(s) and returns true if there is a block + returns captured values if there is no block + in head position in a sequence + behaves like single capture + yields captured value(s) and returns true if there is a block + returns captured values if there is no block + nested in any child + behaves like multiple capture + returns captured values if there is no block + yields captured value(s) and returns true if there is a block + in a nested sequence + behaves like single capture + returns captured values if there is no block + yields captured value(s) and returns true if there is a block + in head position in a sequence against nil (bug #5470) + behaves like nonmatching + doesn't match + in head position in a sequence against literal (bug #5470) + behaves like nonmatching + doesn't match + caret (ascend) + used with a node type + which matches + is expected to match code 1 + which doesn't match + behaves like nonmatching + doesn't match + inside a union + is expected to match code "abc" + using unification to match self within parent + with self in the right position + is expected to match code 2 + with self in the wrong position + behaves like nonmatching + doesn't match + repeated twice + is expected to match code 1 + within sequence + in head + is expected to match code 1 + of a sequence + is expected to match code 1 + not in head + is expected to match code s(:int, 1) and :inc + of a sequence + is expected to match code s(:int, 1) and :inc + inside an intersection + is expected to match code 1 + repeated + using * + with matching children + behaves like single capture + yields captured value(s) and returns true if there is a block + returns captured values if there is no block + without capture + is expected to match code s(:sym, :hello), s(:int, 1), s(:int, 2), and s(:int, 3) + behaves like repeated pattern + with one match + behaves like single capture + returns captured values if there is no block + yields captured value(s) and returns true if there is a block + at beginning of sequence + behaves like invalid + is invalid + with an ellipsis in the same sequence + is expected to match code "[:hello, 1, 2, 3]" + with no match + behaves like nonmatching + doesn't match + with zero match + behaves like single capture + yields captured value(s) and returns true if there is a block + returns captured values if there is no block + nested with multiple subcaptures + behaves like multiple capture + yields captured value(s) and returns true if there is a block + returns captured values if there is no block + with multiple subcaptures + behaves like multiple capture + returns captured values if there is no block + yields captured value(s) and returns true if there is a block + using ? + behaves like repeated pattern + at beginning of sequence + behaves like invalid + is invalid + with one match + behaves like single capture + yields captured value(s) and returns true if there is a block + returns captured values if there is no block + with an ellipsis in the same sequence + is expected to match code "[:hello, 1, 2, 3]" + with too many matching children + behaves like nonmatching + doesn't match + with zero match + behaves like single capture + returns captured values if there is no block + yields captured value(s) and returns true if there is a block + using + + behaves like repeated pattern + with one match + behaves like single capture + yields captured value(s) and returns true if there is a block + returns captured values if there is no block + at beginning of sequence + behaves like invalid + is invalid + with an ellipsis in the same sequence + is expected to match code "[:hello, 1, 2, 3]" + with matching children + behaves like single capture + yields captured value(s) and returns true if there is a block + returns captured values if there is no block + with zero match + behaves like nonmatching + doesn't match + sequence with trailing ... + on a node with the same type and fewer children + behaves like nonmatching + doesn't match + on a node with non-matching children + behaves like nonmatching + doesn't match + on a node with fewer children, with a wildcard preceding + behaves like nonmatching + doesn't match + on a node with the same type and more children + with 1 child more + is expected to match code s(:int, 1), :blah, and s(:int, 1) + with 2 children more + is expected to match code s(:int, 1), :blah, s(:int, 1), and s(:sym, :something) + on a node with the same type and exact number of children + is expected to match code s(:int, 1) and :blah + on a node with a different type + behaves like nonmatching + doesn't match + params + in a nested sequence + is expected to match code s(:send, + s(:send, + s(:int, 5), :dec), :inc), :inc, and :dec + when preceded by ... + is expected to match code s(:send, + s(:int, 1), :+, + s(:int, 10)) and s(:int, 10) + param number zero + in a position which does not match original target node + behaves like nonmatching + doesn't match + in a position which matches original target node + is expected to match code 1 + when preceded by $... + behaves like single capture + returns captured values if there is no block + yields captured value(s) and returns true if there is a block + when captured + behaves like single capture + returns captured values if there is no block + yields captured value(s) and returns true if there is a block + without explicit number + is expected to match code s(:const, + s(:const, nil, :Namespace), :A), :A, and s(:const, nil, :Namespace) + when inside an intersection + is expected to match code s(:int, 20), 10, and 20 + as named parameters + when provided as argument to match + is expected to match code s(:int, 10) and {:foo=>#} + when extra are provided + raises an ArgumentError + when not provided + raises an ArgumentError + when inside a union, with a nonmatching value + behaves like nonmatching + doesn't match + when negated, with a nonmatching value + is expected to match code s(:const, + s(:const, nil, :Namespace), :B) and :A + in root position + is expected to match code s(:int, 10) and s(:int, 10) + in root position + is expected to match code s(:int, 10) and # + when inside a union, with a matching value + is expected to match code s(:int, 10) and 10 + when negated, with a matching value + behaves like nonmatching + doesn't match + negation + on a string + with a matching string + behaves like nonmatching + doesn't match + with a non-matching symbol + is expected to match code s(:str, "bar") and :upcase + on a set + with a non-matching value + is expected to match code :@a and s(:int, 3) + with a matching value + behaves like nonmatching + doesn't match + on a sequence + with a node with non-matching children + is expected to match code :@b and s(:int, 1) + with a node of different type + is expected to match code :@@a and s(:int, 1) + with a matching node + behaves like nonmatching + doesn't match + on square brackets + with a node which meets all requirements of [] + behaves like nonmatching + doesn't match + with a node which meets only 1 requirement of [] + is expected to match code 1 + when nested in complex ways + with (send str :<< str) + behaves like nonmatching + doesn't match + with (send str :+ (send str :to_i)) + is expected to match code s(:str, "abc"), :+, and s(:send, + s(:str, "1"), :to_i) + with (send int :- int) + is expected to match code s(:int, 1), :-, and s(:int, 1) + on a symbol + with a non-matching symbol, but too many children + behaves like nonmatching + doesn't match + with a matching symbol + behaves like nonmatching + doesn't match + with a non-matching symbol + is expected to match code s(:send, nil, :obj) and :xyz RuboCop::AST::NodePattern::Lexer provides tokens via next_token - with $type+ - is parsed as `$ int + x` + when given a regexp /test/ + round trips when given a regexp /[abc]+\/()?/x round trips + when given a regexp ending with a backslash + does not lexes it properly when given node types and constants distinguishes them - when given a regexp /test/ + when given a regexp /back\\slash/ round trips + with $type+ + is parsed as `$ int + x` when given arithmetic symbols is parsed as `:&` - when given a regexp /back\\slash/ - round trips - when given a regexp ending with a backslash - does not lexes it properly - -RuboCop::AST::ForwardArgsNode - when using Ruby 2.7 or newer - #to_a - is expected to contain exactly (be forward arg type) - -RuboCop::AST::AliasNode - .new - is expected to be a kind of RuboCop::AST::AliasNode - #new_identifier - is expected to eq :foo - is expected to be sym type - #old_identifier - is expected to be sym type - is expected to eq :bar - -RuboCop::AST::DefNode - #bang_method? - with a bang method - is expected to be bang method - with a regular method - is expected not to be bang method - with a predicate method - is expected not to be bang method - #void_context? - with a comparison method - is expected not to be void context - with a regular assignment method - is expected to be void context - with a regular method - is expected not to be void context - with a bracket assignment method - is expected to be void context - with an initializer method - is expected to be void context - #arguments? - with a single keyword argument - is expected to be arguments - with multiple regular arguments - is expected to be arguments - with a single regular argument - is expected to be arguments - with a single rest argument - is expected to be arguments - with multiple mixed arguments - is expected to be arguments - with no arguments - is expected not to be arguments - #self_receiver? - with a class method definition - is expected to be self receiver - with an instance method definition - is expected not to be self receiver - with a singleton method definition - is expected not to be self receiver - #comparison_method? - with a comparison method - is expected to be comparison method - with a regular method - is expected not to be comparison method - #endless? - with endless method definition - is expected to be endless - with standard method definition - is expected not to be endless - #assignment_method? - with a comparison method - is expected not to be assignment method - with a bracket assignment method - is expected to be assignment method - with an assignment method - is expected to be assignment method - with a regular method - is expected not to be assignment method - #const_receiver? - with a class method definition - is expected not to be const receiver - with a singleton method definition - is expected to be const receiver - with an instance method definition - is expected not to be const receiver - #receiver - with a class method definition - is expected to be self type - with an instance method definition - is expected to be nil - with a singleton method definition - is expected to be const type - #first_argument - with multiple mixed arguments - is expected to be arg type - with a single rest argument - is expected to be restarg type - with a single keyword argument - is expected to be kwoptarg type - with a single regular argument - is expected to be arg type - with multiple regular arguments - is expected to be arg type - with no arguments - is expected to be nil - #arguments - with a single rest argument - is expected to eq 1 - with multiple mixed arguments - is expected to eq 2 - with no arguments - is expected to be empty - with argument forwarding - is expected to eq 1 - with multiple regular arguments - is expected to eq 2 - with a single regular argument - is expected to eq 1 - #body - with a multi-expression body - is expected to be begin type - with no body - is expected to be nil - with a single expression body - is expected to be send type - #rest_argument? - with a rest argument - is expected to be rest argument - with mixed arguments - is expected to be rest argument - with no arguments - is expected not to be rest argument - with regular arguments - is expected not to be rest argument - .new - with a defs node - is expected to be a kind of RuboCop::AST::DefNode - with a def node - is expected to be a kind of RuboCop::AST::DefNode - #operator_method? - with a regular method - is expected not to be operator method - with a setter method - is expected not to be operator method - with a binary operator method - is expected to be operator method - with a unary operator method - is expected to be operator method - #camel_case_method? - with a camel case method - is expected to be camel case method - with a regular method - is expected not to be camel case method - #predicate_method? - with a predicate method - is expected to be predicate method - with a bang method - is expected not to be predicate method - with a regular method - is expected not to be predicate method - #method? - when message matches - when argument is a symbol - is expected to be method :bar - when argument is a string - is expected to be method "bar" - when message does not match - when argument is a string - is expected not to be method "foo" - when argument is a symbol - is expected not to be method :foo - #last_argument - with a single keyword argument - is expected to be kwoptarg type - with multiple regular arguments - is expected to be arg type - with a single rest argument - is expected to be restarg type - with a single regular argument - is expected to be arg type - with no arguments - is expected to be nil - with multiple mixed arguments - is expected to be restarg type - #method_name - with a plain method - is expected to eq :foo - with a unary method - is expected to eq :-@ - with a setter method - is expected to eq :foo= - with an operator method - is expected to eq :== - #block_argument? - with a block argument - is expected to be block argument - with regular arguments - is expected not to be block argument - with mixed arguments - is expected to be block argument - with no arguments - is expected not to be block argument - when using Ruby 2.7 or newer - #argument_forwarding? - is expected to be argument forwarding -RuboCop::AST::HashNode - #pairs - with a hash of literals - is expected to eq 3 - is expected to all be pair type - with a hash of variables - is expected to eq 2 - is expected to all be pair type - with an empty hash - is expected to be empty - #each_pair - when not passed a block - is expected to be a kind of Enumerator - when passed a block - yields all the pairs - #each_value - when passed a block - yields all the pairs - when not passed a block - is expected to be a kind of Enumerator - #values - with an empty hash - is expected to be empty - with a hash with literal values - is expected to eq 3 - is expected to all be literal - with a hash with string keys - is expected to all be send type - is expected to eq 2 - #each_key - when not passed a block - is expected to be a kind of Enumerator - when passed a block - yields all the pairs - .new - is expected to be a kind of RuboCop::AST::HashNode - #braces? - as an argument with no braces - is expected not to be braces - with braces - is expected to be braces - as an argument with braces - is expected to be braces - #mixed_delimiters? - when all pairs are using a hash rocket delimiter - is expected not to be mixed delimiters - when all pairs are using a colon delimiter - is expected not to be mixed delimiters - when pairs are using different delimiters - is expected to be mixed delimiters - #keys - with an empty hash - is expected to be empty - with a hash with symbol keys - is expected to eq 3 - is expected to all be sym type - with a hash with string keys - is expected to all be str type - is expected to eq 2 - #empty? - with a hash containing a keyword splat - is expected not to be empty - with an empty hash - is expected to be empty - with a hash containing pairs - is expected not to be empty - #pairs_on_same_line? - with some pairs on the same line - is expected to be pairs on same line - with all pairs on the same line - is expected to be pairs on same line - with no pairs on the same line - is expected not to be pairs on same line +Set#=== + tests for inclusion -RuboCop::AST::RangeNode - .new - with an exclusive range - is expected to be a kind of RuboCop::AST::RangeNode - is expected to be range type - with a beignless range - is expected to be range type - is expected to be a kind of RuboCop::AST::RangeNode - with an inclusive range - is expected to be range type - is expected to be a kind of RuboCop::AST::RangeNode - with an infinite range - is expected to be a kind of RuboCop::AST::RangeNode - is expected to be range type +Changelog + merges correctly + parses correctly + Changelog::Entry + generates correct content -RuboCop::AST::FloatNode - #sign? - explicit positive float - is expected to be sign - explicit negative float - is expected to be sign +RuboCop::AST::DstrNode #value - is expected to eq 1.5 - .new - is expected to be a kind of RuboCop::AST::FloatNode - -RuboCop::AST::IfNode - #keyword - with an unless statement - is expected to eq "unless" - with a ternary operator - is expected to eq "" - with an if statement - is expected to eq "if" - #each_branch - when passed a block - yields all the branches - when not passed a block - is expected to be a kind of Enumerator - #nested_conditional? - with nested conditionals in elsif clause - is expected to be nested conditional - with no nested conditionals - is expected not to be nested conditional - with nested ternary operators - when nested in the truthy branch - is expected to be nested conditional - when nested in the falsey branch - is expected to be nested conditional - with nested conditionals in if clause - is expected to be nested conditional - with nested conditionals in else clause - is expected to be nested conditional - #elsif? - with an elsif statement - is expected to be elsif - without an elsif statement - is expected not to be elsif - with an if statement comtaining an elsif - is expected not to be elsif - #elsif_conditional? - with multiple elsif conditionals - is expected to be elsif conditional - with one elsif conditional - is expected to be elsif conditional - with nested conditionals in if clause - is expected not to be elsif conditional - with nested ternary operators - when nested in the truthy branch - is expected not to be elsif conditional - when nested in the falsey branch - is expected not to be elsif conditional - with nested conditionals in else clause - is expected not to be elsif conditional - #branches - with an else statement - is expected to eq 2 - is expected to all be literal - with an elsif statement - is expected to eq 3 - is expected to all be literal - with an if statement - is expected to all be literal - is expected to eq 1 - with an unless statement - is expected to eq 1 - is expected to all be literal - with a ternary operator - is expected to all be literal - is expected to eq 2 - #else? - with an elsif statement - is expected to be else - without an else statement - is expected not to be elsif - #ternary? - with an unless statement - is expected not to be ternary - with a ternary operator - is expected to be ternary - with an if statement - is expected not to be ternary - #modifier_form? - with a non-modifier if statement - is expected not to be modifier form - with a non-modifier unless statement - is expected not to be modifier form - with a modifier unless statement - is expected to be modifier form - with a ternary operator - is expected not to be modifier form - with a modifier if statement - is expected to be modifier form - #unless? - with a ternary operator - is expected not to be unless - with an unless statement - is expected to be unless - with an if statement - is expected not to be unless - #if_branch - with a ternary operator - is expected to be sym type - with an unless statement - is expected to be sym type - with an if statement - is expected to be sym type - #if? - with a ternary operator - is expected not to be if - with an if statement - is expected to be if - with an unless statement - is expected not to be if - .new - with a regular if statement - is expected to be a kind of RuboCop::AST::IfNode - with a ternary operator - is expected to be a kind of RuboCop::AST::IfNode - with a modifier statement - is expected to be a kind of RuboCop::AST::IfNode - #inverse_keyword? - with an unless statement - is expected to eq "if" - with a ternary operator - is expected to eq "" - with an if statement - is expected to eq "unless" - #else_branch - with an if statement - is expected to be int type - with an unless statement - is expected to be int type - with a ternary operator - is expected to be int type - -RuboCop::AST::ArgsNode - .new - with a lambda literal - is expected to be a kind of RuboCop::AST::ArgsNode - with a method definition - is expected to be a kind of RuboCop::AST::ArgsNode - with a block - is expected to be a kind of RuboCop::AST::ArgsNode - #argument_list - is expected to eq [s(:arg, :a), s(:optarg, :b, - s(:int, 42)), s(:arg, :c), s(:restarg, :d), s(:kwarg, :e), s(:kwoptarg, :f, - s(:int, 42)), s(:kwrestarg, :g), s(:blockarg, :h), s(:shadowarg, :i)] - when using Ruby 2.7 or newer - with argument forwarding - is expected to eq [s(:forward_arg)] - #empty_and_without_delimiters? - with empty arguments - with a block - is expected to equal true - with a method definition - is expected to equal true - with a lambda literal - is expected to equal true - with arguments - with a method definition - is expected to equal false - with a lambda literal - is expected to equal false - with delimiters - with a lambda literal - is expected to equal false - with a block - is expected to equal false - with a method definition - is expected to equal false - -RuboCop::AST::UntilNode - #do? - with a do keyword - is expected to be do - without a do keyword - is expected not to be do - #loop_keyword? - with a modifier until - is expected to be loop keyword - with a statement until - is expected to be loop keyword - #inverse_keyword - is expected to eq "while" - .new - with a statement until - is expected to be a kind of RuboCop::AST::UntilNode - with a modifier until - is expected to be a kind of RuboCop::AST::UntilNode - #keyword - is expected to eq "until" - #post_condition_loop? - with a modifier until - is expected to be post condition loop - with a statement until - is expected not to be post condition loop - -RuboCop::AST::OrAsgnNode - .new - is expected to be a kind of RuboCop::AST::OrAsgnNode - #expression - is expected to eq s(:send, nil, :value) - #name - is expected to eq :var - #operator - is expected to eq :"||" - #assignment_node - is expected to be a kind of RuboCop::AST::AsgnNode - -RuboCop::AST::WhenNode - #each_condition - when passed a block - yields all the conditions - when not passed a block - is expected to be a kind of Enumerator - #conditions - with a single condition - is expected to all be literal - is expected to eq 1 - with a multiple conditions - is expected to eq 3 - is expected to all be literal - .new - is expected to be a kind of RuboCop::AST::WhenNode - #then? - without a then keyword - is expected not to be then - with a then keyword - is expected to be then - #body - with a then keyword - is expected to be sym type - without a then keyword - is expected to be array type - #branch_index - is expected to eq 2 - is expected to eq 1 - is expected to eq 0 + with interpolation + is expected to eq "foo \#{bar} baz" + with a multiline string + is expected to eq "this is a multiline string" + with implicit concatenation + is expected to eq "foo bar baz" RuboCop::AST::ProcessedSource - #file_path - returns file path - #comments - is an array of comments - when the source is invalid - returns [] - #preceding_line - returns source of line before token - #lines - is an array - has same number of elements as line count - contains lines as string without linefeed - #blank? - with source with content - returns false - with source of no content - returns true - #last_token_of - accepts Node as an argument - returns last token for node #buffer is a source buffer - #path - is the path passed to .new - #first_token_of - returns first token for node - accepts Node as an argument - token enumerables - #find_token - yields nil when there is no match - yields correct token - #each_token - yields all tokens - #tokens_within + #last_token_of + returns last token for node accepts Node as an argument - returns tokens for node - when heredoc as argument is present - returns tokens for node after heredoc - returns tokens for heredoc node - returns tokens for node before heredoc - #ast - is the root node of AST - #tokens - has an array of tokens - valid_syntax? - when the source is completely valid - returns true - when the source is valid but has some warning diagnostics - returns true - when the source could not be parsed due to encoding error - returns false - when the source itself is valid encoding but includes strange encoding literals that are accepted by MRI - returns true - when the source is invalid - returns false - when a line starts with an integer literal - tokenizes the source correctly - #following_line - returns source of line after token with heavily commented source + #comments_before_line + returns comments on or before given line #line_with_comment? returns false for lines without comments returns true for lines with comments - #each_comment - yields all comments - #find_comment - yields nil when there is no match - yields correct comment #contains_comment? provided source_range on line with comment is expected to equal true - provided a multiline source_range with at least one line with comment - is expected to equal true provided source_range on line without comment is expected to equal false provided source_range on comment line is expected to equal true + provided a multiline source_range with at least one line with comment + is expected to equal true + #find_comment + yields correct comment + yields nil when there is no match + #each_comment + yields all comments #each_comment_in_lines yields the comments #comment_at_line - returns nil if line has no comment returns the comment at the given line number - #comments_before_line - returns comments on or before given line + returns nil if line has no comment + #blank? + with source of no content + returns true + with source with content + returns false + #first_token_of + returns first token for node + accepts Node as an argument + #following_line + returns source of line after token + #lines + is an array + has same number of elements as line count + contains lines as string without linefeed + token enumerables + #find_token + yields correct token + yields nil when there is no match + #each_token + yields all tokens #[] when an index is passed returns the line @@ -2863,2532 +2094,1673 @@ returns the array of lines when start index and length are passed returns the array of lines - #start_with? - with blank source - returns false - with present source - returns false when passed string that does not start source - returns true when passed string that starts source + #file_path + returns file path + #comments + is an array of comments + when the source is invalid + returns [] + #tokens + has an array of tokens + #tokens_within + accepts Node as an argument + returns tokens for node + when heredoc as argument is present + returns tokens for node before heredoc + returns tokens for node after heredoc + returns tokens for heredoc node #parser_error - when the source lacks encoding comment and is really utf-8 encoded but has been read as US-ASCII - is nil when the source could not be parsed due to encoding error returns the error + when the source lacks encoding comment and is really utf-8 encoded but has been read as US-ASCII + is nil when the source was properly parsed is nil + #path + is the path passed to .new .from_file raises a Errno::ENOENT when the file does not exist when the file exists returns an instance of ProcessedSource sets the file path to the instance's #path - -RuboCop::AST::KeywordSplatNode - #key_delta - with alignment set to :left - when using hash rocket delimiters - when keyword splat is on the same line - is expected to eq 0 - when keyword splat is ahead - is expected to eq 2 - when keyword splat is behind - is expected to eq -2 - when keyword splat is aligned - is expected to eq 0 - when using colon delimiters - when keyword splat is on the same line - is expected to eq 0 - when keyword splat is behind - is expected to eq -2 - when keyword splat is ahead - is expected to eq 2 - when keyword splat is aligned - is expected to eq 0 - with alignment set to :right - when using hash rocket delimiters - when keyword splat is on the same line - is expected to eq 0 - when keyword splat is aligned - is expected to eq 0 - when keyword splat is behind - is expected to eq 0 - when keyword splat is ahead - is expected to eq 0 - when using colon delimiters - when keyword splat is behind - is expected to eq 0 - when keyword splat is aligned - is expected to eq 0 - when keyword splat is ahead - is expected to eq 0 - when keyword splat is on the same line - is expected to eq 0 - #same_line? - when both pairs are on the same line - is expected to be same line s(:kwsplat, - s(:send, nil, :foo)) - when pairs are on separate lines - is expected not to be same line s(:kwsplat, - s(:send, nil, :foo)) - when a multiline pair shares the same line - is expected to be same line s(:kwsplat, - s(:send, nil, :foo)) - is expected to be same line s(:pair, - s(:sym, :a), - s(:begin)) - #colon? - is expected not to be colon - .new - is expected to be a kind of RuboCop::AST::KeywordSplatNode - #key - is expected to eq s(:kwsplat, - s(:send, nil, :foo)) - #value - is expected to eq s(:kwsplat, - s(:send, nil, :foo)) - #hash_rocket? - is expected not to be hash rocket - #value_delta - when using colon delimiters - when keyword splat is behind - is expected to eq 0 - when keyword splat is ahead - is expected to eq 0 - when keyword splat is on the same line - is expected to eq 0 - when keyword splat is left aligned - is expected to eq 0 - when using hash rocket delimiters - when keyword splat is behind - is expected to eq 0 - when keyword splat is left aligned - is expected to eq 0 - when keyword splat is on the same line - is expected to eq 0 - when keyword splat is ahead - is expected to eq 0 - #operator - is expected to eq "**" - -RuboCop::AST::LambdaNode - #method_name - is expected to eq :lambda - #receiver - is expected to be nil - #arguments - is expected to eq 2 - -RuboCop::AST::Node - #module_definition? - nested modules - matches - with Module.new - matches - when using numbered parameter - matches - with ::ModuleName - matches - prepend Module.new - matches - using module keyword - matches - included module definition - matches - namespaced modules - matches - #class_constructor? - class definition on outer scope - matches - module definition with a block - matches - class definition - does not match - class definition with a block - matches - #recursive_basic_literal? - behaves like non literal - returns false for `some_method_call(x, y)` - behaves like non literal - returns false for `[some_method_call]` - behaves like literal - returns true for `{ :a => 1, :b => 2 }` - behaves like non literal - returns false for `(x && false)` - behaves like non literal - returns false for `(x or false)` - behaves like non literal - returns false for `%r{abx#{foo}}ixo` - behaves like literal - returns true for `false` - behaves like literal - returns true for `%r{abx}ixo` - behaves like non literal - returns false for `(x == false)` - behaves like literal - returns true for `(false or true)` - behaves like literal - returns true for `{ a: 1, b: 2 }` - behaves like literal - returns true for `(1)` - behaves like literal - returns true for `(false && true)` - behaves like non literal - returns false for `some_method_call` - behaves like literal - returns true for `(false <=> true)` - behaves like non literal - returns false for `/.#{some_method_call}/` - behaves like literal - returns true for `nil` - behaves like literal - returns true for `1` - behaves like literal - returns true for `/./` - behaves like literal - returns true for `1.0` - behaves like literal - returns true for `[1, 2, 3]` - behaves like literal - returns true for `"#{2}"` - behaves like literal - returns true for `'str'` - behaves like non literal - returns false for `{ :sym => some_method_call }` - behaves like literal - returns true for `!true` - behaves like non literal - returns false for `{ some_method_call => :sym }` - #argument_type? - method arguments - returns true for all argument types - block arguments - returns true for all argument types - sibling_access - returns trivial values for a root node - for a node with siblings - returns the expected values - for a single child - returns the expected values - #numeric_type? - when complex literal - is true - when complex literal whose imaginary part is a rational - is true - when integer literal - is true - when string literal - is true - when float literal - is true - when rational literal - is true - #parent_module_name - when node on top level - is expected to eq "Object" - when node nested in a class << exp - is expected to be nil - when node on class in singleton class - is expected to eq "Foo::#::Bar" - when node nested in an unknown block - is expected to be nil - when node on module - is expected to eq "Foo" - when node on singleton class - is expected to eq "Foo::#" - #conditional? - when post condition loop node - is false - when `if` node - is true - when `case_match` node - is true - when `until` node - is true - when `while` node - is true - when `case` node - is true - #class_definition? - with Struct - matches - when using numbered parameter - matches - with self singleton class - matches - with ::ClassName - matches - constant defined as Struct without block - does not match - namespaced class - matches - with inheritance - matches - with object singleton class - matches - without inheritance - matches - with Class.new - matches - when using numbered parameter - matches - #struct_constructor? - struct definition with a block - matches - ::Struct - matches - struct definition without block - does not match - #pure? - for an array literal - with only literal children - returns true - which contains a method call - returns false - for a hash literal - which contains a method call - returns false - with only literal children - returns true - for a module definition - returns false - for an lvar assignment - returns false - for a nested if - where one branch contains a method call - returns false - where one branch contains an assignment statement - returns false - where the innermost descendants are local vars and literals - returns true - for an ivar assignment - returns false - for an integer literal + valid_syntax? + when the source is completely valid returns true - for a class definition - returns false - for a gvar assignment + when the source is valid but has some warning diagnostics + returns true + when the source itself is valid encoding but includes strange encoding literals that are accepted by MRI + returns true + when the source is invalid returns false - for a regexp - with options - returns true - with interpolated segments - returns false - with no interpolation - returns true - for a method call + when the source could not be parsed due to encoding error returns false - for a cvar assignment + when a line starts with an integer literal + tokenizes the source correctly + #start_with? + with present source + returns false when passed string that does not start source + returns true when passed string that starts source + with blank source returns false - #value_used? - within a singleton class node - is always true - within an array literal - assigned to an ivar - is always true - at the top level - is always false - within a module definition node - is always true - within a while node - is true only for the condition - within a method call node - is always true - within an if...else..end node - nested in a method call - is always true - at the top level - is true only for the condition - within a class definition node - is always true - at the top level - is false - at the end of a block - is always true + #ast + is the root node of AST + #preceding_line + returns source of line before token -RuboCop::AST::SendNode - #dot? - with a unary method - is expected not to be dot - with a double colon - is expected not to be dot - without a dot - is expected not to be dot - with a dot - is expected to be dot - #nonmutating_string_method? - with a nonmutating String method - is expected to be nonmutating string method - with a regular method - is expected not to be nonmutating string method - with a mutating String method - is expected not to be nonmutating string method - #loop_keyword? - is expected not to be loop keyword - #binary_operation?? - with a unary operation - is expected not to be binary operation - with a regular method call - is expected not to be binary operation - with an implicit call method - is expected not to be binary operation - with a binary operation - is expected to be binary operation - #macro? - with a receiver - when parent is a module - is expected not to be macro - when parent is a class - is expected not to be macro - without a receiver - when parent is a class - is expected to be macro - when the condition of an if - is expected not to be macro - when parent is a class constructor - is expected to be macro - without a parent - is expected to be macro - when in the global scope - is expected to be macro - with Ruby >= 2.7 - when parent is a numblock in a macro scope - is expected to be macro - when parent is a begin without a parent - is expected to be macro - when parent is a keyword begin inside of an class - is expected to be macro - when in an if - is expected to be macro - when parent is a block not in a macro scope - is expected not to be macro - when parent is a singleton class - is expected to be macro - when parent is a module - is expected to be macro - when parent is a block in a macro scope - is expected to be macro - when parent is a method definition - is expected not to be macro - when parent is a struct constructor - is expected to be macro - #bare_access_modifier? - when node has an argument - is expected not to be bare access modifier - with Ruby >= 2.7 - when node is access modifier in numblock - is expected to be bare access modifier - when node is access modifier in block - is expected to be bare access modifier - when node is not an access modifier - is expected not to be bare access modifier - when node is a bare `module_function` - is expected to be bare access modifier - #assignment_method? - with a bracket assignment method - is expected to be assignment method - with an assignment method - is expected to be assignment method - with a regular method - is expected not to be assignment method - with a comparison method - is expected not to be assignment method +RuboCop::AST::Procarg0Node .new - with a safe navigation method send - is expected to be a kind of RuboCop::AST::SendNode - with a regular method send - is expected to be a kind of RuboCop::AST::SendNode - #setter_method? - with a regular method - is expected not to be setter method - with a setter method - is expected to be setter method - with an operator method - is expected not to be setter method - with an indexed setter method - is expected to be setter method - #block_node - with no block - is expected to be nil - with Ruby >= 2.7 - with a numblock literal - is expected to be numblock type - with a block argument - is expected to be nil - with a block literal - is expected to be block type - #splat_argument? - with no arguments - is expected not to be splat argument - with regular arguments - is expected not to be splat argument - with mixed arguments - is expected to be splat argument - with a splat argument - is expected to be splat argument - #nonmutating_operator_method? - with a nonmutating binary operator method - is expected to be nonmutating operator method - with a mutating binary operator method - is expected not to be nonmutating operator method - with a regular method - is expected not to be nonmutating operator method - with a nonmutating unary operator method - is expected to be nonmutating operator method - #parenthesized? - with arguments - when using parentheses - is expected to be parenthesized - when not using parentheses - is expected not to be parenthesized - with no arguments - when not using parentheses - is expected not to be parenthesized - when using parentheses - is expected to be parenthesized - #receiver - with no receiver - is expected to be nil - with a variable receiver - is expected to be send type - with a literal receiver - is expected to be str type - #nonmutating_unary_operator_method? - with a regular method - is expected not to be nonmutating unary operator method - with a nonmutating unary operator method - is expected to be nonmutating unary operator method - #double_colon? - with a double colon - is expected to be double colon - with a unary method - is expected not to be double colon - without a dot - is expected not to be double colon - with a dot - is expected not to be double colon - #comparison_method? - with a comparison method - is expected to be comparison method - with a regular method - is expected not to be comparison method - with a negation method - is expected not to be comparison method - #method_name - with an implicit call method - is expected to eq :call - with a plain method - is expected to eq :bar - with an operator method - is expected to eq :== - with a setter method - is expected to eq :bar= - #lambda_literal? - with a lambda method - is expected not to be lambda literal - with a stabby lambda - is expected to be lambda literal - with a non-lambda method - is expected not to be lambda - with `a.() {}` style method - is expected not to be lambda - #negation_method? - with a non-negated method - is expected not to be negation method - with suffix `not` - is expected not to be negation method - with prefix `not` - is expected to be negation method - with prefix bang - is expected to be negation method - #post_condition_loop? - is expected not to be post condition loop - #bang_method? - with a regular method - is expected not to be bang method - with a bang method - is expected to be bang method - with a predicate method - is expected not to be bang method - #arguments? - with multiple mixed arguments - is expected to be arguments - with a single splat argument - is expected to be arguments - with multiple literal arguments - is expected to be arguments - with no arguments - is expected not to be arguments - with a single literal argument - is expected to be arguments - #predicate_method? - with a regular method - is expected not to be predicate method - with a bang method - is expected not to be predicate method - with a predicate method - is expected to be predicate method - #const_receiver? - with a self receiver - is expected not to be const receiver - with a constant receiver - is expected to be const receiver - with a non-constant receiver - is expected not to be const receiver - #block_argument? - with a block argument - is expected to be block argument - with mixed arguments - is expected to be block argument - with regular arguments - is expected not to be block argument - with no arguments - is expected not to be block argument - #block_literal? - with a block argument - is expected not to be block literal - with Ruby >= 2.7 - with a numblock literal - is expected to be block literal - with no block - is expected not to be block literal - with a block literal - is expected to be block literal - #prefix_not? - with a bang method - is expected not to be prefix not - with a non-negated method - is expected not to be prefix not - with keyword `not` - is expected to be prefix not - #access_modifier? - when node is not an access modifier - is expected not to be bare access modifier - when node is a non-bare `module_function` - is expected to be access modifier - when node is a bare `module_function` - is expected to be access modifier - #enumerable_method? - with an enumerable method - is expected to be enumerable method - with a regular method - is expected not to be enumerable method - #camel_case_method? - with a camel case method - is expected to be camel case method - with a regular method - is expected not to be camel case method - #method? - when message does not match - when argument is a string - is expected not to be method "foo" - when argument is a symbol - is expected not to be method :foo - when message matches - when argument is a symbol - is expected to be method :bar - when argument is a string - is expected to be method "bar" - #nonmutating_hash_method? - with a nonmutating Hash method - is expected to be nonmutating hash method - with a regular method - is expected not to be nonmutating hash method - with a mutating Hash method - is expected not to be nonmutating hash method - #first_argument - with a single splat argument - is expected to be splat type - with a single literal argument - is expected to be sym type - with multiple literal arguments - is expected to be sym type - with multiple mixed arguments - is expected to be sym type - with no arguments - is expected to be nil - #command? - when argument is a string - with an explicit receiver - is expected not to be command "bar" - with an implicit receiver - is expected to be command "bar" - when argument is a symbol - with an implicit receiver - is expected to be command :bar - with an explicit receiver - is expected not to be command :bar - #nonmutating_binary_operator_method? - with a mutating binary operator method - is expected not to be nonmutating binary operator method - with a nonmutating binary operator method - is expected to be nonmutating binary operator method - with a regular method - is expected not to be nonmutating binary operator method - #arithmetic_operation? - with a regular method call - is expected not to be arithmetic operation - with a binary arithmetic operation - is expected to be arithmetic operation - with a unary numeric operation - is expected not to be arithmetic operation - #last_argument - with no arguments - is expected to be nil - with a single literal argument - is expected to be sym type - with multiple literal arguments - is expected to be sym type - with multiple mixed arguments - is expected to be splat type - with a single splat argument - is expected to be splat type - #implicit_call? - with an implicit call method - is expected to be implicit call - with a regular method - is expected not to be implicit call - with an explicit call method - is expected not to be implicit call - #nonmutating_array_method? - with a mutating Array method - is expected not to be nonmutating array method - with a regular method - is expected not to be nonmutating array method - with a nonmutating Array method - is expected to be nonmutating array method - #self_receiver? - with a self receiver - is expected to be self receiver - with a non-self receiver - is expected not to be self receiver - with an implicit receiver - is expected not to be self receiver - #lambda? - with a non-lambda method - is expected not to be lambda - with a lambda method - is expected to be lambda - with a stabby lambda method - is expected to be lambda - with a method named lambda in a class - is expected not to be lambda - #non_bare_access_modifier? - when node is a non-bare `module_function` - is expected to be non bare access modifier - when node is not an access modifier - is expected not to be non bare access modifier - when node does not have an argument - is expected not to be non bare access modifier - #operator_method? - with a regular method - is expected not to be operator method - with a binary operator method - is expected to be operator method - with a setter method - is expected not to be operator method - with a unary operator method - is expected to be operator method - #def_modifier? - with a block containing a method definition - is expected not to be def modifier - with a prefixed def modifier - is expected to be def modifier - with several prefixed def modifiers - is expected to be def modifier - #attribute_accessor? - with an accessor - returns the accessor method and Array] - with a call without arguments - is expected to be nil - #arguments - with a single literal argument - is expected to eq 1 - with a single splat argument - is expected to eq 1 - with multiple literal arguments - is expected to eq 2 - with multiple mixed arguments - is expected to eq 2 - with no arguments - is expected to be empty - #def_modifier - with a block containing a method definition - is expected to be nil - with several prefixed def modifiers - is expected to eq :qux - with a prefixed def modifier - is expected to eq :bar - with call with no argument - is expected to be nil - #prefix_bang? - with a non-negated method - is expected not to be prefix bang - with a bang method - is expected to be prefix bang - with keyword `not` - is expected not to be prefix bang - #unary_operation? - with an implicit call method - is expected not to be unary operation - with a binary operation - is expected not to be unary operation - with a unary operation - is expected to be unary operation - with a regular method call - is expected not to be unary operation + with a block + is expected to be a kind of RuboCop::AST::ArgNode + #name + is expected to eq :x -RuboCop::AST::ReturnNode +RuboCop::AST::NextNode behaves like wrapped arguments node - .new - without arguments - is expected to be a kind of RuboCop::AST::ReturnNode - with arguments - is expected to be a kind of RuboCop::AST::ReturnNode #arguments - with a single argument - is expected to eq 1 with multiple literal arguments is expected to eq 2 with a single splat argument is expected to eq 1 with no arguments is expected to be empty - with no arguments and braces - is expected to be empty with a single argument and braces is expected to eq 1 + with a single argument + is expected to eq 1 + with no arguments and braces + is expected to be empty + .new + without arguments + is expected to be a kind of RuboCop::AST::NextNode + with arguments + is expected to be a kind of RuboCop::AST::NextNode -RuboCop::AST::DstrNode - #value - with implicit concatenation - is expected to eq "foo bar baz" - with a multiline string - is expected to eq "this is a multiline string" - with interpolation - is expected to eq "foo \#{bar} baz" - -RuboCop::AST::PairNode - #value_on_new_line? - when value starts on a new line - is expected to be value on new line - when pair is on a single line - is expected not to be value on new line - when value spans multiple lines - is expected not to be value on new line - #value - is expected to be int type - #same_line? - when a multiline pair shares the same line - when last pair is a keyword splat - is expected to be same line s(:kwsplat, - s(:send, nil, :foo)) - is expected to be same line s(:pair, - s(:sym, :a), - s(:begin)) - when both pairs are explicit pairs - is expected to be same line s(:pair, - s(:sym, :b), - s(:int, 2)) - is expected to be same line s(:pair, - s(:sym, :a), - s(:begin)) - when pairs are on separate lines - when last pair is a keyword splat - is expected not to be same line s(:kwsplat, - s(:send, nil, :foo)) - when both pairs are explicit pairs - is expected not to be same line s(:pair, - s(:sym, :b), - s(:int, 2)) - when both pairs are on the same line - when both pair is a keyword splat - is expected to be same line s(:kwsplat, - s(:send, nil, :foo)) - when both pairs are explicit pairs - is expected to be same line s(:pair, - s(:sym, :b), - s(:int, 2)) - #key - when using a symbol key - is expected to be sym type - when using a string key - is expected to be str type - #hash_rocket? - when using a hash rocket delimiter - is expected to be hash rocket - when using a colon delimiter - is expected not to be hash rocket - #value_omission? - when not using hash value omission - is expected not to be value omission - when using hash value omission - is expected to be value omission - #key_delta - with alignment set to :left - when using colon delimiters - when both keys are on the same line - when second pair is a keyword splat - is expected to eq 0 - when both pairs are explicit pairs - is expected to eq 0 - when receiver key is ahead - when second pair is a keyword splat - is expected to eq 2 - when both pairs are explicit pairs - is expected to eq 2 - when receiver key is behind - when both pairs are reail pairs - is expected to eq -2 - when second pair is a keyword splat - is expected to eq -2 - when keys are aligned - when both pairs are explicit pairs - is expected to eq 0 - when second pair is a keyword splat - is expected to eq 0 - when using hash rocket delimiters - when keys are aligned - when second key is a keyword splat - is expected to eq 0 - when both keys are explicit keys - is expected to eq 0 - when both keys are on the same line - when second pair is a keyword splat - is expected to eq 0 - when both pairs are explicit pairs - is expected to eq 0 - when receiver key is behind - when second pair is a keyword splat - is expected to eq -2 - when both pairs are explicit pairs - is expected to eq -2 - when receiver key is ahead - when both pairs are explicit pairs - is expected to eq 2 - when second pair is a keyword splat - is expected to eq 2 - with alignment set to :right - when using hash rocket delimiters - when both keys are on the same line - when second pair is a keyword splat - is expected to eq 0 - when both pairs are explicit pairs - is expected to eq 0 - when receiver key is ahead - when both pairs are explicit pairs - is expected to eq 2 - when second pair is a keyword splat - is expected to eq 0 - when receiver key is behind - when second pair is a keyword splat - is expected to eq 0 - when both pairs are explicit pairs - is expected to eq -2 - when keys are aligned - when both keys are explicit keys - is expected to eq 0 - when second key is a keyword splat - is expected to eq 0 - when using colon delimiters - when keys are aligned - when second pair is a keyword splat - is expected to eq 0 - when both pairs are explicit pairs - is expected to eq 0 - when receiver key is behind - when both pairs are reail pairs - is expected to eq -2 - when second pair is a keyword splat - is expected to eq 0 - when both keys are on the same line - when both pairs are explicit pairs - is expected to eq 0 - when second pair is a keyword splat - is expected to eq 0 - when receiver key is ahead - when both pairs are explicit pairs - is expected to eq 2 - when second pair is a keyword splat - is expected to eq 0 - #colon? - when using a hash rocket delimiter - is expected not to be colon - when using a colon delimiter - is expected to be colon - #delimiter - when using a colon delimiter - is expected to eq ": " - is expected to eq ":" - when using a hash rocket delimiter - is expected to eq "=>" - is expected to eq " => " - .new - is expected to be a kind of RuboCop::AST::PairNode - #inverse_delimiter - when using a hash rocket delimiter - is expected to eq ":" - is expected to eq ": " - when using a colon delimiter - is expected to eq "=>" - is expected to eq " => " - #value_delta - when using colon delimiters - when values are aligned - when both pairs are explicit pairs - is expected to eq 0 - when second pair is a keyword splat - is expected to eq 0 - when receiver value is behind - is expected to eq -2 - when both pairs are on the same line - is expected to eq 0 - when receiver value is ahead - is expected to eq 2 - when using hash rocket delimiters - when both pairs are on the same line - is expected to eq 0 - when receiver value is ahead - is expected to eq 2 - when receiver value is behind - is expected to eq -2 - when values are aligned - when both pairs are explicit pairs - is expected to eq 0 - when second pair is a keyword splat - is expected to eq 0 - -RuboCop::AST::AndNode - .new - with a logical and node - is expected to be a kind of RuboCop::AST::AndNode - with a semantic and node - is expected to be a kind of RuboCop::AST::AndNode - #rhs - with a logical and node +RuboCop::AST::IfNode + #else_branch + with a ternary operator is expected to be int type - with a semantic and node + with an if statement is expected to be int type - #lhs - with a logical and node + with an unless statement + is expected to be int type + #else? + without an else statement + is expected not to be elsif + with an elsif statement + is expected to be else + #nested_conditional? + with no nested conditionals + is expected not to be nested conditional + with nested conditionals in if clause + is expected to be nested conditional + with nested ternary operators + when nested in the truthy branch + is expected to be nested conditional + when nested in the falsey branch + is expected to be nested conditional + with nested conditionals in else clause + is expected to be nested conditional + with nested conditionals in elsif clause + is expected to be nested conditional + #unless? + with an unless statement + is expected to be unless + with an if statement + is expected not to be unless + with a ternary operator + is expected not to be unless + #ternary? + with a ternary operator + is expected to be ternary + with an unless statement + is expected not to be ternary + with an if statement + is expected not to be ternary + #each_branch + when not passed a block + is expected to be a kind of Enumerator + when passed a block + yields all the branches + #elsif? + with an if statement comtaining an elsif + is expected not to be elsif + with an elsif statement + is expected to be elsif + without an elsif statement + is expected not to be elsif + #keyword + with an unless statement + is expected to eq "unless" + with an if statement + is expected to eq "if" + with a ternary operator + is expected to eq "" + #modifier_form? + with a non-modifier unless statement + is expected not to be modifier form + with a modifier if statement + is expected to be modifier form + with a non-modifier if statement + is expected not to be modifier form + with a modifier unless statement + is expected to be modifier form + with a ternary operator + is expected not to be modifier form + #if_branch + with an if statement is expected to be sym type - with a semantic and node + with a ternary operator is expected to be sym type - #semantic_operator? - with a semantic and node - is expected to be semantic operator - with a logical and node - is expected not to be semantic operator - #logical_operator? - with a semantic and node - is expected not to be logical operator - with a logical and node - is expected to be logical operator - #operator - with a semantic and node - is expected to eq "and" - with a logical and node - is expected to eq "&&" - #inverse_operator - with a logical and node - is expected to eq "||" - with a semantic and node - is expected to eq "or" - #alternate_operator - with a semantic and node - is expected to eq "&&" - with a logical and node - is expected to eq "and" - -RuboCop::AST::DefinedNode + with an unless statement + is expected to be sym type + #inverse_keyword? + with a ternary operator + is expected to eq "" + with an unless statement + is expected to eq "if" + with an if statement + is expected to eq "unless" .new - with a defined? node - is expected to be a kind of RuboCop::AST::DefinedNode - #arguments - is expected to all be sym type - is expected to eq 1 - #method_name - is expected to eq :defined? - #receiver - is expected to be nil + with a modifier statement + is expected to be a kind of RuboCop::AST::IfNode + with a ternary operator + is expected to be a kind of RuboCop::AST::IfNode + with a regular if statement + is expected to be a kind of RuboCop::AST::IfNode + #if? + with an if statement + is expected to be if + with a ternary operator + is expected not to be if + with an unless statement + is expected not to be if + #branches + with an else statement + is expected to eq 2 + is expected to all be literal + with a ternary operator + is expected to eq 2 + is expected to all be literal + with an if statement + is expected to eq 1 + is expected to all be literal + with an unless statement + is expected to all be literal + is expected to eq 1 + with an elsif statement + is expected to eq 3 + is expected to all be literal + #elsif_conditional? + with multiple elsif conditionals + is expected to be elsif conditional + with nested conditionals in else clause + is expected not to be elsif conditional + with nested ternary operators + when nested in the falsey branch + is expected not to be elsif conditional + when nested in the truthy branch + is expected not to be elsif conditional + with nested conditionals in if clause + is expected not to be elsif conditional + with one elsif conditional + is expected to be elsif conditional RuboCop::AST::Traversal knows all current node types - for example if /wat/; end + for example -1.33 traverses all nodes - for example %i[foo bar] + for example foo % 1 traverses all nodes - for example case foo; in [x] then nil; end + for example case foo; in **nil then true; end traverses all nodes - for example yield + for example def f ((a, *, p)); end traverses all nodes - for example a = b = raise :x + for example def String=; end traverses all nodes - when a class defines `on_block_pass` - calls it for all block-pass arguments - for example a b{c(d)}, /x/m do end + for example 'foobar' traverses all nodes - for example /foo#{bar}baz/ + for example begin; meth; rescue => @ex; bar; end traverses all nodes - for example def f(foo=1, bar=2); end + for example foo.a += 1 traverses all nodes - for example <<~FOO - baz\ - qux -FOO + for example %x{#@1} traverses all nodes - for example case foo; in (1) then true; end + for example !foo traverses all nodes - for example def f ; end + for example begin meth end until foo traverses all nodes - for example ::A, foo = foo + for example foo::fun (1) {} traverses all nodes - for example foo === 1 + for example foo.C += raise(bar) rescue nil traverses all nodes - for example case foo; in x, y then nil; end + for example 1.33 traverses all nodes - for example def f(*); end + for example foo = bar, 1 traverses all nodes - for example a += b = raise :x + for example /foo#{bar}baz/ traverses all nodes - for example while class << self; tap do end; end; break; end + for example def a b: +return +end traverses all nodes - for example _1 + for example def f(foo=1, bar=2); end traverses all nodes - for example case foo; in A[] then true; end + for example def f(**nil); end traverses all nodes - for example %x{a\ -b} + for example foo::A += m foo traverses all nodes - for example 1..2 + for example foo[0] += raise bar rescue nil traverses all nodes - for example { foo: 2, **bar } + for example a ||= 1 traverses all nodes - for example foo::a += m foo + for example bar unless foo traverses all nodes - for example m ->(a: ->{_1}) {a} + for example td (1_500).toString(); td.num do; end traverses all nodes - for example m [] do end + for example begin; meth; rescue foo => ex; bar; end traverses all nodes - for example def f ((a, *, p)); end + for example if /wat/; end traverses all nodes - for example case foo; in { a: 1, } then true; end + for example -> * { } traverses all nodes - for example foo += m foo + for example [/()\1/, ?#] traverses all nodes - for example f{ |a,| } + for example :"a\ +b" traverses all nodes - for example meth 1 do end.fun {} + for example module Foo; end traverses all nodes - for example foo[bar,] + for example `foobar` traverses all nodes - for example if foo then bar; end + for example def foo(_, _); end traverses all nodes - for example f{ |a, b,| } + for example true traverses all nodes - for example foo.C += raise bar rescue nil + for example foo "#{(1+1).to_i}" do; end traverses all nodes - for example p <<~E - x - \ y + for example %x{a\ +b} + traverses all nodes + for example f{ } + traverses all nodes + for example def f(foo:); end + traverses all nodes + for example p -> { :hello }, a: 1 do end + traverses all nodes + for example -> a: 1 { } + traverses all nodes + for example f { || a:b } + traverses all nodes + for example p <<~E " y" + x E traverses all nodes - for example self.A, foo = foo + for example self traverses all nodes - for example p ->() do a() do end end + for example '#@1' traverses all nodes - for example a b(c(d)), /x/m do end + for example case foo; in A[] then true; end traverses all nodes - for example lambda{|;a|a} + for example foo.m += raise bar rescue nil traverses all nodes - for example foo ? 1 : 2 + for example case foo; when 'bar', 'baz'; bar; end traverses all nodes - for example a += 1 + for example foo = *bar traverses all nodes - for example foo + for example case foo; in x, y, then nil; end traverses all nodes - for example def f(foo: 1); end + for example case foo; in self then true; end traverses all nodes - for example def self.foo; end + for example module A; _1; end traverses all nodes - for example foo += meth rescue bar + for example a # + # +&.foo traverses all nodes - for example defined? @foo + for example foo[1, 2] = 3 traverses all nodes - for example case foo; in { a: 1 } then true; end + for example -> do rescue; end traverses all nodes - for example return() + for example ?a traverses all nodes - for example %q(foobar) + for example foo =~ 1 traverses all nodes - for example if foo..bar; end + for example if (bar); foo; end traverses all nodes - for example <<-`HERE` -#@@1 -HERE + for example until foo; meth end traverses all nodes - for example yield() + for example foo ** 1 traverses all nodes - for example @var = 10 + for example { 1 => 2 } traverses all nodes - for example def f (((a))); end + for example case foo; in ->{ 42 } then true; end traverses all nodes - for example foo <= 1 + for example a&.b &&= 1 traverses all nodes - for example a # - # -.foo + for example case foo; + in {a: + } + true + ; end traverses all nodes - for example return(foo) + for example foo !~ 1 traverses all nodes - for example BEGIN { 1 } + for example f{ |a| } traverses all nodes - for example p :foo, {"a": proc do end, b: proc do end} + for example def m; class << self; A = nil; end; end traverses all nodes - for example def foo(_, _); end + for example m { |**nil| } traverses all nodes - for example while foo; meth end + for example case foo; when 'bar' then bar; end traverses all nodes - for example foo::Fun() + for example o = { +a: +1 +} traverses all nodes - for example !(a, b = foo) + for example %s{#@1} traverses all nodes - for example p <<~E - x - y -E + for example case foo; in "#{ %Q{a} }": then true; end traverses all nodes - for example def f a, o=1, &b; end + for example %W{a\ +b} + traverses all nodes + for example fun do end traverses all nodes for example p <<~E E traverses all nodes - for example defined? foo + for example case [__FILE__, __LINE__ + 1, __ENCODING__] + in [__FILE__, __LINE__, __ENCODING__] + end + traverses all nodes + for example case foo; in x, then nil; end traverses all nodes for example p <<~"E" x #{foo} E traverses all nodes - for example foo += raise(bar) rescue nil - traverses all nodes - for example %{a\ -b} + for example case foo; + in {a: + 2} + false + ; end traverses all nodes - for example <<-'HERE' -#@1 -HERE + for example break() traverses all nodes - for example p <<~"E" - x\n y -E + for example A += 1 traverses all nodes - for example foo[1, 2] + for example `a\ +b` traverses all nodes - for example fun() { } + for example +42 traverses all nodes - for example class << foo; _1; end + for example ((b, )) = foo traverses all nodes - for example *b = bar + for example a b{c(d)}, 1.0r do end traverses all nodes - for example a b{c(d)}, 1 do end + for example 1... traverses all nodes - for example bar if foo + for example def f *, **; end traverses all nodes - for example foo & 1 + for example class << foo; _1; end traverses all nodes - for example class Foo < a:b; end + for example %w{a\ +b} traverses all nodes - for example f{ |o=1, *r, &b| } + for example foo::fun bar traverses all nodes - for example not m foo + for example -> do _1 + _9 end traverses all nodes - for example if (bar); foo; end + for example "#{-> foo {}}" traverses all nodes - for example foo, bar, baz = 1, 2 + for example ::Foo = 10 traverses all nodes - for example p <<~E - x - - y -E + for example @@foo traverses all nodes - for example < proc do end, b: proc do end} traverses all nodes - for example -> do end + for example proc {_1 = nil} traverses all nodes - for example foo.A += m foo + for example p <<~E + x + y +E traverses all nodes - for example f{ |a, o=1, o1=2, *r, &b| } + for example a b{c(d)}, :e do end traverses all nodes - for example foo[bar, :baz => 1,] - traverses all nodes - for example a b{c d}, :e do end - traverses all nodes - for example foo::fun - traverses all nodes - for example fun(*bar, &baz) - traverses all nodes - for example f{ |*s, &b| } - traverses all nodes - for example -> a: { } + for example B::A += 1 traverses all nodes - for example def foo; end + for example [1, 2] traverses all nodes - for example break + for example defined? @foo traverses all nodes - for example a b(c d), :e do end + for example a b(c d), 1.0r do end traverses all nodes - for example -> * { } + for example t=1;(foo)?t:T traverses all nodes - for example class Foo; end + for example %I[#@@1] traverses all nodes for example %s{#@@1} traverses all nodes - for example p p{p(p);p p}, tap do end - traverses all nodes - for example -2.0 ** 10 - traverses all nodes - for example def f ((*r)); end - traverses all nodes - for example foo.a += 1 - traverses all nodes - for example case [__FILE__, __LINE__ + 1, __ENCODING__] - in [__FILE__, __LINE__, __ENCODING__] - end - traverses all nodes - for example -> (a) { } + for example def foo(...); bar(...); end traverses all nodes - for example { 1 => 2, :foo => "bar" } + for example var = 10; var traverses all nodes - for example def f (foo: 1, bar: 2, **baz, &b); end + for example ~foo traverses all nodes - for example f{ |a, c| } + for example break traverses all nodes - for example foo && bar + for example f{ |a, *, &b| } traverses all nodes - for example a, *b = bar + for example def f **baz, &b; end traverses all nodes - for example a b(c(d)), :e do end + for example def x; self::A ||= 1; end traverses all nodes - for example { 1 => 2 } + for example def f(*); end traverses all nodes - for example -> (arg={}) {} + for example foo::a = 1 traverses all nodes - for example desc "foo" do end + for example foo.a &&= 1 traverses all nodes - for example foo (-1.3).abs + for example traverses all nodes - for example meth while foo + for example meth[] {} traverses all nodes - for example p <<~"E" - x - #{" y"} -E + for example foo.m += raise(bar) rescue nil traverses all nodes - for example # Extracted from `parser` gem. -# Add the following code at the beginning of `def assert_parses`: -# -# File.open('./out.rb', 'a+') do |f| -# f << code << "\n\n#----\n" if versions.include? '2.7' -# end - -alias $a $b + for example f{ |o=1, *r, p, &b| } traverses all nodes - for example case foo; - in {a: 1 - } - false - ; end + for example until foo do meth end traverses all nodes - for example p <<~E - x - \ y -E + for example not() traverses all nodes - for example while foo do meth end + for example while def self.foo a = tap do end; end; break; end traverses all nodes - for example foo.A = 1 + for example module ::Foo; end traverses all nodes - for example begin end + for example "foo#{bar}baz" traverses all nodes - for example f{ |*s| } + for example <<-"HERE" +a\ +b +HERE traverses all nodes - for example [1, 2] + for example case foo; in 1... then true; end traverses all nodes - for example f{ |o=1, p, &b| } + for example def f o=1, *r, p, &b; end traverses all nodes - for example case foo; in ->{ 42 } then true; end + for example a, *, c = bar traverses all nodes - for example not(foo) + for example def f a, *r, &b; end traverses all nodes - for example %w[ #@1 ] + for example %q(foobar) traverses all nodes - for example `foo#{bar}baz` + for example a b{c(d)}, "x" do end traverses all nodes - for example f{ |a| } + for example %r{#@@1} traverses all nodes - for example ((b, )) = foo + for example %W[foo #{bar}foo#@baz] traverses all nodes - for example :'#@@1' + for example foo += m foo traverses all nodes - for example foo or bar + for example case foo; in 1...2 then true; end traverses all nodes - for example false ? raise {} : tap {} + for example not foo traverses all nodes - for example f{ |*| } + for example def f &b; end traverses all nodes - for example `#@@1` + for example `foo#{bar}baz` traverses all nodes - for example meth do; foo; rescue; bar; end + for example foo[m bar] traverses all nodes - for example foo = baz, *bar + for example if (bar; a, b = foo); end traverses all nodes - for example def f foo: -; end + for example foo[1, 2] traverses all nodes - for example case foo; in A then true; end + for example meth 1 do end.fun bar do end traverses all nodes - for example def f ((a, *r)); end + for example fun (1) traverses all nodes - for example case foo; in [x,] then nil; end + for example [1, *foo, 2] traverses all nodes - for example case foo; when 'bar'; bar; end + for example p <<~E + x +E traverses all nodes - for example case foo; in ** then true; end + for example /(?bar)/ =~ 'bar'; match traverses all nodes - for example foo =~ 1 + for example case; when foo; 'foo'; end traverses all nodes - for example super(foo) + for example %W() traverses all nodes - for example <<-`HERE` -#@1 -HERE + for example while class << self; tap do end; end; break; end traverses all nodes - for example foo[1, 2] = 3 + for example case foo; in ::A then true; end traverses all nodes - for example %W[foo #{bar}] + for example defined?(foo) traverses all nodes - for example m = -> *args do end + for example f{ | | } traverses all nodes - for example 42i + for example def foo raise; raise A::B, ''; end traverses all nodes - for example :'#@1' + for example case foo; + in a: {b:}, c: + p c + ; end traverses all nodes - for example fun(1) { } + for example Foo traverses all nodes - for example %w[] + for example if foo; bar; end traverses all nodes - for example case foo; in ::A then true; end + for example p <<~E + x + y +E traverses all nodes - for example case foo; in x unless true; nil; end + for example { 1 => 2, :foo => "bar" } traverses all nodes - for example break fun foo do end + for example if foo; bar; elsif baz; 1; else 2; end traverses all nodes - for example case foo; when 'bar', 'baz'; bar; end + for example foo[0, 1] &&= 2 traverses all nodes - for example foo << 1 + for example break(foo) traverses all nodes - for example a ? b & '': nil + for example case foo; in 1 => a then true; end traverses all nodes - for example foo = bar, 1 + for example %{a\ +b} traverses all nodes - for example %W[#@@1] + for example -> do end traverses all nodes - for example foo.fun bar + for example :foo traverses all nodes - for example a b{c(d)}, 1.0r do end + for example __LINE__ traverses all nodes - for example meth 1 do end::fun bar + for example not(foo) traverses all nodes - for example def f a, &b; end + for example foo != 1 traverses all nodes - for example f{ |o=1, *r, p, &b| } + for example self::A, foo = foo traverses all nodes - for example a b{c(d)}, /x/ do end + for example def String::foo; end traverses all nodes - for example meth 1 do end.fun(bar) {} + for example p :foo, {"a": proc do end, b: proc do end} traverses all nodes - for example var = 10; var + for example %r{#@1} traverses all nodes - for example foo::Fun bar + for example def until; end traverses all nodes - for example a b{c(d)}, :e do end + for example p <<~E + x + +y +E traverses all nodes - for example begin; meth; rescue Exception, foo; bar; end + for example f{ |a, c| } traverses all nodes - for example def f &b; end + for example foo or bar traverses all nodes - for example case foo; in a: then true; end + for example %q{#@1} traverses all nodes - for example fun! + for example ::A, foo = foo traverses all nodes - for example unless foo then bar; end + for example unless foo; bar; else baz; end traverses all nodes - for example while def foo a = tap do end; end; break; end + for example def foo +=begin +=end +end traverses all nodes - for example unless foo; bar; end + for example a += b = raise :x traverses all nodes - for example %W{a\ -b} + for example $var = 10 traverses all nodes - for example case foo; in **a then true; end + for example %Q{#@@1} traverses all nodes - for example fun (f bar) + for example def self::foo; end traverses all nodes - for example foo > 1 + for example foo::A = 1 traverses all nodes - for example foo[:baz => 1,] + for example foo << 1 traverses all nodes - for example next foo + for example a = 1; a b: 1 traverses all nodes - for example "foo#{bar}baz" + for example fun (1) {} traverses all nodes - for example f{ |foo:| } + for example { 'foo': 2, 'bar': {}} traverses all nodes - for example + for example ->(a; foo, bar) { } traverses all nodes - for example break foo + for example case foo; in { a: 1, } then true; end traverses all nodes - for example $var = 10 + for example a b(c d), 1.0i do end traverses all nodes - for example <<-"HERE" -#@@1 -HERE + for example __ENCODING__ traverses all nodes - for example case foo; in 1.. then true; end + for example *b, c = bar traverses all nodes - for example ?a + for example case foo; in x, *y, z then nil; end traverses all nodes - for example a b{c d}, 1.0r do end + for example foo >= 1 traverses all nodes - for example 1 in [a]; a + for example a b(c(d)), 1.0i do end traverses all nodes - for example foo[0] += raise(bar) rescue nil + for example @a |= 1 traverses all nodes - for example case foo; in {} then true; end + for example p ->() do a() do end end traverses all nodes - for example m { _1 + _9 } + for example foo = raise(bar) rescue nil traverses all nodes - for example %W"#{1}" + for example `#@@1` traverses all nodes - for example f{ |a, o=1, p, &b| } + for example fun(1) { } traverses all nodes - for example /#@1/ + for example begin meth end while foo traverses all nodes - for example super() + for example foo::C ||= raise(bar) rescue nil traverses all nodes - for example case foo; in [*, x] then true; end + for example false ? raise do end : tap do end traverses all nodes - for example fun(1) + for example ->(scope) {}; scope traverses all nodes - for example def foo - a:b end + for example %w[] traverses all nodes - for example %Q{a\ -b} + for example foo.A = 1 traverses all nodes - for example p <<~E - x - y -E + for example case foo; in "#{ 'a' }": 1 then true; end traverses all nodes - for example foo::C ||= raise bar rescue nil + for example case foo; in x, y then nil; end traverses all nodes - for example m { |**nil| } + for example foo.a ||= 1 traverses all nodes - for example def f **baz, &b; end + for example <<~FOO + baz\ + qux +FOO traverses all nodes - for example @@var = 10 + for example %w[foo bar] traverses all nodes - for example f{ |a, o=1, *r, p, &b| } + for example while def self.foo; tap do end; end; break; end traverses all nodes - for example def foo raise; raise A::B, ''; end + for example @var = 10 traverses all nodes - for example def f(foo); end + for example m1 :k => m2 do; m3() do end; end traverses all nodes - for example case foo; - in {a: - 2} - false - ; end + for example foo >> 1 traverses all nodes - for example foo[m bar] + for example return foo traverses all nodes - for example @foo + for example false traverses all nodes - for example m "#{[]}" + for example :'a\ +b' traverses all nodes - for example foo.(1) + for example foo[0, 1] ||= 2 traverses all nodes - for example %r{#@1} + for example 42ri traverses all nodes - for example ->{ } + for example foo < 1 traverses all nodes - for example begin; meth; rescue => ex; bar; end + for example assert do: true traverses all nodes - for example B::A += 1 + for example fun (f bar) traverses all nodes - for example -foo + for example *, c, d = bar traverses all nodes - for example p :foo, {:a => proc do end, b: proc do end} + for example !(a, b = foo) traverses all nodes - for example def foo -=begin -=end -end + for example <<-"HERE" +#@@1 +HERE traverses all nodes - for example case foo; in A() then true; end + for example 1..2 traverses all nodes - for example case foo; in A[x:] then true; end + for example 42r traverses all nodes - for example for a, b in foo; p a, b; end + for example case 1; in 2; 3; else; end traverses all nodes - for example self.a, self[1, 2] = foo + for example foo::fun traverses all nodes - for example %W() + for example p :foo, {** proc do end, b: proc do end} traverses all nodes - for example [1, *foo] + for example case foo; in 1; end traverses all nodes - for example case foo; in A(1, 2) then true; end + for example case foo; in ...2 then true; end traverses all nodes - for example tap (proc do end) + for example m "#{[]}" traverses all nodes - for example foo <=> 1 + for example module Bar::Foo; end traverses all nodes - for example /#{1}(?bar)/ =~ 'bar' + for example m = -> *args do end traverses all nodes - for example while class Foo a = tap do end; end; break; end + for example break foo traverses all nodes - for example __LINE__ + for example def (foo).foo; end traverses all nodes - for example %w{a\ -b} + for example meth 1 do end.fun(bar) {} traverses all nodes - for example class A; _1; end + for example yield traverses all nodes - for example END { 1 } + for example f{ |a, *s, &b| } traverses all nodes - for example [*foo] + for example case foo; in "a": 1 then true; end traverses all nodes - for example def f(**foo); end + for example m def x(); end; 1.tap do end traverses all nodes - for example a b(c(d)), 1.0 do end + for example for a, b in foo; p a, b; end traverses all nodes - for example begin; meth; rescue; foo; else; bar; end + for example case foo; in A(x:) then true; end traverses all nodes - for example 1.. + for example %{#@1} traverses all nodes - for example f { || a:b } + for example -foo traverses all nodes - for example not() + for example def f ((a, *)); end traverses all nodes - for example def foo(...); end + for example meth 1 do end.fun {} traverses all nodes - for example foo.a &&= 1 + for example tap (proc do end) traverses all nodes - for example case foo; in "#{ 'a' }": 1 then true; end + for example %I{a\ +b} traverses all nodes - for example a += b += raise :x + for example def f(**foo); end traverses all nodes - for example f{ |foo: 1, bar: 2, **baz, &b| } + for example def foo + a:b end traverses all nodes - for example def f ((*)); end + for example foo[:baz => 1,] traverses all nodes - for example meth 1 do end.fun bar + for example class Foo; end traverses all nodes - for example until foo do meth end + for example foo ? 1 : 2 traverses all nodes - for example t=1;(foo)?t:T + for example "foo#@a" "bar" traverses all nodes - for example 1... + for example foo::m += raise bar rescue nil traverses all nodes - for example fun(:foo => 1, &baz) + for example meth while foo traverses all nodes - for example case foo; in 1 | 2 then true; end + for example true ? 1.tap do |n| p n end : 0 traverses all nodes - for example :'foo' + for example unless foo then bar; end traverses all nodes - for example module A; _1; end + for example -> (arg={}) {} traverses all nodes - for example case foo; in x, then nil; end + for example case foo; in 1.. then true; end traverses all nodes - for example foo[0, 1] ||= 2 + for example foo.C += raise bar rescue nil traverses all nodes - for example fun () {} + for example # coding:utf-8 + "\xD0\xBF\xD1\x80\xD0\xBE\xD0\xB2\xD0\xB5\xD1\x80\xD0\xBA\xD0\xB0" traverses all nodes - for example def foo(...); super(...); end + for example def f a, o=1, p, &b; end traverses all nodes - for example def f a, o=1, *r, &b; end + for example a b{c(d)}, 1 do end traverses all nodes - for example @@foo + for example `#@1` traverses all nodes - for example begin meth end until foo + for example f{ |*s, &b| } traverses all nodes - for example f x: -> do meth do end end + for example _1 traverses all nodes - for example fun (1) {} + for example def f(foo: 1); end traverses all nodes - for example case foo; in "#{ %Q{a} }": then true; end + for example [ 1 => 2 ] traverses all nodes - for example %w[ #@@1 ] + for example def f ((*, p)); end traverses all nodes - for example def x; self::A ||= 1; end + for example fun(:foo => 1, &baz) traverses all nodes - for example until foo; meth end + for example a b{c d}, 1.0r do end traverses all nodes - for example while def self.foo; tap do end; end; break; end + for example super do end traverses all nodes - for example def f ((a, *)); end + for example 'a\ +b' traverses all nodes - for example next fun foo do end + for example assert dogs traverses all nodes - for example :"foo#{bar}baz" + for example p <<~E + x + \ y +E traverses all nodes - for example foo[0, 1] += 2 + for example a, b = *foo, bar traverses all nodes - for example a b(c d), /x/ do end + for example m do _1 + _9 end traverses all nodes - for example foo != 1 + for example *b = bar traverses all nodes - for example a # - # -&.foo + for example case foo; when 'bar'; bar; end traverses all nodes - for example fun(foo, *bar) + for example proc {_1 = nil} traverses all nodes - for example @@var |= 10 + for example fun(1) traverses all nodes - for example def f a, *r, &b; end + when given an unexpected AST + with too many children + raises debugging error + with too few children + raises debugging error + for example <<-`HERE` +#@1 +HERE traverses all nodes - for example while class Foo; tap do end; end; break; end + for example case foo; in a: 1, _a:, ** then true; end traverses all nodes - for example [ 1, 2 => 3 ] + for example %W[#@1] traverses all nodes - for example p <<~E - E + for example begin; meth; rescue Exception; bar; end traverses all nodes - for example alias :foo bar + for example [1, *foo] traverses all nodes - for example foo < 1 + for example Bar::Foo traverses all nodes for example p <<~E x - y + + y E traverses all nodes - for example "#{1}" + for example foo && (a, b = bar) traverses all nodes - for example foo and bar + for example p p{p(p);p p}, tap do end traverses all nodes - for example foo + 1 + for example @foo, @@bar = *foo traverses all nodes - for example m { |(foo, bar)| } + for example %{#@@1} traverses all nodes - for example f{ } + for example (foo, bar) = 1, 2 traverses all nodes - for example 42 + for example begin; meth; rescue; foo; else; bar; end traverses all nodes - for example class A < B -end + for example f{ |a, *| } traverses all nodes - for example case foo; in [x, y, *z] then true; end + for example f{ |a, *s| } traverses all nodes - for example yield foo + for example begin; meth; ensure; bar; end traverses all nodes - for example meth rescue bar + for example lambda{|;a|a} traverses all nodes - for example case foo; in 1...2 then true; end + for example 42i traverses all nodes - for example begin foo!; bar! end + for example m ->(a: ->{_1}) {a} traverses all nodes - for example foo >> 1 + for example p <<~"E" + x\n y +E traverses all nodes - for example false ? raise do end : tap do end + for example if foo then bar; else baz; end traverses all nodes - for example foo ** 1 + for example %Q{a\ +b} traverses all nodes - for example def until; end + for example * = bar traverses all nodes - for example %W[#@1] + for example def f foo: +; end traverses all nodes - for example a&.b + for example foo > 1 traverses all nodes - for example f <<-TABLE do -TABLE -end + for example retry traverses all nodes - for example let () { m(a) do; end } + for example case foo; in "a": then true; end traverses all nodes - for example p <<~`E` - x - #{foo} -E + for example def f(**); end traverses all nodes - for example super foo + for example <<-'HERE' +#@@1 +HERE traverses all nodes - for example -2 ** 10 + for example super() traverses all nodes - for example '#@@1' + for example def foo(...); super(...); end traverses all nodes - for example foo.a ||= 1 + for example if foo; bar; else baz; end traverses all nodes - for example "#@a #@@a #$a" + for example foo[bar, :baz => 1,] traverses all nodes - for example case foo; in [x, y] then true; end + for example class Foo < a:b; end traverses all nodes - for example fun { } + for example def String; end traverses all nodes - for example return fun foo do end + for example END { 1 } traverses all nodes - for example def String::foo; end + for example !/wat/ traverses all nodes - for example ->(a) { } + for example /a\ +b/ traverses all nodes - for example foo::fun bar + for example a += b += raise :x traverses all nodes - for example class << foo; nil; end + for example __FILE__ traverses all nodes - for example foo.m += raise bar rescue nil + for example foo::C ||= raise bar rescue nil traverses all nodes - for example begin; rescue LoadError; else; end + for example while def foo a = tap do end; end; break; end traverses all nodes - for example () + for example case 1; in 2; 3; else; 4; end traverses all nodes - for example f{ |**baz, &b| } + for example case foo; in "#{ %q{a} }": then true; end traverses all nodes - for example if foo; bar; else baz; end + for example case; when foo; 'foo'; else 'bar'; end traverses all nodes - for example { foo: 2 } + for example meth rescue bar traverses all nodes - for example [/()\1/, ?#] + for example foo + 1 traverses all nodes - for example case foo; in 1, "a", [], {} then nil; end + for example p <<~"E" + x + #{" y"} +E traverses all nodes - for example %I[foo #{bar}] + for example foo = bar = m foo traverses all nodes - for example !/wat/ + for example case foo; in a: then true; end traverses all nodes - for example case foo; in ^foo then nil; end + for example case foo; in "#{ %q{a} }": 1 then true; end traverses all nodes - for example a&.b &&= 1 + for example foo.fun traverses all nodes - for example def foo(...); bar(...); end + for example a b(c d), 1 do end traverses all nodes - for example !(foo...bar) + for example @@var = 10 traverses all nodes - for example %{#@@1} + for example case foo; in A::B then true; end traverses all nodes - for example a b{c d}, 1.0 do end + for example next fun foo do end traverses all nodes - for example def m; class << self; module M; end; end; end + for example case foo; in [x,] then nil; end traverses all nodes - for example f{ |*r, p, &b| } + for example begin; meth; rescue => ex; bar; end traverses all nodes - for example begin; meth; rescue; baz; else foo; ensure; bar end + for example fun () {} traverses all nodes - for example foo[0] += raise bar rescue nil + for example f{ |a, b,| } traverses all nodes - for example def String; end + for example [ 1, 2 => 3 ] traverses all nodes - for example 42ri + for example foo <=> 1 traverses all nodes - for example def f(**nil); end + for example proc {|_3|} traverses all nodes - for example %q{a\ -b} + for example fun traverses all nodes - for example fun(foo, :foo => 1, &baz) + for example foo, bar = meth rescue [1, 2] traverses all nodes - for example ->(**nil) {} + for example alias :foo bar traverses all nodes - for example /#@@1/ + for example {a: if true then 42 end} traverses all nodes - for example while def self.foo a = tap do end; end; break; end + for example a b(c d), /x/ do end traverses all nodes - for example module Bar::Foo; end + for example m [] do end traverses all nodes - for example case foo; in *x, y, z then nil; end + for example { } traverses all nodes - for example case foo; in [x, y, *] then true; end + for example p <<~E + E traverses all nodes - for example fun do end + for example foo and bar traverses all nodes - for example $+ + for example def String.foo; end traverses all nodes - for example a b(c(d)), 1.0i do end + for example meth 1 do end.fun(bar) traverses all nodes - for example td (1_500).toString(); td.num do; end + for example <<'HERE' +foo +bar +HERE traverses all nodes - for example 1.33 + for example ->{ } traverses all nodes - for example if foo; bar; elsif baz; 1; else 2; end + for example <(a = ->{_1}) {a} traverses all nodes - for example fun(:foo => 1) + for example a += 1 traverses all nodes - for example case foo; in ...2 then true; end + for example fun (1).to_i traverses all nodes - for example foo || (a, b = bar) + for example -2 ** 10 traverses all nodes - for example a, *b, c = bar + for example case foo; in ..2 then true; end traverses all nodes - for example -> do rescue; end + for example $10 traverses all nodes - for example while not (true) do end + for example def self.foo; end traverses all nodes - for example :"a\ -b" + for example a b(c d), 1.0 do end traverses all nodes - for example (foo, bar) = 1, 2 + for example def f a, *r, p, &b; end traverses all nodes - for example case foo; in [*x, y] then true; end + for example foo.(1) traverses all nodes - for example case foo; - in {a: - } - true - ; end + for example def f *r, p, &b; end traverses all nodes - for example a b(c d), 1.0i do end + for example foo[bar,] traverses all nodes - for example p <<~E - x - y -E + for example case foo; in [x, y] then true; end traverses all nodes - for example def m; class << self; class C; end; end; end + for example foo = m foo traverses all nodes - for example m a + b do end + for example %s{a\ +b} traverses all nodes - for example case 1; in 2; 3; else; 4; end + for example yield(foo) traverses all nodes - for example case foo; when 'bar' then bar; end + for example case foo; in *x then nil; end + traverses all nodes + for example fun(&bar) + traverses all nodes + for example __ENCODING__ traverses all nodes for example <<-"HERE" #@1 HERE traverses all nodes - for example <<-'HERE' -#@@1 -HERE + for example unless foo; bar; end traverses all nodes - for example { 'foo': 2 } + for example def f(*foo); end traverses all nodes - for example def f(**); end + for example def _5; end traverses all nodes - for example meth (-1.3).abs + for example super foo traverses all nodes - for example :"#@@1" + for example "#@1" traverses all nodes - for example a b{c(d)}, 1.0 do end + for example a b(c(d)), /x/ do end traverses all nodes - for example def f (foo: 1, &b); end + for example meth until foo traverses all nodes - for example module Foo; end + for example a ? b & '': nil traverses all nodes - for example %Q{#@@1} + for example %q{#@@1} traverses all nodes - for example case foo; in x, *y, z then nil; end + for example a b{c d}, 1.0i do end traverses all nodes - for example foo::m += raise(bar) rescue nil + for example case foo; + in {a: 1 + } + false + ; end traverses all nodes - for example __ENCODING__ + for example def self._6; end traverses all nodes - for example __FILE__ + for example if (a, b = foo); end traverses all nodes - for example for a in foo do p a; end + for example let () { m(a) do; end } traverses all nodes - for example case foo; in [x, *, y] then true; end + for example <<-'HERE' +#@1 +HERE traverses all nodes - for example case; when foo; 'foo'; else 'bar'; end + for example not m foo traverses all nodes - for example %x{#@1} + for example def foo(...); end traverses all nodes - for example def f a, o=1, *r, p, &b; end + for example next(foo) traverses all nodes - for example -> a: 1 { } + for example fun! traverses all nodes - for example meth 1 do end::fun(bar) + for example yield() traverses all nodes - for example a &&= 1 + for example /\xa8/n =~ "" traverses all nodes - for example [1, *foo, 2] + for example f{ |foo: 1, bar: 2, **baz, &b| } traverses all nodes - for example def String=; end + for example class << foo; nil; end traverses all nodes - for example fun(*bar) + for example +2.0 ** 10 traverses all nodes - for example proc {_1 = nil} + for example foo | 1 traverses all nodes - for example p :foo, {a: proc do end, b: proc do end} + for example def f(foo, bar); end traverses all nodes - for example %I[foo#{bar}] + for example p <<~E + x + y +E traverses all nodes - for example foo::a = 1 + for example case foo; in {} then true; end traverses all nodes - for example def f o=1, &b; end + for example bar def foo; self.each do end end traverses all nodes - for example foo !~ 1 + for example %i[] traverses all nodes - for example def a; @@var |= 10; end + for example BEGIN { 1 } traverses all nodes - for example ..100 + for example ->{ } traverses all nodes - for example Foo = 10 + for example p :foo, {:a => proc do end, b: proc do end} traverses all nodes - for example case foo; in a: 1 then true; end + for example foo::Fun bar traverses all nodes - for example foo, bar = meth rescue [1, 2] + for example while not (true) do end traverses all nodes - for example proc {_1 = nil} + for example foo[0] += raise(bar) rescue nil traverses all nodes - for example :foo + for example case foo; in A(1, 2) then true; end traverses all nodes - for example case foo; in ..2 then true; end + for example ::Foo traverses all nodes - for example a b{c d}, /x/m do end + for example case foo; in 1, "a", [], {} then nil; end traverses all nodes - for example a b(c d), 1.0 do end + for example alias $a $+ traverses all nodes - for example m [], 1 do end + for example # Extracted from `parser` gem. +# Add the following code at the beginning of `def assert_parses`: +# +# File.open('./out.rb', 'a+') do |f| +# f << code << "\n\n#----\n" if versions.include? '2.7' +# end + +alias $a $b traverses all nodes - for example *b, c = bar + for example case foo; in x if true; nil; end traverses all nodes - for example self + for example foo == 1 traverses all nodes - for example def (foo).foo; end + for example let (:a) { m do; end } traverses all nodes - for example assert dogs + for example foo / 1 traverses all nodes - for example f(a ? "a":1) + for example class A; _1; end traverses all nodes - for example foo.fun (1) {} + for example -2.0 ** 10 traverses all nodes - for example for a in foo; p a; end + for example a&.b traverses all nodes - for example a b{c d}, 1 do end + for example case foo; in [*x, y] then true; end traverses all nodes - for example case foo; in "a": 1 then true; end + for example f{ |a, *r, p, &b| } traverses all nodes - for example case foo; when 1, *baz; bar; when *foo; end + for example p begin 1.times do 1 end end traverses all nodes - for example -> { _1 + _9} + for example def x; ::A ||= 1; end traverses all nodes - for example <<-'HERE' -a\ -b -HERE + for example case foo; in [*, x] then true; end traverses all nodes - for example case foo; in "#{ %Q{a} }": 1 then true; end + for example a, *b, c = bar traverses all nodes - for example %q{#@1} + for example meth 1 do end::fun bar traverses all nodes - for example m "#{}#{()}" + for example :'foo' traverses all nodes - for example a b{c d}, "x" do end + for example f{ || } traverses all nodes - for example -> do _1 + _9 end + for example if foo...bar; end traverses all nodes - for example foo.a += m foo + for example begin; meth; rescue; baz; ensure; bar; end traverses all nodes - for example ->{ } + for example m { _1 + _9 } traverses all nodes - for example begin; meth; ensure; bar; end + for example undef foo, :bar, :"foo#{1}" traverses all nodes - for example redo + for example fun(foo, :foo => 1, &baz) traverses all nodes - for example next(foo) + for example while def foo; tap do end; end; break; end traverses all nodes - for example a b(c d), "x" do end + for example f{ |a, o=1, &b| } traverses all nodes - for example case foo; in *x then nil; end + for example def f (((a))); end traverses all nodes - for example class Foo end + for example a b{c d}, /x/ do end traverses all nodes - for example ::Foo + for example self.a, self[1, 2] = foo traverses all nodes - for example ::Foo = 10 + for example /source/im traverses all nodes for example !(foo..bar) traverses all nodes - for example break() + for example [*foo] traverses all nodes - for example def x; ::A ||= 1; end + for example f{ |; +a +| } traverses all nodes - for example while class << self; a = tap do end; end; break; end + for example 1 in [a]; a traverses all nodes - for example case foo; in "a": then true; end + for example %r{a\ +b} traverses all nodes - for example foo == 1 + for example f{ |;a| } traverses all nodes - for example def m; class << self; A = nil; end; end + for example foo & 1 traverses all nodes - for example begin ensure end + for example case foo; in (1) then true; end traverses all nodes for example unless foo then bar; else baz; end traverses all nodes - for example fun(foo, :foo => 1) - traverses all nodes - for example case foo; in "#{ %q{a} }": 1 then true; end - traverses all nodes - for example meth 1 do end.fun(bar) - traverses all nodes - for example def self.m; _1; end - traverses all nodes - for example p <<~E " y" - x -E + for example defined? foo traverses all nodes - for example { } + for example "#{1}" traverses all nodes - for example defined?(foo) + for example if foo..bar; end traverses all nodes - for example def f *r, &b; end + for example foo, bar = m foo traverses all nodes - for example m1 :k => m2 do; m3() do end; end + for example a, (b, c) = foo traverses all nodes - for example def f(&block); end + for example !(foo...bar) traverses all nodes - for example case foo; in [x, *y, z] then true; end + for example false ? raise {} : tap {} traverses all nodes - for example foo = raise(bar) rescue nil + for example for a in foo; p a; end traverses all nodes - for example %r{#@@1} + for example begin; meth; rescue; baz; else foo; ensure; bar end traverses all nodes - for example def f foo: -1 -; end + for example case foo; in a: 1, b: 2 then true; end traverses all nodes - for example +42 + for example /#{1}(?bar)/ =~ 'bar' traverses all nodes - for example let (:a) { m do; end } + for example ::A += 1 traverses all nodes - for example def f(foo, bar); end + for example foo || (a, b = bar) traverses all nodes - for example bar def foo; self.each do end end + for example foo.a = 1 traverses all nodes - for example case foo; in * then nil; end + for example { foo: 2 } traverses all nodes - for example [ 1 => 2 ] + for example def f a, &b; end traverses all nodes - for example def f o=1, p, &b; end + for example def f foo: -1 +; end traverses all nodes - for example Foo + for example def f ((a, *r, p)); end traverses all nodes - for example def f ((*, p)); end + for example nil traverses all nodes - for example case; when foo; 'foo'; end + for example %W[#@@1] traverses all nodes - for example %I[#@@1] + for example %I() traverses all nodes - for example %W[foo #{bar}foo#@baz] + for example /#@@1/ traverses all nodes - for example unless foo; bar; else baz; end + for example def f(foo); end traverses all nodes - for example self::A, foo = foo + for example "#@@1" traverses all nodes - for example yield(foo) + for example fun(foo, :foo => 1) traverses all nodes - for example foo, bar = m foo + for example begin; meth; rescue Exception, foo; bar; end traverses all nodes - for example @foo, @@bar = *foo + for example f{ |a, o=1, o1=2, *r, &b| } traverses all nodes - for example %I{a\ -b} + for example <<-E + 1 \ + 2 + 3 +E traverses all nodes - for example case foo; in [x, y,] then true; end + for example redo traverses all nodes - for example if foo -then bar end + for example super(foo) traverses all nodes - for example case foo; in 1... then true; end + for example fun (1 +) traverses all nodes - for example m ->(a = ->{_1}) {a} + for example /#@1/ traverses all nodes - for example foo >= 1 + for example a b(c(d)), /x/m do end traverses all nodes for example a # # .foo traverses all nodes - for example %I() - traverses all nodes - for example return + for example fun { } traverses all nodes - for example true ? 1.tap do |n| p n end : 0 + for example begin ensure end traverses all nodes - for example begin; meth; rescue; baz; ensure; bar; end + for example return fun foo do end traverses all nodes - for example %i[] + for example yield foo traverses all nodes - for example case foo; in x if true; nil; end + for example def f foo = 1; end traverses all nodes - for example a = b += raise :x + for example fun() { } traverses all nodes - for example /#)/x + for example class Foo end traverses all nodes - for example def self::foo; end + for example case foo; in "#{ 'a' }": then true; end traverses all nodes - for example def foo(...); bar(...); end + for example %i[ #@1 ] traverses all nodes - for example foo = raise bar rescue nil + for example foo::Fun() traverses all nodes - for example case foo; in 1..2 then true; end + for example case foo; in 1 | 2 then true; end traverses all nodes - for example case foo; in "#{ %q{a} }": then true; end + for example a b(c(d)), 1.0 do end traverses all nodes - for example begin meth end while foo + for example <<~E + 1 \ + 2 + 3 +E traverses all nodes - for example foo ^ 1 + for example def f(&block); end traverses all nodes - for example /source/im + for example def x(_4) end traverses all nodes - for example case foo; in A(x:) then true; end + for example %I[#@1] traverses all nodes - for example def f *r, p, &b; end + for example def f ; end traverses all nodes - for example f{ |a, *r, p, &b| } + for example foo::m += raise(bar) rescue nil traverses all nodes - for example p begin 1.times do 1 end end + for example a b{c(d)}, 1.0 do end traverses all nodes - for example `#@1` + for example def f o=1, *r, &b; end traverses all nodes - for example foo[1, 2] = 3 + for example fun(foo, *bar, &baz) traverses all nodes - for example foo.A += 1 + for example def f ((*)); end traverses all nodes - for example a b{c d}, /x/ do end + for example 42.1r traverses all nodes - for example foo::m += raise bar rescue nil + for example ->(a) { } traverses all nodes - for example case foo; in "#{ 'a' }": then true; end + for example a, *b = bar traverses all nodes - for example +foo + for example %W[foo #{bar}] traverses all nodes - for example `a\ -b` + for example def f o=1, &b; end traverses all nodes - for example __ENCODING__ + for example :"#@@1" traverses all nodes - for example <<-E - 1 \ - 2 - 3 -E + for example desc "foo" do end traverses all nodes - for example $foo + for example 42.1i traverses all nodes - for example fun (1) + for example super traverses all nodes - for example def f ((*r, p)); end + for example f{ |*s| } traverses all nodes - for example alias $a $+ + for example super foo, bar do end traverses all nodes - for example _2 = 1 + for example foo[0, 1] += 2 traverses all nodes - for example 42.1r + for example p <<~`E` + x + #{foo} +E traverses all nodes - for example def String.foo; end + for example a b{c(d)}, /x/m do end traverses all nodes - for example f{ |a, o=1, &b| } + for example class A < B +end traverses all nodes - for example foo = m foo + for example { 'foo': 2 } traverses all nodes - for example a b{c d}, 1.0i do end + for example return() traverses all nodes - for example 'foobar' + for example foo::(1) traverses all nodes - for example fun (1).to_i + for example foo traverses all nodes - for example case foo; in A::B then true; end + for example _2 = 1 traverses all nodes - for example foo::(1) + for example case foo; in A then true; end traverses all nodes - for example foo = meth rescue bar + for example foo, bar, baz = 1, 2 traverses all nodes - for example <<-`HERE` -a\ -b -HERE + for example '#@@1' traverses all nodes - for example 42r + for example %I[foo #{bar}] traverses all nodes - for example a b{c(d)}, 1.0i do end + for example case foo; when 1, *baz; bar; when *foo; end traverses all nodes - for example -42 + for example while foo; meth end traverses all nodes - for example def BEGIN; end + for example ->(**nil) {} traverses all nodes - for example a ||= 1 + for example next foo traverses all nodes - for example <<'HERE' -foo -bar -HERE + for example f{ |*| } traverses all nodes - for example a&.b = 1 + for example f{ |a, o=1, p, &b| } traverses all nodes - for example /(?bar)/ =~ 'bar'; match + for example "#@a #@@a #$a" traverses all nodes - for example a @b do |c|;end + for example fun(*bar, &baz) traverses all nodes - for example %s{#@1} + for example :'#@1' traverses all nodes - for example foo / 1 + for example f x: -> do meth do end end traverses all nodes - for example f{ |a, *s, &b| } + for example case foo; in a: 1 then true; end traverses all nodes - for example <<-"HERE" -a\ -b -HERE + for example :"foo#{bar}baz" traverses all nodes - for example undef foo, :bar, :"foo#{1}" + for example next traverses all nodes - for example $10 + for example %q{a\ +b} traverses all nodes - for example "foo#@a" "bar" + for example foo && bar traverses all nodes - for example fun(foo, *bar, &baz) + for example foo&.bar {} traverses all nodes - for example not foo + for example f{ |*, &b| } traverses all nodes - for example false + for example -> a: { } traverses all nodes - for example foo&.bar {} + for example %I[foo#{bar}] traverses all nodes - for example f{ |&b| } + for example <<-`HERE` +a\ +b +HERE traverses all nodes - for example foo || bar + for example @@var |= 10 traverses all nodes - for example 42.1i + for example begin end traverses all nodes - for example foo = *bar + for example 1...2 traverses all nodes - for example f{ | | } + for example a b(c(d)), :e do end traverses all nodes - for example *, c, d = bar + for example meth (-1.3).abs traverses all nodes - for example super do end + for example def a; @@var |= 10; end traverses all nodes - for example case foo; - in a: {b:}, c: - p c - ; end + for example %i[foo bar] traverses all nodes - for example p <<~E - x -E + for example def f (foo: 1, bar: 2, **baz, &b); end traverses all nodes - for example %i[ #@1 ] + for example foo.A += m foo traverses all nodes - for example foo && (a, b = bar) + for example case foo; in *x, y, z then nil; end traverses all nodes - for example break(foo) + for example Foo = 10 traverses all nodes - for example def _5; end + for example :"#@1" traverses all nodes - for example fun (1 -) + for example meth 1 do end.fun bar traverses all nodes - for example if foo then bar; else baz; end + for example a b{c d}, /x/m do end traverses all nodes - for example f{ |a, *| } + for example def foo(_a, _a); end traverses all nodes - for example case foo; in x, y, then nil; end + for example self::a, foo = foo traverses all nodes for example %i{a\ b} traverses all nodes - for example module ::Foo; end - traverses all nodes - for example foo.C += raise(bar) rescue nil - traverses all nodes - for example foo % 1 + for example def f a, o=1, *r, &b; end traverses all nodes - for example * = bar + for example a # + # +.foo traverses all nodes - for example Bar::Foo = 10 + for example foo.A += 1 traverses all nodes - for example if foo; bar; end + for example def f ((a, *r)); end traverses all nodes - for example def f o=1, *r, &b; end + for example f{ |a, &b| } traverses all nodes - for example foo[0, 1] += m foo + for example foo === 1 traverses all nodes - for example f{ |a| } + for example a, * = bar traverses all nodes - for example %{#@1} + for example a b(c(d)), 1.0r do end traverses all nodes - for example case foo; in a: 1, b: 2 then true; end + for example a b{c d}, 1.0 do end traverses all nodes - for example %s{a\ -b} + for example def foo; end traverses all nodes - for example {a: if true then 42 end} + for example <<`HERE` +foo +bar +HERE traverses all nodes - for example foo * 1 + for example f{ |&b| } traverses all nodes - for example a b(c(d)), "x" do end + for example foo (-1.3).abs traverses all nodes - for example 1...2 + for example case foo; in ** then true; end traverses all nodes - for example def f ((a, *r, p)); end + for example foo, bar = 1, 2 traverses all nodes - for example f{ |a, &b| } + for example foo.fun bar traverses all nodes - for example -1.33 + for example ..100 traverses all nodes - for example foo - 1 + for example def f *r, &b; end traverses all nodes - for example def f a, o=1, p, &b; end + for example +foo traverses all nodes - for example !m foo + for example a b(c d), :e do end traverses all nodes - for example def foo(_a, _a); end + for example /#)/x traverses all nodes - for example foo::C ||= raise(bar) rescue nil + for example a&.b = 1 traverses all nodes - for example a b(c(d)), /x/ do end + for example Bar::Foo = 10 traverses all nodes - for example def a b: -return -end + for example -> { _1 + _9} traverses all nodes - for example case foo; in 1; end + for example %x{#@@1} traverses all nodes - for example f{ |a, *s| } + for example a = b += raise :x traverses all nodes - for example meth 1 do end.fun bar do end + for example $foo traverses all nodes - for example a b(c(d)), 1 do end + for example f{ |o=1, *r, &b| } traverses all nodes - for example case foo; in a:, b: then true; end + for example m [], 1 do end traverses all nodes - for example f{ |; -a -| } + for example while class Foo a = tap do end; end; break; end traverses all nodes - for example '#@1' + for example %i[ #@@1 ] traverses all nodes - for example f{ |a| } + for example def f ((a, a1)); end traverses all nodes - for example "#@@1" + for example a # +# +&.foo traverses all nodes - for example %w[foo bar] + for example a b{c(d)}, /x/ do end traverses all nodes - for example foo::A += m foo + for example self.A, foo = foo traverses all nodes - for example if foo...bar; end + for example def f a, o=1, &b; end traverses all nodes - for example a, * = bar + for example %w[ #@@1 ] traverses all nodes - for example a b(c d), 1.0r do end + for example case foo; in * then nil; end traverses all nodes - for example foo = bar = m foo + for example def foo() a:b end traverses all nodes - for example foo[1, 2] + for example foo[1, 2] = 3 traverses all nodes - for example def f foo = 1; end + for example foo <= 1 traverses all nodes - for example a # -# -&.foo + for example foo = baz, *bar traverses all nodes - for example f{ |;a| } + for example %W"#{1}" traverses all nodes - for example super foo, bar do end + for example foo = raise bar rescue nil traverses all nodes - for example class Foo < Bar; end + for example { foo: 2, **bar } traverses all nodes - for example if (a, b = foo); end + for example def f (foo: 1, &b); end traverses all nodes - for example def f(*foo); end + for example case foo; in "#{ %Q{a} }": 1 then true; end traverses all nodes - for example ::A += 1 + for example while class Foo; tap do end; end; break; end traverses all nodes - for example assert do: true + for example a = b = raise :x traverses all nodes - for example def x(_4) end + for example a &&= 1 traverses all nodes - for example :'a\ -b' + for example foo - 1 traverses all nodes - for example def f ((a, a1)); end + for example 42.1ri traverses all nodes - for example "#{-> foo {}}" + for example fun(:foo => 1) traverses all nodes - for example foo, bar = 1, 2 + for example f{ |**baz, &b| } traverses all nodes - for example next() + for example case foo; when 'bar'; bar; else baz; end traverses all nodes - for example %x{#@@1} + for example def BEGIN; end traverses all nodes - for example begin; meth; rescue Exception; bar; end + for example case foo; in [x, *y, z] then true; end traverses all nodes - for example begin; meth; rescue; foo; end + for example f{ |a,| } traverses all nodes - for example foo.m += raise(bar) rescue nil + for example def m; class << self; module M; end; end; end traverses all nodes - for example a b{c(d)}, "x" do end + for example foo || bar traverses all nodes - for example true + for example def f ((*r)); end traverses all nodes - for example meth until foo + for example foo[1, 2] traverses all nodes - for example %i[ #@@1 ] + for example fun(f bar) traverses all nodes - for example foo | 1 + for example case foo; in 1..2 then true; end traverses all nodes - for example p <<~E - x - y -E + for example %Q{#@1} traverses all nodes - for example foo += raise bar rescue nil + for example a b(c(d)), 1 do end traverses all nodes - for example # coding:utf-8 - "\xD0\xBF\xD1\x80\xD0\xBE\xD0\xB2\xD0\xB5\xD1\x80\xD0\xBA\xD0\xB0" + for example case foo; in a:, b: then true; end traverses all nodes - for example "a\ -b" + for example def f ((*r, p)); end traverses all nodes for example case foo; in {Foo: 42 @@ -5396,1188 +3768,2859 @@ false ; end traverses all nodes - for example meth[] {} + when a class defines on_arg + calls it for all arguments + for example f{ |*r, p, &b| } traverses all nodes - for example case foo; in 1 => a then true; end + for example case foo; in x unless true; nil; end traverses all nodes - for example foo::A = 1 + for example foo.fun (1) {} traverses all nodes - for example p <<~E - x - -y -E + for example foo = meth rescue bar traverses all nodes - for example f (g rescue nil) + for example f{ |foo:| } traverses all nodes - for example 42.1ri + for example foo += raise bar rescue nil traverses all nodes - for example f{ |foo: 1, &b| } + for example $+ traverses all nodes - for example ->(a; foo, bar) { } + for example m "#{}#{()}" traverses all nodes - for example A += 1 + for example m a + b do end traverses all nodes - for example case foo; in self then true; end + for example def foo(...); bar(...); end traverses all nodes - for example def f o=1, *r, p, &b; end + for example case foo; in A() then true; end traverses all nodes - for example begin; meth; rescue => @ex; bar; end + for example case foo; in [x] then nil; end traverses all nodes - for example %Q{#@1} + for example for a in foo do p a; end traverses all nodes - for example case foo; in x then x; end + for example f{ |a| } traverses all nodes + when a class defines `on_block_pass` + calls it for all block-pass arguments for example ...100 traverses all nodes - for example if (bar; a, b = foo); end + for example <<-'HERE' +a\ +b +HERE traverses all nodes - for example ~foo + for example if foo then bar; end traverses all nodes - for example fun(f bar) + for example %w[ #@1 ] traverses all nodes - for example def f a, *r, p, &b; end + for example return(foo) traverses all nodes - for example +2.0 ** 10 + for example p <<~E + x + \ y +E traverses all nodes - for example def foo() a:b end + for example @foo traverses all nodes - for example f{ |o=1, &b| } + for example :'#@@1' traverses all nodes - for example ->(scope) {}; scope + for example -> (a) { } traverses all nodes - for example 'a\ -b' + for example def f a, o=1, *r, p, &b; end traverses all nodes - for example foo.fun + for example meth 1 do end::fun(bar) traverses all nodes - for example m def x(); end; 1.tap do end + for example foo += raise(bar) rescue nil traverses all nodes - for example a = 1; a b: 1 + for example case foo; in **a then true; end traverses all nodes - for example return foo + for example a b{c d}, "x" do end traverses all nodes - for example f{ || } + for example foo.a += m foo traverses all nodes - for example `foobar` + for example f{ |foo: 1, &b| } + traverses all nodes + for example case foo; in A[1, 2] then true; end + traverses all nodes + for example meth do; foo; rescue; bar; end + traverses all nodes + for example a @b do |c|;end + traverses all nodes + for example case foo; in { a: 1 } then true; end + traverses all nodes + for example begin foo!; bar! end + traverses all nodes + for example f (g rescue nil) + traverses all nodes + for example a b{c d}, :e do end traverses all nodes for example foo::a += 1 traverses all nodes - for example def f(foo:); end + for example m { |(foo, bar)| } traverses all nodes - for example p -> { :hello }, a: 1 do end + for example () traverses all nodes - for example def END; end + for example foo::a += m foo traverses all nodes - for example %r{a\ -b} + for example foo += meth rescue bar traverses all nodes - for example begin; meth; rescue foo => ex; bar; end + for example fun(foo, *bar) traverses all nodes - for example p :foo, {** proc do end, b: proc do end} + for example while foo do meth end traverses all nodes - for example foo "#{(1+1).to_i}" do; end + for example case foo; in [x, y,] then true; end traverses all nodes - for example <<`HERE` -foo -bar -HERE + for example next() traverses all nodes - for example super + for example a b(c d), "x" do end traverses all nodes - for example while def foo; tap do end; end; break; end + for example def m; class << self; class C; end; end; end traverses all nodes - for example <<~E - 1 \ - 2 - 3 -E + for example f{ |o=1, p, &b| } traverses all nodes - for example case foo; when 'bar'; bar; else baz; end + for example def self.m; _1; end traverses all nodes - for example m { |foo| } + for example return traverses all nodes - when a class defines on_arg - calls it for all arguments - for example fun + for example case foo; in [x, y, *] then true; end traverses all nodes - for example def self._6; end + for example foo ^ 1 traverses all nodes - for example nil + for example p <<~E + x + y +E traverses all nodes - for example %q{#@@1} + for example if foo +then bar end traverses all nodes - for example a, (b, c) = foo + for example case foo; in x then x; end traverses all nodes - for example /\xa8/n =~ "" + for example break fun foo do end traverses all nodes - for example "#@1" + for example def END; end traverses all nodes - for example f{ |*, &b| } + for example foo * 1 traverses all nodes - for example case foo; in A[1, 2] then true; end + for example a b(c d), /x/m do end traverses all nodes - for example proc {|_3|} + for example 42 traverses all nodes - for example def f *, **; end + for example a b(c(d)), "x" do end traverses all nodes - for example a, *, c = bar + for example f{ |a, o=1, *r, p, &b| } traverses all nodes - for example retry + for example <<-`HERE` +#@@1 +HERE traverses all nodes - for example f{ |a, *, &b| } + for example -42 traverses all nodes - for example %I[#@1] + for example def f o=1, p, &b; end traverses all nodes - for example bar unless foo + for example begin; rescue LoadError; else; end traverses all nodes - for example fun(&bar) + for example f <<-TABLE do +TABLE +end traverses all nodes - for example !foo + for example f{ |a| } traverses all nodes - for example m do _1 + _9 end + for example case foo; in ^foo then nil; end traverses all nodes - for example a b(c d), 1 do end + for example f(a ? "a":1) traverses all nodes - for example self::a, foo = foo + for example p <<~E + x + y +E traverses all nodes - for example a, b = *foo, bar + for example case foo; in A[x:] then true; end traverses all nodes - for example :"#@1" + for example "a\ +b" traverses all nodes - for example Bar::Foo + for example case foo; in [x, y, *z] then true; end traverses all nodes + for example begin; meth; rescue; foo; end + traverses all nodes + +RuboCop::AST::AliasNode + #new_identifier + is expected to eq :foo + is expected to be sym type + .new + is expected to be a kind of RuboCop::AST::AliasNode + #old_identifier + is expected to be sym type + is expected to eq :bar + +RuboCop::AST::OrNode + #inverse_operator + with a logical or node + is expected to eq "&&" + with a semantic or node + is expected to eq "and" + #rhs + with a logical or node + is expected to be int type + with a semantic or node + is expected to be int type + #alternate_operator + with a semantic or node + is expected to eq "||" + with a logical or node + is expected to eq "or" + #logical_operator? + with a logical or node + is expected to be logical operator + with a semantic or node + is expected not to be logical operator + .new + with a logical or node + is expected to be a kind of RuboCop::AST::OrNode + with a semantic or node + is expected to be a kind of RuboCop::AST::OrNode + #lhs + with a logical or node + is expected to be sym type + with a semantic or node + is expected to be sym type + #semantic_operator? + with a semantic or node + is expected to be semantic operator + with a logical or node + is expected not to be semantic operator + #operator + with a logical or node + is expected to eq "||" + with a semantic or node + is expected to eq "or" + +RuboCop::AST::Ext::Range + #line_span + accepts an `exclude_end` keyword argument + returns the range of lines a range occupies + +RuboCop::AST::WhenNode + #conditions + with a multiple conditions + is expected to all be literal + is expected to eq 3 + with a single condition + is expected to all be literal + is expected to eq 1 + #body + with a then keyword + is expected to be sym type + without a then keyword + is expected to be array type + #each_condition + when not passed a block + is expected to be a kind of Enumerator + when passed a block + yields all the conditions + .new + is expected to be a kind of RuboCop::AST::WhenNode + #branch_index + is expected to eq 0 + is expected to eq 2 + is expected to eq 1 + #then? + without a then keyword + is expected not to be then + with a then keyword + is expected to be then + +RuboCop::AST::EnsureNode + #body + is expected to be sym type + .new + is expected to be a kind of RuboCop::AST::EnsureNode + +RuboCop::AST::OpAsgnNode + #assignment_node + is expected to be a kind of RuboCop::AST::AsgnNode + .new + with an `op_asgn_node` node + is expected to be a kind of RuboCop::AST::OpAsgnNode + #name + is expected to eq :var + #expression + is expected to eq s(:send, nil, :value) + #operator + with **= + is expected to eq :** + with /= + is expected to eq :/ + with %= + is expected to eq :% + with += + is expected to eq :+ + with &= + is expected to eq :& + with |= + is expected to eq :| + with -= + is expected to eq :- + with *= + is expected to eq :* + +RuboCop::AST::FloatNode + #value + is expected to eq 1.5 + #sign? + explicit positive float + is expected to be sign + explicit negative float + is expected to be sign + .new + is expected to be a kind of RuboCop::AST::FloatNode + +RuboCop::AST::RegexpNode + #percent_r_literal? + with /-delimiters + is expected not to be percent r literal + with %r{-delimiters + is expected to be percent r literal + with multi-line %r{-delimiters + is expected to be percent r literal + with %r<-delimiters + is expected to be percent r literal + with %r/-delimiters + is expected to be percent r literal + #content + with an empty regexp with option + is expected to eq "" + with an empty regexp + is expected to eq "" + with a multi-line regexp with option + is expected to eq "\n.+\n" + with a regexp without option + is expected to eq ".+" + with a multi-line regexp without option + is expected to eq "\n.+\n" + with a regexp with option + is expected to eq ".+" + #delimiters + with %r/-delimiters + is expected to eq ["/", "/"] + with %r<-delimiters + is expected to eq ["<", ">"] + with multi-line %r{-delimiters + is expected to eq ["{", "}"] + with /-delimiters + is expected to eq ["/", "/"] + with %r{-delimiters + is expected to eq ["{", "}"] + #multiline_mode? + with only m option + is expected to be multiline mode + with m and other options + is expected to be multiline mode + with no options + is expected not to be multiline mode + with other options + is expected not to be multiline mode + #no_encoding? + with no options + is expected not to be no encoding + with only n option + is expected to be no encoding + with n and other options + is expected to be no encoding + with other options + is expected not to be no encoding + #regopt + with a regexp with option + is expected to eq [:i, :m, :x] + is expected to be regopt type + with an empty regexp with option + is expected to be regopt type + is expected to eq [:i, :x] + with a multi-line regexp without option + is expected to be empty + is expected to be regopt type + with an empty regexp + is expected to be empty + is expected to be regopt type + with a regexp without option + is expected to be empty + is expected to be regopt type + with a multi-line regexp with option + is expected to be regopt type + is expected to eq [:i, :m, :x] + #to_regexp + with a regexp without option + is expected to eq /.+/ + with a regexp with an "u" option + is expected to eq "/abc/" + with a multi-line regexp without option + is expected to eq / +.+ +/ + with an empty regexp with option + is expected to eq //ix + with a regexp with option + is expected to eq /.+/mix + with a regexp with an "n" option + is expected to eq "/abc/n" + with a multi-line regexp with option + is expected to eq / +.+ +/ix + with an empty regexp + is expected to eq // + with a regexp with an "o" option + is expected to eq "/abc/i" + .new + is expected to be a kind of RuboCop::AST::RegexpNode + #fixed_encoding? + with only u option + is expected to be fixed encoding + with u and other options + is expected to be fixed encoding + with no options + is expected not to be fixed encoding + with other options + is expected not to be fixed encoding + #extended? + with no options + is expected not to be extended + with x and other options + is expected to be extended + with only x option + is expected to be extended + with other options + is expected not to be extended + #interpolation? + with direct variable interpoation + is expected to be interpolation + with no interpolation returns false + is expected not to be interpolation + with regexp quote + is expected to be interpolation + #ignore_case? + with other options + is expected not to be ignore case + with i and other options + is expected to be ignore case + with only i option + is expected to be ignore case + with no options + is expected not to be ignore case + #slash_literal? + with %r/-delimiters + is expected not to be slash literal + with /-delimiters + is expected to be slash literal + with %r<-delimiters + is expected not to be slash literal + with multi-line %r{-delimiters + is expected not to be slash literal + with %r{-delimiters + is expected not to be slash literal + #single_interpolation? + with only o option + is expected to be single interpolation + with o and other options + is expected to be single interpolation + with no options + is expected not to be single interpolation + with other options + is expected not to be single interpolation + #delimiter? + with multi-line %r{-delimiters + is expected not to be delimiter "%r" + is expected not to be delimiter "%r/" + is expected not to be delimiter "%r{" + is expected not to be delimiter "r" + is expected not to be delimiter "%" + is expected not to be delimiter "/" + is expected to be delimiter "}" + is expected to be delimiter "{" + with %r/-delimiters + is expected not to be delimiter "%r/" + is expected not to be delimiter "r" + is expected not to be delimiter "{" + is expected to be delimiter "/" + is expected not to be delimiter "%r" + is expected not to be delimiter "%" + is expected not to be delimiter "}" + with /-delimiters + is expected to be delimiter "/" + is expected not to be delimiter "{" + with %r<-delimiters + is expected not to be delimiter "/" + is expected not to be delimiter "%r{" + is expected not to be delimiter "%r<" + is expected to be delimiter ">" + is expected not to be delimiter "{" + is expected not to be delimiter "%r" + is expected not to be delimiter "%" + is expected not to be delimiter "}" + is expected not to be delimiter "%r/" + is expected to be delimiter "<" + is expected not to be delimiter "r" + with %r{-delimiters + is expected to be delimiter "}" + is expected not to be delimiter "/" + is expected not to be delimiter "%r/" + is expected not to be delimiter "%" + is expected not to be delimiter "%r" + is expected not to be delimiter "r" + is expected to be delimiter "{" + is expected not to be delimiter "%r{" + #options + with an empty regexp + is expected to eq 0 + with a regexp with multiple options + is expected to eq 3 + with a regexp with single option + is expected to eq 1 + with a regexp without option + is expected to eq 0 + with a regexp with "o" option + is expected to eq 0 + +RuboCop::AST::SuperNode + #method_name + is expected to eq :super + #receiver + is expected to be nil + #arguments + with a single splat argument + is expected to eq 1 + with no arguments + is expected to be empty + with a single literal argument + is expected to eq 1 + with multiple literal arguments + is expected to eq 2 + with multiple mixed arguments + is expected to eq 2 + #dot? + is expected not to be dot + #command? + when argument is a symbol + is expected to be command :super + when argument is a string + is expected to be command "super" + #predicate_method? + is expected not to be predicate method + #block_node + with a block literal + is expected to be block type + with no block + is expected to be nil + with a block argument + is expected to be nil + #block_literal? + with no block + is expected not to be block literal + with a block literal + is expected to be block literal + with a block argument + is expected not to be block literal + #arguments? + with a single splat argument + is expected to be arguments + with a single literal argument + is expected to be arguments + with multiple literal arguments + is expected to be arguments + with multiple mixed arguments + is expected to be arguments + with no arguments + is expected not to be arguments + #implicit_call? + is expected not to be implicit call + #operator_method? + is expected not to be operator method + .new + with a super node + is expected to be a kind of RuboCop::AST::SuperNode + with a zsuper node + is expected to be a kind of RuboCop::AST::SuperNode + #double_colon? + is expected not to be double colon + #assignment_method? + is expected not to be assignment method + #last_argument + with multiple mixed arguments + is expected to be splat type + with a single splat argument + is expected to be splat type + with no arguments + is expected to be nil + with a single literal argument + is expected to be sym type + with multiple literal arguments + is expected to be sym type + #macro? + is expected not to be macro + #const_receiver? + is expected not to be const receiver + #block_argument? + with a block argument + is expected to be block argument + with no arguments + is expected not to be block argument + with regular arguments + is expected not to be block argument + with mixed arguments + is expected to be block argument + #first_argument + with a single literal argument + is expected to be sym type + with multiple mixed arguments + is expected to be sym type + with a single splat argument + is expected to be splat type + with no arguments + is expected to be nil + with multiple literal arguments + is expected to be sym type + #parenthesized? + with no arguments + when using parentheses + is expected to be parenthesized + when not using parentheses + is expected not to be parenthesized + with arguments + when not using parentheses + is expected not to be parenthesized + when using parentheses + is expected to be parenthesized + #self_receiver? + is expected not to be self receiver + #camel_case_method? + is expected not to be camel case method + #method? + when message matches + when argument is a string + is expected to be method "super" + when argument is a symbol + is expected to be method :super + when message does not match + when argument is a string + is expected not to be method "foo" + when argument is a symbol + is expected not to be method :foo + #comparison_method? + is expected not to be comparison method + #setter_method? + is expected not to be setter method + #splat_argument? + with mixed arguments + is expected to be splat argument + with no arguments + is expected not to be splat argument + with a splat argument + is expected to be splat argument + with regular arguments + is expected not to be splat argument + #bang_method? + is expected not to be bang method + +RuboCop::AST::YieldNode + #double_colon? + is expected not to be double colon + #receiver + is expected to be nil + #method_name + is expected to eq :yield + #self_receiver? + is expected not to be self receiver + #setter_method? + is expected not to be setter method + #macro? + is expected not to be macro + #last_argument + with multiple mixed arguments + is expected to be splat type + with a single splat argument + is expected to be splat type + with multiple literal arguments + is expected to be sym type + with no arguments + is expected to be nil + with a single literal argument + is expected to be sym type + #operator_method? + is expected not to be operator method + #camel_case_method? + is expected not to be camel case method + #first_argument + with a single splat argument + is expected to be splat type + with multiple literal arguments + is expected to be sym type + with no arguments + is expected to be nil + with a single literal argument + is expected to be sym type + with multiple mixed arguments + is expected to be sym type + #arguments + with a single literal argument + is expected to eq 1 + with multiple literal arguments + is expected to eq 2 + with multiple mixed arguments + is expected to eq 2 + with no arguments + is expected to be empty + with a single splat argument + is expected to eq 1 + #splat_argument? + with mixed arguments + is expected to be splat argument + with no arguments + is expected not to be splat argument + with regular arguments + is expected not to be splat argument + with a splat argument + is expected to be splat argument + #block_argument? + is expected not to be block argument + #bang_method? + is expected not to be bang method + #parenthesized? + with no arguments + when not using parentheses + is expected not to be parenthesized + when using parentheses + is expected to be parenthesized + with arguments + when not using parentheses + is expected not to be parenthesized + when using parentheses + is expected to be parenthesized + #dot? + is expected not to be dot + #method? + when message does not match + when argument is a symbol + is expected not to be method :foo + when argument is a string + is expected not to be method "foo" + when message matches + when argument is a string + is expected to be method "yield" + when argument is a symbol + is expected to be method :yield + .new + is expected to be a kind of RuboCop::AST::YieldNode + #command? + when argument is a string + is expected to be command "yield" + when argument is a symbol + is expected to be command :yield + #implicit_call? + is expected not to be implicit call + #arguments? + with a single splat argument + is expected to be arguments + with multiple mixed arguments + is expected to be arguments + with a single literal argument + is expected to be arguments + with no arguments + is expected not to be arguments + with multiple literal arguments + is expected to be arguments + #block_literal? + is expected not to be block literal + #block_node + is expected to be nil + #comparison_method? + is expected not to be comparison method + #const_receiver? + is expected not to be const receiver + #assignment_method? + is expected not to be assignment method + #predicate_method? + is expected not to be predicate method + +RuboCop::AST::CasgnNode + #namespace + when the parent is a `cbase` + is expected to eq s(:cbase) + when the parent is a `const` + is expected to eq s(:const, nil, :FOO) + when there is no parent + is expected to be nil + .new + with a `casgn` node + is expected to be a kind of RuboCop::AST::CasgnNode + #name + is expected to eq :VAR + #expression + is expected to eq s(:send, nil, :value) + +RuboCop::AST::NodePattern::Sets + is expected to eq "::RuboCop::AST::NodePattern::Sets::SET_1_2_3_ETC" + is expected not to eq "::RuboCop::AST::NodePattern::Sets::SET_1_2_3_ETC_2" + creates a constant with the right value + is expected to eq "::RuboCop::AST::NodePattern::Sets::SET_1_2_3_ETC" + +RuboCop::AST::BreakNode + behaves like wrapped arguments node + #arguments + with a single argument + is expected to eq 1 + with no arguments + is expected to be empty + with multiple literal arguments + is expected to eq 2 + with no arguments and braces + is expected to be empty + with a single splat argument + is expected to eq 1 + with a single argument and braces + is expected to eq 1 + .new + with arguments + is expected to be a kind of RuboCop::AST::BreakNode + without arguments + is expected to be a kind of RuboCop::AST::BreakNode + +RuboCop::AST::AndNode + #inverse_operator + with a semantic and node + is expected to eq "or" + with a logical and node + is expected to eq "||" + .new + with a logical and node + is expected to be a kind of RuboCop::AST::AndNode + with a semantic and node + is expected to be a kind of RuboCop::AST::AndNode + #semantic_operator? + with a logical and node + is expected not to be semantic operator + with a semantic and node + is expected to be semantic operator + #operator + with a logical and node + is expected to eq "&&" + with a semantic and node + is expected to eq "and" + #logical_operator? + with a logical and node + is expected to be logical operator + with a semantic and node + is expected not to be logical operator + #alternate_operator + with a semantic and node + is expected to eq "&&" + with a logical and node + is expected to eq "and" + #lhs + with a semantic and node + is expected to be sym type + with a logical and node + is expected to be sym type + #rhs + with a logical and node + is expected to be int type + with a semantic and node + is expected to be int type + +RuboCop::AST::PairNode + #delimiter + when using a hash rocket delimiter + is expected to eq " => " + is expected to eq "=>" + when using a colon delimiter + is expected to eq ":" + is expected to eq ": " + #colon? + when using a colon delimiter + is expected to be colon + when using a hash rocket delimiter + is expected not to be colon + .new + is expected to be a kind of RuboCop::AST::PairNode + #value_on_new_line? + when value spans multiple lines + is expected not to be value on new line + when pair is on a single line + is expected not to be value on new line + when value starts on a new line + is expected to be value on new line + #inverse_delimiter + when using a colon delimiter + is expected to eq " => " + is expected to eq "=>" + when using a hash rocket delimiter + is expected to eq ": " + is expected to eq ":" + #value + is expected to be int type + #same_line? + when pairs are on separate lines + when last pair is a keyword splat + is expected not to be same line s(:kwsplat, + s(:send, nil, :foo)) + when both pairs are explicit pairs + is expected not to be same line s(:pair, + s(:sym, :b), + s(:int, 2)) + when both pairs are on the same line + when both pairs are explicit pairs + is expected to be same line s(:pair, + s(:sym, :b), + s(:int, 2)) + when both pair is a keyword splat + is expected to be same line s(:kwsplat, + s(:send, nil, :foo)) + when a multiline pair shares the same line + when both pairs are explicit pairs + is expected to be same line s(:pair, + s(:sym, :b), + s(:int, 2)) + is expected to be same line s(:pair, + s(:sym, :a), + s(:begin)) + when last pair is a keyword splat + is expected to be same line s(:pair, + s(:sym, :a), + s(:begin)) + is expected to be same line s(:kwsplat, + s(:send, nil, :foo)) + #value_delta + when using colon delimiters + when values are aligned + when both pairs are explicit pairs + is expected to eq 0 + when second pair is a keyword splat + is expected to eq 0 + when both pairs are on the same line + is expected to eq 0 + when receiver value is ahead + is expected to eq 2 + when receiver value is behind + is expected to eq -2 + when using hash rocket delimiters + when receiver value is behind + is expected to eq -2 + when receiver value is ahead + is expected to eq 2 + when both pairs are on the same line + is expected to eq 0 + when values are aligned + when both pairs are explicit pairs + is expected to eq 0 + when second pair is a keyword splat + is expected to eq 0 + #hash_rocket? + when using a hash rocket delimiter + is expected to be hash rocket + when using a colon delimiter + is expected not to be hash rocket + #key_delta + with alignment set to :right + when using hash rocket delimiters + when receiver key is ahead + when second pair is a keyword splat + is expected to eq 0 + when both pairs are explicit pairs + is expected to eq 2 + when both keys are on the same line + when both pairs are explicit pairs + is expected to eq 0 + when second pair is a keyword splat + is expected to eq 0 + when keys are aligned + when both keys are explicit keys + is expected to eq 0 + when second key is a keyword splat + is expected to eq 0 + when receiver key is behind + when second pair is a keyword splat + is expected to eq 0 + when both pairs are explicit pairs + is expected to eq -2 + when using colon delimiters + when both keys are on the same line + when second pair is a keyword splat + is expected to eq 0 + when both pairs are explicit pairs + is expected to eq 0 + when receiver key is behind + when both pairs are reail pairs + is expected to eq -2 + when second pair is a keyword splat + is expected to eq 0 + when keys are aligned + when both pairs are explicit pairs + is expected to eq 0 + when second pair is a keyword splat + is expected to eq 0 + when receiver key is ahead + when second pair is a keyword splat + is expected to eq 0 + when both pairs are explicit pairs + is expected to eq 2 + with alignment set to :left + when using hash rocket delimiters + when keys are aligned + when both keys are explicit keys + is expected to eq 0 + when second key is a keyword splat + is expected to eq 0 + when both keys are on the same line + when second pair is a keyword splat + is expected to eq 0 + when both pairs are explicit pairs + is expected to eq 0 + when receiver key is ahead + when second pair is a keyword splat + is expected to eq 2 + when both pairs are explicit pairs + is expected to eq 2 + when receiver key is behind + when second pair is a keyword splat + is expected to eq -2 + when both pairs are explicit pairs + is expected to eq -2 + when using colon delimiters + when receiver key is ahead + when second pair is a keyword splat + is expected to eq 2 + when both pairs are explicit pairs + is expected to eq 2 + when keys are aligned + when second pair is a keyword splat + is expected to eq 0 + when both pairs are explicit pairs + is expected to eq 0 + when both keys are on the same line + when second pair is a keyword splat + is expected to eq 0 + when both pairs are explicit pairs + is expected to eq 0 + when receiver key is behind + when both pairs are reail pairs + is expected to eq -2 + when second pair is a keyword splat + is expected to eq -2 + #key + when using a symbol key + is expected to be sym type + when using a string key + is expected to be str type + #value_omission? + when not using hash value omission + is expected not to be value omission + when using hash value omission + is expected to be value omission + +RuboCop::AST::IntNode + .new + is expected to be a kind of RuboCop::AST::IntNode + #sign? + explicit negative int + is expected to be sign + explicit positive int + is expected to be sign + #value + is expected to eq 10 + +RuboCop::AST::CaseNode + #keyword + is expected to eq "case" + #when_branches + is expected to all be when type + is expected to eq 3 + #each_when + when passed a block + yields all the conditions + when not passed a block + is expected to be a kind of Enumerator + #else_branch + #else? + without an else statement + is expected to be nil + with an empty else statement + is expected to be nil + with an else statement + is expected to be sym type + #else? + without an else statement + is expected not to be else + with an else statement + is expected to be else + .new + is expected to be a kind of RuboCop::AST::CaseNode + #branches + when there is no else keyword + returns only then when bodies + when there is an else + returns all the bodies + with an empty else + returns all the bodies + when compared to an IfNode + returns the same + +RuboCop::AST::InPatternNode + when using Ruby 2.7 or newer + #body + without a then keyword + is expected to be array type + with a then keyword + is expected to be sym type + #then? + without a then keyword + is expected not to be then + with a then keyword + is expected to be then + .new + is expected to be a kind of RuboCop::AST::InPatternNode + #pattern + with an as pattern + is expected to be match as type + with a variable pattern + is expected to be match var type + with an array pattern + is expected to be array pattern type + with a value pattern + is expected to be int type + with an alternative pattern + is expected to be match alt type + with a pin operator + is expected to be pin type + with a hash pattern + is expected to be hash pattern type + #branch_index + is expected to eq 1 + is expected to eq 0 + is expected to eq 2 + +RuboCop::AST::LambdaNode + #receiver + is expected to be nil + #method_name + is expected to eq :lambda + #arguments + is expected to eq 2 + +RuboCop::AST::ReturnNode + behaves like wrapped arguments node + #arguments + with no arguments + is expected to be empty + with a single argument + is expected to eq 1 + with a single argument and braces + is expected to eq 1 + with no arguments and braces + is expected to be empty + with multiple literal arguments + is expected to eq 2 + with a single splat argument + is expected to eq 1 + .new + without arguments + is expected to be a kind of RuboCop::AST::ReturnNode + with arguments + is expected to be a kind of RuboCop::AST::ReturnNode + +RuboCop::AST::SendNode + #setter_method? + with a regular method + is expected not to be setter method + with a setter method + is expected to be setter method + with an operator method + is expected not to be setter method + with an indexed setter method + is expected to be setter method + #command? + when argument is a symbol + with an explicit receiver + is expected not to be command :bar + with an implicit receiver + is expected to be command :bar + when argument is a string + with an explicit receiver + is expected not to be command "bar" + with an implicit receiver + is expected to be command "bar" + #last_argument + with no arguments + is expected to be nil + with multiple literal arguments + is expected to be sym type + with a single literal argument + is expected to be sym type + with a single splat argument + is expected to be splat type + with multiple mixed arguments + is expected to be splat type + #lambda? + with a lambda method + is expected to be lambda + with a non-lambda method + is expected not to be lambda + with a stabby lambda method + is expected to be lambda + with a method named lambda in a class + is expected not to be lambda + #arithmetic_operation? + with a regular method call + is expected not to be arithmetic operation + with a unary numeric operation + is expected not to be arithmetic operation + with a binary arithmetic operation + is expected to be arithmetic operation + #lambda_literal? + with a non-lambda method + is expected not to be lambda + with a stabby lambda + is expected to be lambda literal + with a lambda method + is expected not to be lambda literal + with `a.() {}` style method + is expected not to be lambda + #block_literal? + with no block + is expected not to be block literal + with a block argument + is expected not to be block literal + with Ruby >= 2.7 + with a numblock literal + is expected to be block literal + with a block literal + is expected to be block literal + #enumerable_method? + with an enumerable method + is expected to be enumerable method + with a regular method + is expected not to be enumerable method + #def_modifier + with several prefixed def modifiers + is expected to eq :qux + with a prefixed def modifier + is expected to eq :bar + with a block containing a method definition + is expected to be nil + with call with no argument + is expected to be nil + #unary_operation? + with a unary operation + is expected to be unary operation + with an implicit call method + is expected not to be unary operation + with a regular method call + is expected not to be unary operation + with a binary operation + is expected not to be unary operation + #first_argument + with a single splat argument + is expected to be splat type + with no arguments + is expected to be nil + with a single literal argument + is expected to be sym type + with multiple literal arguments + is expected to be sym type + with multiple mixed arguments + is expected to be sym type + #nonmutating_hash_method? + with a mutating Hash method + is expected not to be nonmutating hash method + with a nonmutating Hash method + is expected to be nonmutating hash method + with a regular method + is expected not to be nonmutating hash method + #arguments + with a single literal argument + is expected to eq 1 + with no arguments + is expected to be empty + with multiple mixed arguments + is expected to eq 2 + with a single splat argument + is expected to eq 1 + with multiple literal arguments + is expected to eq 2 + #prefix_not? + with keyword `not` + is expected to be prefix not + with a non-negated method + is expected not to be prefix not + with a bang method + is expected not to be prefix not + #bang_method? + with a bang method + is expected to be bang method + with a regular method + is expected not to be bang method + with a predicate method + is expected not to be bang method + #self_receiver? + with an implicit receiver + is expected not to be self receiver + with a non-self receiver + is expected not to be self receiver + with a self receiver + is expected to be self receiver + #receiver + with no receiver + is expected to be nil + with a literal receiver + is expected to be str type + with a variable receiver + is expected to be send type + #negation_method? + with a non-negated method + is expected not to be negation method + with suffix `not` + is expected not to be negation method + with prefix `not` + is expected to be negation method + with prefix bang + is expected to be negation method + #predicate_method? + with a regular method + is expected not to be predicate method + with a bang method + is expected not to be predicate method + with a predicate method + is expected to be predicate method + #double_colon? + with a dot + is expected not to be double colon + with a double colon + is expected to be double colon + with a unary method + is expected not to be double colon + without a dot + is expected not to be double colon + #block_node + with a block literal + is expected to be block type + with Ruby >= 2.7 + with a numblock literal + is expected to be numblock type + with no block + is expected to be nil + with a block argument + is expected to be nil + #nonmutating_array_method? + with a regular method + is expected not to be nonmutating array method + with a nonmutating Array method + is expected to be nonmutating array method + with a mutating Array method + is expected not to be nonmutating array method + #camel_case_method? + with a regular method + is expected not to be camel case method + with a camel case method + is expected to be camel case method + #method_name + with a plain method + is expected to eq :bar + with an implicit call method + is expected to eq :call + with an operator method + is expected to eq :== + with a setter method + is expected to eq :bar= + #access_modifier? + when node is a bare `module_function` + is expected to be access modifier + when node is a non-bare `module_function` + is expected to be access modifier + when node is not an access modifier + is expected not to be bare access modifier + #block_argument? + with a block argument + is expected to be block argument + with no arguments + is expected not to be block argument + with mixed arguments + is expected to be block argument + with regular arguments + is expected not to be block argument + #bare_access_modifier? + when node is a bare `module_function` + is expected to be bare access modifier + with Ruby >= 2.7 + when node is access modifier in numblock + is expected to be bare access modifier + when node is access modifier in block + is expected to be bare access modifier + when node is not an access modifier + is expected not to be bare access modifier + when node has an argument + is expected not to be bare access modifier + #attribute_accessor? + with an accessor + returns the accessor method and Array] + with a call without arguments + is expected to be nil + #loop_keyword? + is expected not to be loop keyword + #nonmutating_string_method? + with a regular method + is expected not to be nonmutating string method + with a nonmutating String method + is expected to be nonmutating string method + with a mutating String method + is expected not to be nonmutating string method + #nonmutating_unary_operator_method? + with a regular method + is expected not to be nonmutating unary operator method + with a nonmutating unary operator method + is expected to be nonmutating unary operator method + #macro? + without a receiver + when parent is a method definition + is expected not to be macro + when the condition of an if + is expected not to be macro + with Ruby >= 2.7 + when parent is a numblock in a macro scope + is expected to be macro + when parent is a keyword begin inside of an class + is expected to be macro + when parent is a struct constructor + is expected to be macro + when parent is a module + is expected to be macro + when parent is a singleton class + is expected to be macro + when parent is a class constructor + is expected to be macro + when in an if + is expected to be macro + when parent is a block not in a macro scope + is expected not to be macro + without a parent + is expected to be macro + when in the global scope + is expected to be macro + when parent is a class + is expected to be macro + when parent is a begin without a parent + is expected to be macro + when parent is a block in a macro scope + is expected to be macro + with a receiver + when parent is a module + is expected not to be macro + when parent is a class + is expected not to be macro + #splat_argument? + with a splat argument + is expected to be splat argument + with regular arguments + is expected not to be splat argument + with no arguments + is expected not to be splat argument + with mixed arguments + is expected to be splat argument + #def_modifier? + with a block containing a method definition + is expected not to be def modifier + with several prefixed def modifiers + is expected to be def modifier + with a prefixed def modifier + is expected to be def modifier + #assignment_method? + with a comparison method + is expected not to be assignment method + with a bracket assignment method + is expected to be assignment method + with a regular method + is expected not to be assignment method + with an assignment method + is expected to be assignment method + #parenthesized? + with no arguments + when using parentheses + is expected to be parenthesized + when not using parentheses + is expected not to be parenthesized + with arguments + when not using parentheses + is expected not to be parenthesized + when using parentheses + is expected to be parenthesized + #method? + when message matches + when argument is a string + is expected to be method "bar" + when argument is a symbol + is expected to be method :bar + when message does not match + when argument is a symbol + is expected not to be method :foo + when argument is a string + is expected not to be method "foo" + #arguments? + with multiple literal arguments + is expected to be arguments + with a single literal argument + is expected to be arguments + with a single splat argument + is expected to be arguments + with multiple mixed arguments + is expected to be arguments + with no arguments + is expected not to be arguments + #nonmutating_operator_method? + with a mutating binary operator method + is expected not to be nonmutating operator method + with a nonmutating unary operator method + is expected to be nonmutating operator method + with a nonmutating binary operator method + is expected to be nonmutating operator method + with a regular method + is expected not to be nonmutating operator method + #post_condition_loop? + is expected not to be post condition loop + #implicit_call? + with an explicit call method + is expected not to be implicit call + with a regular method + is expected not to be implicit call + with an implicit call method + is expected to be implicit call + .new + with a safe navigation method send + is expected to be a kind of RuboCop::AST::SendNode + with a regular method send + is expected to be a kind of RuboCop::AST::SendNode + #const_receiver? + with a constant receiver + is expected to be const receiver + with a non-constant receiver + is expected not to be const receiver + with a self receiver + is expected not to be const receiver + #operator_method? + with a unary operator method + is expected to be operator method + with a binary operator method + is expected to be operator method + with a regular method + is expected not to be operator method + with a setter method + is expected not to be operator method + #dot? + with a unary method + is expected not to be dot + with a double colon + is expected not to be dot + without a dot + is expected not to be dot + with a dot + is expected to be dot + #non_bare_access_modifier? + when node is not an access modifier + is expected not to be non bare access modifier + when node is a non-bare `module_function` + is expected to be non bare access modifier + when node does not have an argument + is expected not to be non bare access modifier + #nonmutating_binary_operator_method? + with a nonmutating binary operator method + is expected to be nonmutating binary operator method + with a mutating binary operator method + is expected not to be nonmutating binary operator method + with a regular method + is expected not to be nonmutating binary operator method + #comparison_method? + with a comparison method + is expected to be comparison method + with a regular method + is expected not to be comparison method + with a negation method + is expected not to be comparison method + #prefix_bang? + with a bang method + is expected to be prefix bang + with a non-negated method + is expected not to be prefix bang + with keyword `not` + is expected not to be prefix bang + #binary_operation?? + with a regular method call + is expected not to be binary operation + with a unary operation + is expected not to be binary operation + with a binary operation + is expected to be binary operation + with an implicit call method + is expected not to be binary operation + +RuboCop::AST::ForNode + #body + is expected to be sym type + #collection + is expected to be sym type + .new + is expected to be a kind of RuboCop::AST::ForNode + #keyword + is expected to eq "for" + #do? + with a do keyword + is expected to be do + without a do keyword + is expected not to be do + #void_context? + without a do keyword + is expected to be void context + with a do keyword + is expected to be void context + #loop_keyword? + is expected to be loop keyword + #post_condition_loop? + is expected not to be post condition loop + #variable + is expected to be lvasgn type + +RuboCop::AST::RuboCopCompatibility + when ran from an incompatible version of Rubocop + issues a warning + when ran from a compatible version of Rubocop + issues a warning + +RuboCop::AST::SelfClassNode + #identifier + is expected to be self type + .new + is expected to be a kind of RuboCop::AST::SelfClassNode + #body + with a multi-expression body + is expected to be begin type + with a single expression body + is expected to be send type + with an empty body + is expected to be nil + +RuboCop::AST::RangeNode + .new + with a beignless range + is expected to be range type + is expected to be a kind of RuboCop::AST::RangeNode + with an exclusive range + is expected to be range type + is expected to be a kind of RuboCop::AST::RangeNode + with an inclusive range + is expected to be a kind of RuboCop::AST::RangeNode + is expected to be range type + with an infinite range + is expected to be a kind of RuboCop::AST::RangeNode + is expected to be range type + +RuboCop::AST::StrNode + #heredoc? + with a normal string + is expected not to be heredoc + with a heredoc + is expected to be heredoc + with a string with interpolation + is expected not to be heredoc + #character_literal? + with a heredoc + is expected not to be character literal + with a normal string literal + is expected not to be character literal + with a character literal + is expected to be character literal + .new + with a heredoc + is expected to be a kind of RuboCop::AST::StrNode + with a normal string + is expected to be a kind of RuboCop::AST::StrNode + with a string with interpolation + is expected to be a kind of RuboCop::AST::StrNode + +RuboCop::AST::Node + #pure? + for a module definition + returns false + for a gvar assignment + returns false + for an lvar assignment + returns false + for a method call + returns false + for a hash literal + with only literal children + returns true + which contains a method call + returns false + for an ivar assignment + returns false + for a cvar assignment + returns false + for an integer literal + returns true + for an array literal + which contains a method call + returns false + with only literal children + returns true + for a nested if + where one branch contains a method call + returns false + where the innermost descendants are local vars and literals + returns true + where one branch contains an assignment statement + returns false + for a regexp + with interpolated segments + returns false + with no interpolation + returns true + with options + returns true + for a class definition + returns false + #conditional? + when `case_match` node + is true + when `while` node + is true + when `case` node + is true + when `until` node + is true + when post condition loop node + is false + when `if` node + is true + #class_definition? + constant defined as Struct without block + does not match + with Struct + matches + when using numbered parameter + matches + namespaced class + matches + without inheritance + matches + with object singleton class + matches + with inheritance + matches + with self singleton class + matches + with Class.new + matches + when using numbered parameter + matches + with ::ClassName + matches + #class_constructor? + module definition with a block + matches + class definition on outer scope + matches + class definition + does not match + class definition with a block + matches + #struct_constructor? + ::Struct + matches + struct definition with a block + matches + struct definition without block + does not match + #numeric_type? + when string literal + is true + when complex literal + is true + when float literal + is true + when rational literal + is true + when integer literal + is true + when complex literal whose imaginary part is a rational + is true + sibling_access + returns trivial values for a root node + for a node with siblings + returns the expected values + for a single child + returns the expected values + #recursive_basic_literal? + behaves like literal + returns true for `(false && true)` + behaves like literal + returns true for `1.0` + behaves like non literal + returns false for `{ :sym => some_method_call }` + behaves like literal + returns true for `"#{2}"` + behaves like literal + returns true for `[1, 2, 3]` + behaves like literal + returns true for `'str'` + behaves like non literal + returns false for `(x or false)` + behaves like literal + returns true for `!true` + behaves like literal + returns true for `{ :a => 1, :b => 2 }` + behaves like literal + returns true for `(false <=> true)` + behaves like non literal + returns false for `(x && false)` + behaves like literal + returns true for `/./` + behaves like literal + returns true for `(false or true)` + behaves like literal + returns true for `(1)` + behaves like literal + returns true for `nil` + behaves like non literal + returns false for `{ some_method_call => :sym }` + behaves like literal + returns true for `%r{abx}ixo` + behaves like non literal + returns false for `/.#{some_method_call}/` + behaves like non literal + returns false for `%r{abx#{foo}}ixo` + behaves like non literal + returns false for `[some_method_call]` + behaves like non literal + returns false for `some_method_call` + behaves like literal + returns true for `false` + behaves like non literal + returns false for `some_method_call(x, y)` + behaves like literal + returns true for `1` + behaves like non literal + returns false for `(x == false)` + behaves like literal + returns true for `{ a: 1, b: 2 }` + #parent_module_name + when node nested in a class << exp + is expected to be nil + when node on top level + is expected to eq "Object" + when node on module + is expected to eq "Foo" + when node on class in singleton class + is expected to eq "Foo::#::Bar" + when node on singleton class + is expected to eq "Foo::#" + when node nested in an unknown block + is expected to be nil + #argument_type? + block arguments + returns true for all argument types + method arguments + returns true for all argument types + #module_definition? + nested modules + matches + using module keyword + matches + prepend Module.new + matches + with Module.new + matches + when using numbered parameter + matches + included module definition + matches + with ::ModuleName + matches + namespaced modules + matches + #value_used? + within a class definition node + is always true + within a method call node + is always true + at the top level + is false + at the end of a block + is always true + within a while node + is true only for the condition + within a module definition node + is always true + within a singleton class node + is always true + within an if...else..end node + nested in a method call + is always true + at the top level + is true only for the condition + within an array literal + at the top level + is always false + assigned to an ivar + is always true + +RuboCop::AST::RescueNode + #branches + when there is an else + returns all the bodies + with an empty else + returns all the bodies + when there is no else keyword + returns only then rescue bodies + #else? + without an else statement + is expected not to be else + with an else statement + is expected to be else + .new + is expected to be a kind of RuboCop::AST::RescueNode + #resbody_branches + is expected to eq 2 + is expected to all be resbody type + #body + is expected to be send type + #else_branch + with an else statement + is expected to be send type + without an else statement + is expected to be nil + +RuboCop::AST::ConstNode + #each_path + yields all parts of the namespace + #module_name? + is expected not to be module name + with a constant with a lowercase letter + is expected to be module name + #absolute? + is expected to be absolute + with a non-namespaced constant + is expected not to be absolute + with a constant not starting with :: + is expected not to be absolute + #namespace + is expected to eq "::Foo::Bar" + #short_name + is expected to eq :BAZ + #relative? + with a non-namespaced constant + is expected to be relative + +RuboCop::AST::AndAsgnNode + .new + is expected to be a kind of RuboCop::AST::AndAsgnNode + #operator + is expected to eq :"&&" + #expression + is expected to eq s(:send, nil, :value) + #name + is expected to eq :var + #assignment_node + is expected to be a kind of RuboCop::AST::AsgnNode + +RuboCop::AST::WhileNode + .new + with a modifier while + is expected to be a kind of RuboCop::AST::WhileNode + with a statement while + is expected to be a kind of RuboCop::AST::WhileNode + #loop_keyword? + with a modifier while + is expected to be loop keyword + with a statement while + is expected to be loop keyword + #post_condition_loop? + with a statement while + is expected not to be post condition loop + with a modifier while + is expected to be post condition loop + #keyword + is expected to eq "while" + #do? + with a do keyword + is expected to be do + without a do keyword + is expected not to be do + #inverse_keyword + is expected to eq "until" + +RuboCop::AST::UntilNode + #inverse_keyword + is expected to eq "while" + .new + with a statement until + is expected to be a kind of RuboCop::AST::UntilNode + with a modifier until + is expected to be a kind of RuboCop::AST::UntilNode + #loop_keyword? + with a statement until + is expected to be loop keyword + with a modifier until + is expected to be loop keyword + #do? + without a do keyword + is expected not to be do + with a do keyword + is expected to be do + #post_condition_loop? + with a modifier until + is expected to be post condition loop + with a statement until + is expected not to be post condition loop + #keyword + is expected to eq "until" RuboCop::AST::ArrayNode + .new + is expected to be a kind of RuboCop::AST::ArrayNode #values - with an empty array - is expected to be empty with an array of variables - is expected to all be send type is expected to eq 2 + is expected to all be send type with an array of literals is expected to eq 3 is expected to all be literal - .new - is expected to be a kind of RuboCop::AST::ArrayNode - #square_brackets? - with a percent literal - is expected not to be square brackets + with an empty array + is expected to be empty + #bracketed? + unbracketed + is expected to be nil with square brackets - is expected to be square brackets + is expected to be bracketed + with a percent literal + is expected to be bracketed #each_value without block is expected to be a kind of Enumerator with block - is expected to eq ["(int 1)", "(int 2)", "(int 3)"] is expected to be a kind of RuboCop::AST::ArrayNode + is expected to eq ["(int 1)", "(int 2)", "(int 3)"] #percent_literal? - with a string percent literal - is expected to be percent literal - is expected not to be percent literal :symbol - is expected to be percent literal :string with square brackets - is expected not to be percent literal :string is expected not to be percent literal + is expected not to be percent literal :string + is expected not to be percent literal :symbol + with a string percent literal is expected not to be percent literal :symbol + is expected to be percent literal :string + is expected to be percent literal with a symbol percent literal - is expected not to be percent literal :string is expected to be percent literal + is expected not to be percent literal :string is expected to be percent literal :symbol - #bracketed? + #square_brackets? with square brackets - is expected to be bracketed + is expected to be square brackets with a percent literal - is expected to be bracketed - unbracketed - is expected to be nil + is expected not to be square brackets + +RuboCop::AST::BlockNode + #receiver + with safe navigation operator call + is expected to eq "foo" + with dot operator call + is expected to eq "foo" + .new + is expected to be a kind of RuboCop::AST::BlockNode + #delimiters + when enclosed in braces + is expected to eq ["{", "}"] + when enclosed in do-end keywords + is expected to eq ["do", "end"] + #lambda? + when block belongs to a non-lambda method + is expected not to be lambda + when block belongs to a stabby lambda + is expected to be lambda + when block belongs to a method lambda + is expected to be lambda + #arguments + with a single literal argument + is expected to eq 1 + with multiple mixed arguments + is expected to eq 2 + >= Ruby 2.7 + using numbered parameters + is expected to be empty + with a single splat argument + is expected to eq 1 + with no arguments + is expected to be empty + with destructured arguments + is expected to eq 2 + #closing_delimiter + when enclosed in braces + is expected to eq "}" + when enclosed in do-end keywords + is expected to eq "end" + #keywords? + when enclosed in braces + is expected not to be keywords + when enclosed in do-end keywords + is expected to be keywords + #opening_delimiter + when enclosed in braces + is expected to eq "{" + when enclosed in do-end keywords + is expected to eq "do" + #single_line? + when block is on several lines + is expected not to be single line + when block is on a single line + is expected to be single line + #argument_list + with no arguments + is expected to be empty + >= Ruby 2.7 + using numbered parameters + with sequential params + is expected to eq [:_1, :_2] + with skipped params + is expected to eq [:_1, :_2, :_3, :_4, :_5, :_6, :_7] + all argument types + is expected to eq [:a, :b, :c, :d, :e, :f, :g, :h, :i] + #multiline? + when block is on a single line + is expected not to be multiline + when block is on several lines + is expected to be multiline + #arguments? + with a single splat argument + is expected to be arguments + with multiple mixed arguments + is expected to be arguments + >= Ruby 2.7 + using numbered parameters + is expected not to be arguments + with no arguments + is expected not to be arguments + with destructuring arguments + is expected to be arguments + with a single argument + is expected to be arguments + #braces? + when enclosed in braces + is expected to be braces + when enclosed in do-end keywords + is expected not to be braces + #void_context? + when block method is not each + is expected not to be void context + when block method is tap + is expected to be void context + when block method is each + is expected to be void context RuboCop::AST::SymbolNode + #value + is expected to eq :foo .new with a symbol node is expected to be a kind of RuboCop::AST::SymbolNode - #value - is expected to eq :foo + +RuboCop::AST::ForwardArgsNode + when using Ruby 2.7 or newer + #to_a + is expected to contain exactly (be forward arg type) RuboCop::AST::AsgnNode - #expression - with a `lvasgn` node - is expected to eq s(:send, nil, :value) + #name with a `ivasgn` node - is expected to eq s(:send, nil, :value) + is expected to eq :@var with a `gvasgn` node - is expected to eq s(:send, nil, :value) + is expected to eq :$var + with a `lvasgn` node + is expected to eq :var with a `cvasgn` node - is expected to eq s(:send, nil, :value) + is expected to eq :@@var .new - with a `gvasgn` node - is expected to be a kind of RuboCop::AST::AsgnNode - with a `ivasgn` node - is expected to be a kind of RuboCop::AST::AsgnNode with a `lvasgn` node is expected to be a kind of RuboCop::AST::AsgnNode with a `cvasgn` node is expected to be a kind of RuboCop::AST::AsgnNode - #name - with a `cvasgn` node - is expected to eq :@@var with a `ivasgn` node - is expected to eq :@var + is expected to be a kind of RuboCop::AST::AsgnNode with a `gvasgn` node - is expected to eq :$var + is expected to be a kind of RuboCop::AST::AsgnNode + #expression with a `lvasgn` node - is expected to eq :var - -RuboCop::AST::NodePattern - funcalls - with one argument - is expected to match code s(:str, "foo") and "foo" - with multiple arguments - is expected to match code s(:str, "c"), "a", and "d" - without extra arguments - is expected to match code :a and s(:int, 1) - wildcards - unnamed wildcards - within a sequence - is expected to match code nil and :Const - negated - behaves like nonmatching - doesn't match - in head position of a sequence - is expected to match code s(:int, 1), :+, and s(:send, nil, :a) - within a sequence with other patterns intervening - is expected to match code :@abc and s(:int, 22) - at the root level - is expected to match code s(:sclass, - s(:self), - s(:def, :something, - s(:args), - s(:int, 1))) and :freeze - named wildcards - within a union - with a preceding unifying constraint - matching a branch - is expected to match code s(:int, 2) and s(:array, - s(:int, 2), - s(:int, 1)) - that can not be unified - behaves like nonmatching - doesn't match - confined to the union - without unification - is expected to match code s(:int, 2) and s(:int, 1) - with partial unification - matching the unified branch - is expected to match code s(:int, 5) and s(:int, 5) - matching the free branch - is expected to match code s(:int, 2) and s(:int, 1) - that can not be unified - behaves like nonmatching - doesn't match - with a succeeding unifying constraint - with branches without the wildcard - encountered first - behaves like invalid - is invalid - encountered after - behaves like invalid - is invalid - with all branches with the wildcard - that can not be unified - behaves like nonmatching - doesn't match - matching the first branch - is expected to match code s(:array, - s(:int, 1), - s(:int, 2)) and s(:int, 2) - matching another branch - is expected to match code s(:array, - s(:int, 2), - s(:int, 1)) and s(:int, 2) - within a sequence with other patterns intervening - is expected to match code :@abc and s(:int, 22) - in head position of a sequence - is expected to match code s(:int, 1), :+, and s(:send, nil, :a) - at the root level - is expected to match code s(:sclass, - s(:self), - s(:def, :something, - s(:args), - s(:int, 1))) and :freeze - within a sequence - with values which cannot be unified - behaves like nonmatching - doesn't match - with values which can be unified - is expected to match code s(:int, 5), :+, and s(:int, 5) - unifying the node type with an argument - is expected to match code s(:send, nil, :obj) and :send - unions - with a nested sequence - is expected to match code s(:const, nil, :Const) and :method - nested inside a sequence - is expected to match code s(:const, nil, :Const) and :method - at the top level - containing mixed node and literals - is expected to match code nil and :obj - containing integer literals - is expected to match code s(:int, 10) and :abs - containing symbol literals - when the AST does not have a matching symbol - behaves like nonmatching - doesn't match - when the AST has a matching symbol - is expected to match code s(:send, nil, :obj) and :b - containing string literals - is expected to match code s(:str, "a") and :upcase - containing multiple [] - on a node which meets all requirements of the first [] - is expected to match code 3 - on a node which meets some requirements but not all - behaves like nonmatching - doesn't match - on a node which meets all requirements of the second [] - is expected to match code 2.4 - variadic - with fixed terms - works for cases with variadic terms after union - works for cases with fixed arity before and after union - works for cases with variadic terms before and after union - with variadic terms - works for cases with variadic terms after union - works for cases with variadic terms before and after union - works for cases with fixed arity before and after union - multiple - works for complex cases - sequence with trailing ... - on a node with a different type - behaves like nonmatching - doesn't match - on a node with non-matching children - behaves like nonmatching - doesn't match - on a node with the same type and more children - with 2 children more - is expected to match code s(:int, 1), :blah, s(:int, 1), and s(:sym, :something) - with 1 child more - is expected to match code s(:int, 1), :blah, and s(:int, 1) - on a node with the same type and fewer children - behaves like nonmatching - doesn't match - on a node with fewer children, with a wildcard preceding - behaves like nonmatching - doesn't match - on a node with the same type and exact number of children - is expected to match code s(:int, 1) and :blah - literals - single quoted string literals - is expected to match code "foo" - negative float literals - is expected to match code -2.5 - bare literal - on a node - behaves like nonmatching - doesn't match - on a matching literal - is expected to match code :bar - negative integer literals - is expected to match code -100 - symbol literals - is expected to match code :foo - double quoted string literals - is expected to match code "foo" - positive float literals - is expected to match code 1.0 - .descend - yields the given argument if it is not a Node - yields all children depth first - macros - with a pattern with captures - def_node_search - with a predicate name - when called on matching code - is expected to match code nil, :foo, s(:sym, :hello), and s(:sym, :world) - when called on non-matching code - behaves like nonmatching - doesn't match - when it errors - raises an error with the right location - without a predicate name - when called on non-matching code - returns an enumerator yielding nothing - when called on matching code - returns an enumerator yielding the captures - when the pattern contains keyword_params - returns an enumerator yielding the captures - when helper is called with default keyword_params - is overridden when calling the matcher - some defaults are not params - raises an error - and no value is given to the matcher - uses the defaults - when it errors - raises an error with the right location - def_node_matcher - when called on matching code - is expected to eq :hello - when it errors - raises an error with the right location - when called on non-matching code - behaves like nonmatching - doesn't match - with a pattern without captures - def_node_matcher - returns the method name - when called on matching code - is expected to match code :hello - when called on non-matching code - behaves like nonmatching - doesn't match - when it errors - raises an error with the right location - def_node_search - returns the method name - with a predicate name - when called on non-matching code - behaves like nonmatching - doesn't match - when it errors - raises an error with the right location - when called on matching code - is expected to match code nil, :foo, s(:sym, :hello), and s(:sym, :world) - without a predicate name - when called on non-matching code - returns an enumerator yielding nothing - when called on matching code - returns an enumerator yielding the matches - when it errors - raises an error with the right location - with a pattern with a constant - is expected to match code :hello - when the value is not in the set - behaves like nonmatching - doesn't match - with a pattern with a namespaced call - is expected to match code :hello - when the value is not in the set - behaves like nonmatching - doesn't match - params - as named parameters - when not provided - raises an ArgumentError - when extra are provided - raises an ArgumentError - when provided as argument to match - is expected to match code s(:int, 10) and {:foo=>#} - when negated, with a matching value - behaves like nonmatching - doesn't match - when inside a union, with a matching value - is expected to match code s(:int, 10) and 10 - param number zero - in a position which does not match original target node - behaves like nonmatching - doesn't match - in a position which matches original target node - is expected to match code 1 - in a nested sequence - is expected to match code s(:send, - s(:send, - s(:int, 5), :dec), :inc), :inc, and :dec - when inside a union, with a nonmatching value - behaves like nonmatching - doesn't match - in root position - is expected to match code s(:int, 10) and s(:int, 10) - in root position - is expected to match code s(:int, 10) and # - when negated, with a nonmatching value - is expected to match code s(:const, - s(:const, nil, :Namespace), :B) and :A - when preceded by $... - behaves like single capture - returns captured values if there is no block - yields captured value(s) and returns true if there is a block - without explicit number - is expected to match code s(:const, - s(:const, nil, :Namespace), :A), :A, and s(:const, nil, :Namespace) - when captured - behaves like single capture - returns captured values if there is no block - yields captured value(s) and returns true if there is a block - when preceded by ... - is expected to match code s(:send, - s(:int, 1), :+, - s(:int, 10)) and s(:int, 10) - when inside an intersection - is expected to match code s(:int, 20), 10, and 20 - captures which also perform a match - on [] - behaves like single capture - yields captured value(s) and returns true if there is a block - returns captured values if there is no block - when nested - behaves like multiple capture - yields captured value(s) and returns true if there is a block - returns captured values if there is no block - on a sequence - behaves like single capture - returns captured values if there is no block - yields captured value(s) and returns true if there is a block - on a literal - behaves like single capture - returns captured values if there is no block - yields captured value(s) and returns true if there is a block - on a set - behaves like single capture - returns captured values if there is no block - yields captured value(s) and returns true if there is a block - on a node type - behaves like single capture - returns captured values if there is no block - yields captured value(s) and returns true if there is a block - regexp - matches symbols or strings - predicates - with multiple arguments - for which the predicate is true - is expected to match code s(:str, "c"), "a", and "d" - for which the predicate is false - behaves like nonmatching - doesn't match - when negated - is expected to match code s(:int, 1) and :inc - applied to an integer for which the predicate is true - is expected to match code s(:int, 1) and :inc - when captured - behaves like single capture - yields captured value(s) and returns true if there is a block - returns captured values if there is no block - at head position of a sequence - is expected to match code s(:int, 1) and :inc - with one extra argument - for which the predicate is true - is expected to match code s(:send, - s(:int, 1), :+, - s(:int, 2)) and 1 - for which the predicate is false - behaves like nonmatching - doesn't match - when in last-child position, but all children have already been matched - behaves like nonmatching - doesn't match - applied to an integer for which the predicate is false - behaves like nonmatching - doesn't match - in root position - is expected to match code s(:int, 1) and :inc - with name containing a numeral - is expected to match code s(:int, 1) and :inc - with a constant argument - for which the predicate is false - behaves like nonmatching - doesn't match - for which the predicate is true - is expected to match code s(:int, 1), :+, and s(:int, 2) - with a named argument - when not given - raises an error - with extra arguments - raises an error - for which the predicate is true - is expected to match code s(:send, - s(:int, 1), :+, - s(:int, 2)) and {:param=>1} - for which the predicate is false - behaves like nonmatching - doesn't match - with an expression argument - for which the predicate is true - is expected to match code s(:int, 2), :+, and s(:float, 2.0) - for which the predicate is false - behaves like nonmatching - doesn't match - bad syntax - with empty intersection - behaves like invalid - is invalid - with negated closing paren - behaves like invalid - is invalid - with empty union - behaves like invalid - is invalid - with unmatched opening paren and `...` - behaves like invalid - is invalid - with variadic unions where not supported - behaves like invalid - is invalid - with doubled comma in arg list - behaves like invalid - is invalid - with unmatched closing paren - behaves like invalid - is invalid - with negated closing curly - behaves like invalid - is invalid - with leading comma in arg list - behaves like invalid - is invalid - with doubled ellipsis - is expected to match code "foo" - with empty parentheses - behaves like invalid - is invalid - with unmatched opening curly - behaves like invalid - is invalid - with unmatched closing curly - behaves like invalid - is invalid - with unsupported subsequence in seq head within union - behaves like invalid - is invalid - with negated ellipsis - behaves like invalid - is invalid - with empty union subsequence in seq head - behaves like invalid - is invalid - with unmatched opening paren - behaves like invalid - is invalid - nil - nil value in AST, use nil? method - is expected to match code nil and :foo - nil literals - is expected to match code - nil value in AST - behaves like nonmatching - doesn't match - against a node pattern (bug #5470) - behaves like nonmatching - doesn't match - caret (ascend) - inside an intersection - is expected to match code 1 - inside a union - is expected to match code "abc" - using unification to match self within parent - with self in the right position - is expected to match code 2 - with self in the wrong position - behaves like nonmatching - doesn't match - within sequence - in head - is expected to match code 1 - of a sequence - is expected to match code 1 - not in head - is expected to match code s(:int, 1) and :inc - of a sequence - is expected to match code s(:int, 1) and :inc - repeated twice - is expected to match code 1 - used with a node type - which matches - is expected to match code 1 - which doesn't match - behaves like nonmatching - doesn't match - captures on a wildcard - in head position in a sequence against literal (bug #5470) - behaves like nonmatching - doesn't match - in head position in a sequence against nil (bug #5470) - behaves like nonmatching - doesn't match - in a nested sequence - behaves like single capture - returns captured values if there is no block - yields captured value(s) and returns true if there is a block - in non-head position in a sequence - behaves like single capture - returns captured values if there is no block - yields captured value(s) and returns true if there is a block - at the root level - behaves like single capture - returns captured values if there is no block - yields captured value(s) and returns true if there is a block - in head position in a sequence - behaves like single capture - yields captured value(s) and returns true if there is a block - returns captured values if there is no block - nested in any child - behaves like multiple capture - returns captured values if there is no block - yields captured value(s) and returns true if there is a block - negation - when nested in complex ways - with (send int :- int) - is expected to match code s(:int, 1), :-, and s(:int, 1) - with (send str :<< str) - behaves like nonmatching - doesn't match - with (send str :+ (send str :to_i)) - is expected to match code s(:str, "abc"), :+, and s(:send, - s(:str, "1"), :to_i) - on a sequence - with a matching node - behaves like nonmatching - doesn't match - with a node of different type - is expected to match code :@@a and s(:int, 1) - with a node with non-matching children - is expected to match code :@b and s(:int, 1) - on a set - with a matching value - behaves like nonmatching - doesn't match - with a non-matching value - is expected to match code :@a and s(:int, 3) - on square brackets - with a node which meets only 1 requirement of [] - is expected to match code 1 - with a node which meets all requirements of [] - behaves like nonmatching - doesn't match - on a string - with a matching string - behaves like nonmatching - doesn't match - with a non-matching symbol - is expected to match code s(:str, "bar") and :upcase - on a symbol - with a non-matching symbol, but too many children - behaves like nonmatching - doesn't match - with a non-matching symbol - is expected to match code s(:send, nil, :obj) and :xyz - with a matching symbol - behaves like nonmatching - doesn't match - repeated - using * - behaves like repeated pattern - with an ellipsis in the same sequence - is expected to match code "[:hello, 1, 2, 3]" - at beginning of sequence - behaves like invalid - is invalid - with one match - behaves like single capture - returns captured values if there is no block - yields captured value(s) and returns true if there is a block - with zero match - behaves like single capture - yields captured value(s) and returns true if there is a block - returns captured values if there is no block - with no match - behaves like nonmatching - doesn't match - with matching children - behaves like single capture - yields captured value(s) and returns true if there is a block - returns captured values if there is no block - with multiple subcaptures - behaves like multiple capture - returns captured values if there is no block - yields captured value(s) and returns true if there is a block - without capture - is expected to match code s(:sym, :hello), s(:int, 1), s(:int, 2), and s(:int, 3) - nested with multiple subcaptures - behaves like multiple capture - returns captured values if there is no block - yields captured value(s) and returns true if there is a block - using + - with matching children - behaves like single capture - returns captured values if there is no block - yields captured value(s) and returns true if there is a block - with zero match - behaves like nonmatching - doesn't match - behaves like repeated pattern - at beginning of sequence - behaves like invalid - is invalid - with an ellipsis in the same sequence - is expected to match code "[:hello, 1, 2, 3]" - with one match - behaves like single capture - returns captured values if there is no block - yields captured value(s) and returns true if there is a block - using ? - behaves like repeated pattern - with one match - behaves like single capture - yields captured value(s) and returns true if there is a block - returns captured values if there is no block - at beginning of sequence - behaves like invalid - is invalid - with an ellipsis in the same sequence - is expected to match code "[:hello, 1, 2, 3]" - with zero match - behaves like single capture - returns captured values if there is no block - yields captured value(s) and returns true if there is a block - with too many matching children - behaves like nonmatching - doesn't match - ellipsis - preceding a capture - behaves like single capture - yields captured value(s) and returns true if there is a block - returns captured values if there is no block - at the very beginning of a sequence - is expected to match code s(:int, 10), :*, and s(:int, 1) - with a set at the end, but no remaining child to match it - behaves like nonmatching - doesn't match - with a nodetype at the end, but no remaining child to match it - behaves like nonmatching - doesn't match - with a nested sequence at the end, but no remaining child - behaves like nonmatching - doesn't match - with [] at the end, but no remaining child to match it - behaves like nonmatching - doesn't match - with a wildcard at the end, but no remaining child to match it - behaves like nonmatching - doesn't match - preceding multiple captures - behaves like multiple capture - yields captured value(s) and returns true if there is a block - returns captured values if there is no block - descend - without match - behaves like nonmatching - doesn't match - with a literal match - is expected to match code s(:int, 1) and s(:array, - s(:array, - s(:int, 2), - s(:int, 3), - s(:array, - s(:array, - s(:int, 5)))), - s(:int, 4)) - with an immediate match - behaves like single capture - returns captured values if there is no block - yields captured value(s) and returns true if there is a block - with a match multiple levels, depth first - behaves like single capture - returns captured values if there is no block - yields captured value(s) and returns true if there is a block - nested - behaves like single capture - returns captured values if there is no block - yields captured value(s) and returns true if there is a block - captures within union - with a different number of captures in each branch - behaves like invalid - is invalid - with complex nesting - behaves like multiple capture - yields captured value(s) and returns true if there is a block - returns captured values if there is no block - on simple subpatterns - behaves like single capture - yields captured value(s) and returns true if there is a block - returns captured values if there is no block - within nested sequences - behaves like multiple capture - returns captured values if there is no block - yields captured value(s) and returns true if there is a block - commas - with commas randomly strewn around - behaves like invalid - is invalid - node type - for a child - on a child with the same type - is expected to match code s(:send, nil, :foo) and :bar - on a child with a different type - behaves like nonmatching - doesn't match - on a child litteral - behaves like nonmatching - doesn't match - in seq head - on a child with a different type - behaves like nonmatching - doesn't match - on a node with the same type - is expected to match code s(:ivar, :@ivar), :+, and s(:int, 2) - comments - behaves like single capture - returns captured values if there is no block - yields captured value(s) and returns true if there is a block - in any order - with a captured ellipsis - matching non sequential children - behaves like single capture - returns captured values if there is no block - yields captured value(s) and returns true if there is a block - matching all children - behaves like single capture - returns captured values if there is no block - yields captured value(s) and returns true if there is a block - nested - behaves like multiple capture - returns captured values if there is no block - yields captured value(s) and returns true if there is a block - with an ellipsis - behaves like single capture - yields captured value(s) and returns true if there is a block - returns captured values if there is no block - captured - without ellipsis - behaves like single capture - returns captured values if there is no block - yields captured value(s) and returns true if there is a block - without ellipsis - with matching children - behaves like multiple capture - returns captured values if there is no block - yields captured value(s) and returns true if there is a block - with too many children - behaves like nonmatching - doesn't match - with too few children - behaves like nonmatching - doesn't match - invalid - containing ellipsis not at the end - behaves like invalid - is invalid - doubled with ellipsis in wrong order - behaves like nonmatching - doesn't match - nested - behaves like invalid - is invalid - at the beginning of a sequence - behaves like invalid - is invalid - with an ellipsis inside and outside - behaves like multiple capture - returns captured values if there is no block - yields captured value(s) and returns true if there is a block - doubled with ellipsis - behaves like multiple capture - returns captured values if there is no block - yields captured value(s) and returns true if there is a block - doubled - separated by an ellipsis - behaves like multiple capture - yields captured value(s) and returns true if there is a block - returns captured values if there is no block - separated by fixed argument - behaves like multiple capture - yields captured value(s) and returns true if there is a block - returns captured values if there is no block - simple sequence - on a node with the same type and matching children - is expected to match code s(:int, 1), :+, and s(:int, 1) - on a node with a different type - behaves like nonmatching - doesn't match - on a node with too many children - behaves like nonmatching - doesn't match - with a nested sequence in head position - behaves like invalid - is invalid - on a node with the same type and non-matching children - with non-matching receiver type - behaves like nonmatching - doesn't match - with non-matching selector - behaves like nonmatching - doesn't match - with a nested sequence in non-head position - is expected to match code s(:send, - s(:send, nil, :obj), :a) and :b - bare node type - marshal compatibility - is expected to match code s(:send, nil, :obj) and :method - #dup - is expected to match code s(:send, nil, :obj) and :method - yaml compatibility - is expected to match code s(:send, nil, :obj) and :method - #pattern - returns the pattern - on a node with a matching, hyphenated type - is expected to match code s(:lvasgn, :a), :+, and s(:int, 1) - on a node with the same type - is expected to match code s(:send, nil, :obj) and :method - #to_s - is instructive - #== - returns true iff the patterns are similar - on a node with a different type - behaves like nonmatching - doesn't match - captures on ... - after a child - behaves like single capture - yields captured value(s) and returns true if there is a block - returns captured values if there is no block - with a remaining [] at the end - behaves like single capture - yields captured value(s) and returns true if there is a block - returns captured values if there is no block - with a remaining set at the end - behaves like single capture - yields captured value(s) and returns true if there is a block - returns captured values if there is no block - with a remaining literal at the end - behaves like single capture - returns captured values if there is no block - yields captured value(s) and returns true if there is a block - with a remaining sequence at the end - behaves like single capture - yields captured value(s) and returns true if there is a block - returns captured values if there is no block - with a remaining capture at the end - behaves like multiple capture - returns captured values if there is no block - yields captured value(s) and returns true if there is a block - with a remaining wildcard at the end - behaves like single capture - yields captured value(s) and returns true if there is a block - returns captured values if there is no block - with a remaining node type at the end - behaves like single capture - yields captured value(s) and returns true if there is a block - returns captured values if there is no block - at the very beginning of a sequence - behaves like single capture - returns captured values if there is no block - yields captured value(s) and returns true if there is a block - with no remaining pattern at the end - behaves like single capture - yields captured value(s) and returns true if there is a block - returns captured values if there is no block - with remaining patterns at the end - behaves like single capture - yields captured value(s) and returns true if there is a block - returns captured values if there is no block - -RuboCop::AST::Procarg0Node - #name - is expected to eq :x - .new - with a block - is expected to be a kind of RuboCop::AST::ArgNode + is expected to eq s(:send, nil, :value) + with a `ivasgn` node + is expected to eq s(:send, nil, :value) + with a `cvasgn` node + is expected to eq s(:send, nil, :value) + with a `gvasgn` node + is expected to eq s(:send, nil, :value) RuboCop::AST::ResbodyNode #branch_index - is expected to eq 1 - is expected to eq 0 is expected to eq 2 + is expected to eq 0 + is expected to eq 1 #exception_variable for an explicit rescue is expected to eq "ex" - for an implicit rescue - is expected to eq "ex" when an exception variable is not given is expected to be nil + for an implicit rescue + is expected to eq "ex" + #body + is expected to be sym type + .new + is expected to be a kind of RuboCop::AST::ResbodyNode #exceptions - with multiple exceptions - is expected to eq 2 - is expected to all be const type + without exception + is expected to eq 0 with a single exception is expected to eq 1 is expected to all be const type - without exception - is expected to eq 0 + with multiple exceptions + is expected to eq 2 + is expected to all be const type + +RuboCop::AST::NodePattern::Parser + sequences + expands ... in sequence head deep inside unions + parses simple sequences properly + parses capture vs repetition with correct priority + parses function calls + parses unions of literals as a set + generates specialized nodes + +RuboCop::AST::HashNode + #pairs + with an empty hash + is expected to be empty + with a hash of literals + is expected to all be pair type + is expected to eq 3 + with a hash of variables + is expected to eq 2 + is expected to all be pair type + #pairs_on_same_line? + with no pairs on the same line + is expected not to be pairs on same line + with some pairs on the same line + is expected to be pairs on same line + with all pairs on the same line + is expected to be pairs on same line + #each_pair + when passed a block + yields all the pairs + when not passed a block + is expected to be a kind of Enumerator + #braces? + with braces + is expected to be braces + as an argument with braces + is expected to be braces + as an argument with no braces + is expected not to be braces + #each_value + when not passed a block + is expected to be a kind of Enumerator + when passed a block + yields all the pairs + #values + with a hash with string keys + is expected to all be send type + is expected to eq 2 + with an empty hash + is expected to be empty + with a hash with literal values + is expected to eq 3 + is expected to all be literal + #each_key + when not passed a block + is expected to be a kind of Enumerator + when passed a block + yields all the pairs + #keys + with a hash with symbol keys + is expected to eq 3 + is expected to all be sym type + with an empty hash + is expected to be empty + with a hash with string keys + is expected to eq 2 + is expected to all be str type .new - is expected to be a kind of RuboCop::AST::ResbodyNode - #body - is expected to be sym type + is expected to be a kind of RuboCop::AST::HashNode + #mixed_delimiters? + when all pairs are using a colon delimiter + is expected not to be mixed delimiters + when pairs are using different delimiters + is expected to be mixed delimiters + when all pairs are using a hash rocket delimiter + is expected not to be mixed delimiters + #empty? + with a hash containing pairs + is expected not to be empty + with an empty hash + is expected to be empty + with a hash containing a keyword splat + is expected not to be empty -RuboCop::AST::NodePattern::Sets - is expected to eq "::RuboCop::AST::NodePattern::Sets::SET_1_2_3_ETC" - is expected to eq "::RuboCop::AST::NodePattern::Sets::SET_1_2_3_ETC" - creates a constant with the right value - is expected not to eq "::RuboCop::AST::NodePattern::Sets::SET_1_2_3_ETC_2" +RuboCop::AST::ArgNode + .new + with a lambda literal + is expected to be a kind of RuboCop::AST::ArgNode + with an optional keyword argument + is expected to be a kind of RuboCop::AST::ArgNode + with an optional argument + is expected to be a kind of RuboCop::AST::ArgNode + with argument forwarding + with Ruby >= 2.7 + is expected to be a kind of RuboCop::AST::ArgNode + with Ruby >= 3.0 + is expected to be a kind of RuboCop::AST::ArgNode + with a keyword argument + is expected to be a kind of RuboCop::AST::ArgNode + with a block argument + is expected to be a kind of RuboCop::AST::ArgNode + with a block + is expected to be a kind of RuboCop::AST::ArgNode + with a method definition + is expected to be a kind of RuboCop::AST::ArgNode + with a splatted argument + is expected to be a kind of RuboCop::AST::ArgNode + with a shadow argument + is expected to be a kind of RuboCop::AST::ArgNode + with a double splatted argument + is expected to be a kind of RuboCop::AST::ArgNode + #default_value + with an optional keyword argument + is expected to eq s(:int, 42) + with a regular argument + is expected to be nil + with a block + is expected to be nil + with a block argument + is expected to be nil + with a double splatted argument + is expected to be nil + with argument forwarding + with Ruby >= 3.0 + is expected to be nil + with Ruby >= 2.7 + is expected to be nil + with a splatted argument + is expected to be nil + with a shadow argument + is expected to be nil + with an optional argument + is expected to eq s(:int, 42) + #default? + with a shadow argument + is expected to equal false + with an optional argument + is expected to equal true + with an optional keyword argument + is expected to equal true + with a double splatted argument + is expected to equal false + with a regular argument + is expected to equal false + with a block + is expected to equal false + with argument forwarding + with Ruby >= 3.0 + is expected to equal false + with Ruby >= 2.7 + is expected to equal false + with a block argument + is expected to equal false + with a splatted argument + is expected to equal false + #name + with a regular argument + is expected to eq :x + with an optional argument + is expected to eq :x + with a nameless splatted argument + is expected to be nil + with a nameless double splatted argument + is expected to be nil + with a splatted argument + is expected to eq :x + with a double splatted argument + is expected to eq :x + with a block argument + is expected to eq :x + with an optional keyword argument + is expected to eq :x + with a block + is expected to eq :x + with argument forwarding + with Ruby >= 2.7 + is expected to be nil + with Ruby >= 3.0 + is expected to be nil + with a shadow argument + is expected to eq :x + with a keyword argument + is expected to eq :x -RuboCop::AST::BreakNode - behaves like wrapped arguments node - .new - with arguments - is expected to be a kind of RuboCop::AST::BreakNode - without arguments - is expected to be a kind of RuboCop::AST::BreakNode - #arguments - with a single argument - is expected to eq 1 - with a single splat argument - is expected to eq 1 - with no arguments - is expected to be empty - with no arguments and braces - is expected to be empty - with multiple literal arguments - is expected to eq 2 - with a single argument and braces - is expected to eq 1 +RuboCop::AST::OrAsgnNode + #operator + is expected to eq :"||" + .new + is expected to be a kind of RuboCop::AST::OrAsgnNode + #assignment_node + is expected to be a kind of RuboCop::AST::AsgnNode + #name + is expected to eq :var + #expression + is expected to eq s(:send, nil, :value) -RuboCop::AST::OrNode - #inverse_operator - with a semantic or node - is expected to eq "and" - with a logical or node - is expected to eq "&&" +RuboCop::AST::KeywordSplatNode + #hash_rocket? + is expected not to be hash rocket #operator - with a logical or node - is expected to eq "||" - with a semantic or node - is expected to eq "or" - #logical_operator? - with a semantic or node - is expected not to be logical operator - with a logical or node - is expected to be logical operator - #semantic_operator? - with a semantic or node - is expected to be semantic operator - with a logical or node - is expected not to be semantic operator - #rhs - with a logical or node - is expected to be int type - with a semantic or node - is expected to be int type - #lhs - with a logical or node - is expected to be sym type - with a semantic or node - is expected to be sym type + is expected to eq "**" + #same_line? + when both pairs are on the same line + is expected to be same line s(:kwsplat, + s(:send, nil, :foo)) + when a multiline pair shares the same line + is expected to be same line s(:kwsplat, + s(:send, nil, :foo)) + is expected to be same line s(:pair, + s(:sym, :a), + s(:begin)) + when pairs are on separate lines + is expected not to be same line s(:kwsplat, + s(:send, nil, :foo)) + #key + is expected to eq s(:kwsplat, + s(:send, nil, :foo)) + #key_delta + with alignment set to :right + when using colon delimiters + when keyword splat is aligned + is expected to eq 0 + when keyword splat is ahead + is expected to eq 0 + when keyword splat is behind + is expected to eq 0 + when keyword splat is on the same line + is expected to eq 0 + when using hash rocket delimiters + when keyword splat is on the same line + is expected to eq 0 + when keyword splat is aligned + is expected to eq 0 + when keyword splat is behind + is expected to eq 0 + when keyword splat is ahead + is expected to eq 0 + with alignment set to :left + when using hash rocket delimiters + when keyword splat is aligned + is expected to eq 0 + when keyword splat is ahead + is expected to eq 2 + when keyword splat is behind + is expected to eq -2 + when keyword splat is on the same line + is expected to eq 0 + when using colon delimiters + when keyword splat is on the same line + is expected to eq 0 + when keyword splat is ahead + is expected to eq 2 + when keyword splat is aligned + is expected to eq 0 + when keyword splat is behind + is expected to eq -2 + #colon? + is expected not to be colon + #value + is expected to eq s(:kwsplat, + s(:send, nil, :foo)) .new - with a logical or node - is expected to be a kind of RuboCop::AST::OrNode - with a semantic or node - is expected to be a kind of RuboCop::AST::OrNode - #alternate_operator - with a semantic or node - is expected to eq "||" - with a logical or node - is expected to eq "or" + is expected to be a kind of RuboCop::AST::KeywordSplatNode + #value_delta + when using colon delimiters + when keyword splat is on the same line + is expected to eq 0 + when keyword splat is left aligned + is expected to eq 0 + when keyword splat is behind + is expected to eq 0 + when keyword splat is ahead + is expected to eq 0 + when using hash rocket delimiters + when keyword splat is ahead + is expected to eq 0 + when keyword splat is behind + is expected to eq 0 + when keyword splat is on the same line + is expected to eq 0 + when keyword splat is left aligned + is expected to eq 0 + +RuboCop::AST::ModuleNode + .new + is expected to be a kind of RuboCop::AST::ModuleNode + #identifier + is expected to be const type + #body + with a multi-expression body + is expected to be begin type + with a single expression body + is expected to be send type + with an empty body + is expected to be nil + +RuboCop::AST::ArgsNode + #empty_and_without_delimiters? + with empty arguments + with a lambda literal + is expected to equal true + with a block + is expected to equal true + with a method definition + is expected to equal true + with delimiters + with a block + is expected to equal false + with a method definition + is expected to equal false + with a lambda literal + is expected to equal false + with arguments + with a method definition + is expected to equal false + with a lambda literal + is expected to equal false + .new + with a method definition + is expected to be a kind of RuboCop::AST::ArgsNode + with a block + is expected to be a kind of RuboCop::AST::ArgsNode + with a lambda literal + is expected to be a kind of RuboCop::AST::ArgsNode + #argument_list + is expected to eq [s(:arg, :a), s(:optarg, :b, + s(:int, 42)), s(:arg, :c), s(:restarg, :d), s(:kwarg, :e), s(:kwoptarg, :f, + s(:int, 42)), s(:kwrestarg, :g), s(:blockarg, :h), s(:shadowarg, :i)] + when using Ruby 2.7 or newer + with argument forwarding + is expected to eq [s(:forward_arg)] + +RuboCop::AST::DefinedNode + #receiver + is expected to be nil + #arguments + is expected to all be sym type + is expected to eq 1 + .new + with a defined? node + is expected to be a kind of RuboCop::AST::DefinedNode + #method_name + is expected to eq :defined? + +RuboCop::AST::DefNode + #void_context? + with a regular method + is expected not to be void context + with a comparison method + is expected not to be void context + with a bracket assignment method + is expected to be void context + with a regular assignment method + is expected to be void context + with an initializer method + is expected to be void context + #operator_method? + with a unary operator method + is expected to be operator method + with a regular method + is expected not to be operator method + with a binary operator method + is expected to be operator method + with a setter method + is expected not to be operator method + #rest_argument? + with mixed arguments + is expected to be rest argument + with regular arguments + is expected not to be rest argument + with no arguments + is expected not to be rest argument + with a rest argument + is expected to be rest argument + #receiver + with a singleton method definition + is expected to be const type + with a class method definition + is expected to be self type + with an instance method definition + is expected to be nil + #arguments? + with a single rest argument + is expected to be arguments + with a single keyword argument + is expected to be arguments + with multiple regular arguments + is expected to be arguments + with multiple mixed arguments + is expected to be arguments + with a single regular argument + is expected to be arguments + with no arguments + is expected not to be arguments + #bang_method? + with a regular method + is expected not to be bang method + with a predicate method + is expected not to be bang method + with a bang method + is expected to be bang method + #predicate_method? + with a regular method + is expected not to be predicate method + with a predicate method + is expected to be predicate method + with a bang method + is expected not to be predicate method + #assignment_method? + with a bracket assignment method + is expected to be assignment method + with a regular method + is expected not to be assignment method + with an assignment method + is expected to be assignment method + with a comparison method + is expected not to be assignment method + #block_argument? + with mixed arguments + is expected to be block argument + with a block argument + is expected to be block argument + with no arguments + is expected not to be block argument + with regular arguments + is expected not to be block argument + .new + with a def node + is expected to be a kind of RuboCop::AST::DefNode + with a defs node + is expected to be a kind of RuboCop::AST::DefNode + #last_argument + with multiple regular arguments + is expected to be arg type + with a single keyword argument + is expected to be kwoptarg type + with multiple mixed arguments + is expected to be restarg type + with a single regular argument + is expected to be arg type + with no arguments + is expected to be nil + with a single rest argument + is expected to be restarg type + #camel_case_method? + with a regular method + is expected not to be camel case method + with a camel case method + is expected to be camel case method + #first_argument + with multiple regular arguments + is expected to be arg type + with no arguments + is expected to be nil + with a single rest argument + is expected to be restarg type + with multiple mixed arguments + is expected to be arg type + with a single regular argument + is expected to be arg type + with a single keyword argument + is expected to be kwoptarg type + #endless? + with standard method definition + is expected not to be endless + with endless method definition + is expected to be endless + #body + with no body + is expected to be nil + with a single expression body + is expected to be send type + with a multi-expression body + is expected to be begin type + #const_receiver? + with a singleton method definition + is expected to be const receiver + with an instance method definition + is expected not to be const receiver + with a class method definition + is expected not to be const receiver + when using Ruby 2.7 or newer + #argument_forwarding? + is expected to be argument forwarding + #method_name + with a unary method + is expected to eq :-@ + with a plain method + is expected to eq :foo + with an operator method + is expected to eq :== + with a setter method + is expected to eq :foo= + #method? + when message does not match + when argument is a symbol + is expected not to be method :foo + when argument is a string + is expected not to be method "foo" + when message matches + when argument is a symbol + is expected to be method :bar + when argument is a string + is expected to be method "bar" + #arguments + with argument forwarding + is expected to eq 1 + with multiple mixed arguments + is expected to eq 2 + with multiple regular arguments + is expected to eq 2 + with no arguments + is expected to be empty + with a single rest argument + is expected to eq 1 + with a single regular argument + is expected to eq 1 + #comparison_method? + with a comparison method + is expected to be comparison method + with a regular method + is expected not to be comparison method + #self_receiver? + with a singleton method definition + is expected not to be self receiver + with an instance method definition + is expected not to be self receiver + with a class method definition + is expected to be self receiver + +RuboCop::AST::ClassNode + .new + is expected to be a kind of RuboCop::AST::ClassNode + #parent_class + when a parent class is specified + is expected to be const type + when no parent class is specified + is expected to be nil + #identifier + is expected to be const type + #body + with an empty body + is expected to be nil + with a multi-expression body + is expected to be begin type + with a single expression body + is expected to be send type + +RuboCop::AST::Token + #begin_pos + returns index of first char in token range of entire source + #line + returns line of token + #column + returns index of first char in token range on that line + #space_after + returns nil when there is not a space after token + returns truthy MatchData when there is a space after token + type predicates + #left_bracket? + returns true for all left_bracket tokens + returns false for non left_bracket tokens + #left_brace? + returns false for non right_bracket tokens + returns true for right_bracket tokens + #comment? + returns true for comment tokens + returns false for non comment tokens + #semicolon? + returns false for non semicolon tokens + returns true for semicolon tokens + #left_ref_bracket? + returns false for non left_ref_bracket tokens + returns true for left_ref_bracket tokens + #rescue_modifier? + returns false for non rescue modifier tokens + returns true for rescue modifier tokens + #end? + returns true for end tokens + returns false for non end tokens + #dot? + returns false for non dot tokens + returns true for dot tokens + #left_array_bracket? + returns true for left_array_bracket tokens + returns false for non left_array_bracket tokens + #equals_sign? + returns true for equals sign tokens + returns false for non equals sign tokens + #regexp_dots? + returns false for non comma tokens + returns true for regexp tokens + #new_line? + returns false for non new line tokens + returns true for new line tokens + #comma? + returns false for non comma tokens + returns true for comma tokens + with braces & parens + #left_parens? + returns true for left parens tokens + returns false for non left parens tokens + #left_brace? + returns false for non left hash brace tokens + returns true for left hash brace tokens + #right_curly_brace? + returns true for all right brace tokens + returns false for non right brace tokens + #left_curly_brace? + returns true for left block brace tokens + returns false for non left block brace tokens + #right_parens? + returns false for non right parens tokens + returns true for right parens tokens + #right_bracket? + returns true for all right_bracket tokens + returns false for non right_bracket tokens + .from_parser_token + sets parser token's text to rubocop token's text + sets parser token's type to rubocop token's type + sets parser token's range to rubocop token's pos + returns a #to_s useful for debugging + #to_s + returns string of token data + #space_before + returns nil when there is not a space before token + returns truthy MatchData when there is a space before token + returns nil when it is on the first line + #end_pos + returns index of last char in token range of entire source -Finished in 7.92 seconds (files took 2.96 seconds to load) +Finished in 10.82 seconds (files took 4 seconds to load) 2392 examples, 0 failures -Randomized with seed 34265 +Randomized with seed 49970 ┌──────────────────────────────────────────────────────────────────────────────┐ @@ -6612,12 +6655,14 @@ dpkg-buildpackage: info: binary-only upload (no source included) dpkg-genchanges: info: not including original source code in upload I: copying local configuration +I: user script /srv/workspace/pbuilder/27715/tmp/hooks/B01_cleanup starting +I: user script /srv/workspace/pbuilder/27715/tmp/hooks/B01_cleanup finished I: unmounting dev/ptmx filesystem I: unmounting dev/pts filesystem I: unmounting dev/shm filesystem I: unmounting proc filesystem I: unmounting sys filesystem I: cleaning the build env -I: removing directory /srv/workspace/pbuilder/8631 and its subdirectories -I: Current time: Thu May 4 19:14:37 -12 2023 -I: pbuilder-time-stamp: 1683270877 +I: removing directory /srv/workspace/pbuilder/27715 and its subdirectories +I: Current time: Fri May 5 21:19:10 +14 2023 +I: pbuilder-time-stamp: 1683271151