121 | | '''The results (patch.list):''' |
| 121 | ''' Some contrived tests:''' |
| 122 | |
| 123 | {{{ |
| 124 | cat TEST_FILES_ORG/contrived_tests.F90 |
| 125 | un(:,:,:) ! The simplest test. Should ==> uu(:,:,:,jtn) |
| 126 | pun(:,:,:) ! target preceded by non-whitespace or operator. Should be unchanged |
| 127 | sbc_fwb(:,:,:) ! target preceded by non-whitespace or operator. Should be unchanged |
| 128 | un ( ji , jj, : ) ! Check alternative simple case ==> uu ( ji , jj, :,jtn) |
| 129 | a+ub(:,:,jk) ! Check preceeding operators are correctly recognised |
| 130 | a-vb(:,:,jk) ! Check preceeding operators are correctly recognised |
| 131 | a*vn(:,:,jk) ! Check preceeding operators are correctly recognised |
| 132 | a/wb(:,:,jk) ! Check preceeding operators are correctly recognised |
| 133 | a%wn(:,:,jk) ! Check preceeding operators are correctly recognised |
| 134 | .OR.wn(:,:,jk) ! Check preceeding operators are correctly recognised |
| 135 | (wn(:,:,jk) + wn(:,:,jk-1)) ! Check preceeding brackets are correctly recognised |
| 136 | un ( ji+1 , & ! Check entries over multiple lines ae handled |
| 137 | & jj, jk - 1 ) ! Check entries over multiple lines ae handled |
| 138 | un( mi0(ii) , mj0(jj )) ! Brackets within arguments will break [ does this occur?] |
| 139 | }}} |
| 140 | |
| 141 | '''Result of the script on the contrived tests:''' |
| 142 | |
| 143 | {{{ |
| 144 | cat TEST_FILES/contrived_tests.F90 |
| 145 | uu(:,:,:,jtn) ! The simplest test. Should ==> uu(:,:,:,jtn) |
| 146 | pun(:,:,:) ! target preceded by non-whitespace or operator. Should be unchanged |
| 147 | sbc_fwb(:,:,:) ! target preceded by non-whitespace or operator. Should be unchanged |
| 148 | uu( ji , jj, : ,jtn) ! Check alternative simple case ==> uu ( ji , jj, :,jtn) |
| 149 | a+uu(:,:,jk,jtb) ! Check preceeding operators are correctly recognised |
| 150 | a-vv(:,:,jk,jtb) ! Check preceeding operators are correctly recognised |
| 151 | a*vv(:,:,jk,jtn) ! Check preceeding operators are correctly recognised |
| 152 | a/ww(:,:,jk,jtb) ! Check preceeding operators are correctly recognised |
| 153 | a%ww(:,:,jk,jtn) ! Check preceeding operators are correctly recognised |
| 154 | .OR.ww(:,:,jk,jtn) ! Check preceeding operators are correctly recognised |
| 155 | (ww(:,:,jk,jtn) + ww(:,:,jk-1,jtn)) ! Check preceeding brackets are correctly recognised |
| 156 | uu( ji+1 , & ! Check entries over multiple lines ae handled |
| 157 | & jj, jk - 1 ,jtn) ! Check entries over multiple lines ae handled |
| 158 | uu( mi0(ii,jtn) , mj0(jj )) ! Brackets within arguments will break [ does this occur?] |
| 159 | }}} |
| 160 | |
| 161 | {{{#!diff |
| 162 | Index: TEST_FILES/contrived_tests.F90 |
| 163 | ============================== |
| 164 | --- TEST_FILES_ORG/contrived_tests.F90 2019-02-08 14:21:07.000000000 +0000 |
| 165 | +++ TEST_FILES/contrived_tests.F90 2019-02-08 14:39:25.000000000 +0000 |
| 166 | @@ -1,14 +1,14 @@ |
| 167 | - un(:,:,:) ! The simplest test. Should ==> uu(:,:,:,jtn) |
| 168 | + uu(:,:,:,jtn) ! The simplest test. Should ==> uu(:,:,:,jtn) |
| 169 | pun(:,:,:) ! target preceded by non-whitespace or operator. Should be unchanged |
| 170 | sbc_fwb(:,:,:) ! target preceded by non-whitespace or operator. Should be unchanged |
| 171 | - un ( ji , jj, : ) ! Check alternative simple case ==> uu ( ji , jj, :,jtn) |
| 172 | - a+ub(:,:,jk) ! Check preceeding operators are correctly recognised |
| 173 | - a-vb(:,:,jk) ! Check preceeding operators are correctly recognised |
| 174 | - a*vn(:,:,jk) ! Check preceeding operators are correctly recognised |
| 175 | - a/wb(:,:,jk) ! Check preceeding operators are correctly recognised |
| 176 | - a%wn(:,:,jk) ! Check preceeding operators are correctly recognised |
| 177 | - .OR.wn(:,:,jk) ! Check preceeding operators are correctly recognised |
| 178 | - (wn(:,:,jk) + wn(:,:,jk-1)) ! Check preceeding brackets are correctly recognised |
| 179 | - un ( ji+1 , & ! Check entries over multiple lines ae handled |
| 180 | - & jj, jk - 1 ) ! Check entries over multiple lines ae handled |
| 181 | - un( mi0(ii) , mj0(jj )) ! Brackets within arguments will break [ does this occur?] |
| 182 | + uu( ji , jj, : ,jtn) ! Check alternative simple case ==> uu ( ji , jj, :,jtn) |
| 183 | + a+uu(:,:,jk,jtb) ! Check preceeding operators are correctly recognised |
| 184 | + a-vv(:,:,jk,jtb) ! Check preceeding operators are correctly recognised |
| 185 | + a*vv(:,:,jk,jtn) ! Check preceeding operators are correctly recognised |
| 186 | + a/ww(:,:,jk,jtb) ! Check preceeding operators are correctly recognised |
| 187 | + a%ww(:,:,jk,jtn) ! Check preceeding operators are correctly recognised |
| 188 | + .OR.ww(:,:,jk,jtn) ! Check preceeding operators are correctly recognised |
| 189 | + (ww(:,:,jk,jtn) + ww(:,:,jk-1,jtn)) ! Check preceeding brackets are correctly recognised |
| 190 | + uu( ji+1 , & ! Check entries over multiple lines ae handled |
| 191 | + & jj, jk - 1 ,jtn) ! Check entries over multiple lines ae handled |
| 192 | + uu( mi0(ii,jtn) , mj0(jj )) ! Brackets within arguments will break [ does this occur?] |
| 193 | }}} |
| 194 | |
| 195 | So all changes were made correctly (apart from the last which was expected). Also those entries which were potential pitfalls (pun and abc_fwb) were correctly ignored. Time to try a real set: |
| 196 | |
| 197 | '''The results on the sample set of files (patch.list):''' |