Explorar el Código

Add more tests to cover diff of diff

Matthew Wang hace 9 años
padre
commit
7e4821ae77

+ 37
- 0
tests/diff-of-diff/in.diff Ver fichero

@@ -0,0 +1,37 @@
1
+Index: patch-Alias.xs
2
+===================================================================
3
+--- patch-Alias.xs	(revision 384635)
4
++++ patch-Alias.xs	(revision 384636)
5
+@@ -140,17 +140,21 @@
6
+  	tmp = kLISTOP->op_first;
7
+  	if (inside)
8
+  		op_null(tmp);
9
+-@@ -2001,6 +2035,9 @@ STATIC OP *da_ck_entersub(pTHX_ OP *o) {
10
++@@ -2001,6 +2035,13 @@ STATIC OP *da_ck_entersub(pTHX_ OP *o) {
11
+  	while (kid->op_sibling != last)
12
+  		kid = kid->op_sibling;
13
+  	kid->op_sibling = Nullop;
14
+ +#ifdef op_sibling_splice
15
+++#if (PERL_COMBI_VERSION >= 5021011)
16
+++	kid->op_moresib = 0;
17
+++#else
18
+ +	kid->op_lastsib = 1;
19
+ +#endif
20
+++#endif
21
+  	cLISTOPx(cUNOPo->op_first)->op_last = kid;
22
+  	if (kid->op_type == OP_NULL && inside)
23
+  		kid->op_flags &= ~OPf_SPECIAL;
24
+-@@ -2008,6 +2045,14 @@ STATIC OP *da_ck_entersub(pTHX_ OP *o) {
25
++@@ -2008,6 +2049,14 @@ STATIC OP *da_ck_entersub(pTHX_ OP *o) {
26
+  	return o;
27
+  }
28
+  
29
+@@ -165,7 +169,7 @@
30
+  
31
+  MODULE = Data::Alias  PACKAGE = Data::Alias
32
+  
33
+-@@ -2025,6 +2070,10 @@ BOOT:
34
++@@ -2025,6 +2074,10 @@ BOOT:
35
+  		PL_check[OP_RV2CV] = da_ck_rv2cv;
36
+  		da_old_ck_entersub = PL_check[OP_ENTERSUB];
37
+  		PL_check[OP_ENTERSUB] = da_ck_entersub;

+ 38
- 0
tests/diff-of-diff/out.normal Ver fichero

@@ -0,0 +1,38 @@
1
+Index: patch-Alias.xs
2
+===================================================================
3
+--- patch-Alias.xs	(revision 384635)
4
++++ patch-Alias.xs	(revision 384636)
5
+@@ -140,17 +140,21 @@
6
+  	tmp = kLISTOP->op_first;
7
+  	if (inside)
8
+  		op_null(tmp);
9
+-@@ -2001,6 +2035,9 @@ STATIC OP *da_ck_entersub(pTHX_ OP *o) {
10
++@@ -2001,6 +2035,13 @@ STATIC OP *da_ck_entersub(pTHX_ OP *o) {
11
+  	while (kid->op_sibling != last)
12
+  		kid = kid->op_sibling;
13
+  	kid->op_sibling = Nullop;
14
+ +#ifdef op_sibling_splice
15
+++#if (PERL_COMBI_VERSION >= 5021011)
16
+++	kid->op_moresib = 0;
17
+++#else
18
+ +	kid->op_lastsib = 1;
19
+++#endif
20
+ +#endif
21
+  	cLISTOPx(cUNOPo->op_first)->op_last = kid;
22
+  	if (kid->op_type == OP_NULL && inside)
23
+  		kid->op_flags &= ~OPf_SPECIAL;
24
+-@@ -2008,6 +2045,14 @@ STATIC OP *da_ck_entersub(pTHX_ OP *o) {
25
++@@ -2008,6 +2049,14 @@ STATIC OP *da_ck_entersub(pTHX_ OP *o) {
26
+  	return o;
27
+  }
28
+  
29
+@@ -165,7 +169,7 @@
30
+  
31
+  MODULE = Data::Alias  PACKAGE = Data::Alias
32
+  
33
+-@@ -2025,6 +2070,10 @@ BOOT:
34
++@@ -2025,6 +2074,10 @@ BOOT:
35
+  		PL_check[OP_RV2CV] = da_ck_rv2cv;
36
+  		da_old_ck_entersub = PL_check[OP_ENTERSUB];
37
+  		PL_check[OP_ENTERSUB] = da_ck_entersub;
38
+

+ 34
- 0
tests/diff-of-diff/out.side-by-side Ver fichero

@@ -0,0 +1,34 @@
1
+Index: patch-Alias.xs
2
+===================================================================
3
+--- patch-Alias.xs	(revision 384635)
4
++++ patch-Alias.xs	(revision 384636)
5
+@@ -140,17 +140,21 @@
6
+140          tmp = kLISTOP->op_first;                                                140          tmp = kLISTOP->op_first;
7
+141          if (inside)                                                             141          if (inside)
8
+142                  op_null(tmp);                                                   142                  op_null(tmp);
9
+143 @@ -2001,6 +2035,9 @@ STATIC OP *da_ck_entersub(pTHX_ OP *o) {                   143 @@ -2001,6 +2035,13 @@ STATIC OP *da_ck_entersub(pTHX_ OP *o) {
10
+144          while (kid->op_sibling != last)                                         144          while (kid->op_sibling != last)
11
+145                  kid = kid->op_sibling;                                          145                  kid = kid->op_sibling;
12
+146          kid->op_sibling = Nullop;                                               146          kid->op_sibling = Nullop;
13
+147 +#ifdef op_sibling_splice                                                        147 +#ifdef op_sibling_splice
14
+                                                                                     148 +#if (PERL_COMBI_VERSION >= 5021011)
15
+                                                                                     149 +        kid->op_moresib = 0;
16
+                                                                                     150 +#else
17
+148 +        kid->op_lastsib = 1;                                                    151 +        kid->op_lastsib = 1;
18
+                                                                                     152 +#endif
19
+149 +#endif                                                                          153 +#endif
20
+150          cLISTOPx(cUNOPo->op_first)->op_last = kid;                              154          cLISTOPx(cUNOPo->op_first)->op_last = kid;
21
+151          if (kid->op_type == OP_NULL && inside)                                  155          if (kid->op_type == OP_NULL && inside)
22
+152                  kid->op_flags &= ~OPf_SPECIAL;                                  156                  kid->op_flags &= ~OPf_SPECIAL;
23
+153 @@ -2008,6 +2045,14 @@ STATIC OP *da_ck_entersub(pTHX_ OP *o) {                  157 @@ -2008,6 +2049,14 @@ STATIC OP *da_ck_entersub(pTHX_ OP *o) {
24
+154          return o;                                                               158          return o;
25
+155  }                                                                               159  }
26
+156                                                                                  160  
27
+@@ -165,7 +169,7 @@
28
+165                                                                                  169  
29
+166  MODULE = Data::Alias  PACKAGE = Data::Alias                                     170  MODULE = Data::Alias  PACKAGE = Data::Alias
30
+167                                                                                  171  
31
+168 @@ -2025,6 +2070,10 @@ BOOT:                                                     172 @@ -2025,6 +2074,10 @@ BOOT:
32
+169                  PL_check[OP_RV2CV] = da_ck_rv2cv;                               173                  PL_check[OP_RV2CV] = da_ck_rv2cv;
33
+170                  da_old_ck_entersub = PL_check[OP_ENTERSUB];                     174                  da_old_ck_entersub = PL_check[OP_ENTERSUB];
34
+171                  PL_check[OP_ENTERSUB] = da_ck_entersub;                         175                  PL_check[OP_ENTERSUB] = da_ck_entersub;

+ 34
- 0
tests/diff-of-diff/out.w70 Ver fichero

@@ -0,0 +1,34 @@
1
+Index: patch-Alias.xs
2
+===================================================================
3
+--- patch-Alias.xs	(revision 384635)
4
++++ patch-Alias.xs	(revision 384636)
5
+@@ -140,17 +140,21 @@
6
+140          tmp = kLISTOP->op_first;                                      140          tmp = kLISTOP->op_first;
7
+141          if (inside)                                                   141          if (inside)
8
+142                  op_null(tmp);                                         142                  op_null(tmp);
9
+143 @@ -2001,6 +2035,9 @@ STATIC OP *da_ck_entersub(pTHX_ OP *o) {         143 @@ -2001,6 +2035,13 @@ STATIC OP *da_ck_entersub(pTHX_ OP *o) {
10
+144          while (kid->op_sibling != last)                               144          while (kid->op_sibling != last)
11
+145                  kid = kid->op_sibling;                                145                  kid = kid->op_sibling;
12
+146          kid->op_sibling = Nullop;                                     146          kid->op_sibling = Nullop;
13
+147 +#ifdef op_sibling_splice                                              147 +#ifdef op_sibling_splice
14
+                                                                           148 +#if (PERL_COMBI_VERSION >= 5021011)
15
+                                                                           149 +        kid->op_moresib = 0;
16
+                                                                           150 +#else
17
+148 +        kid->op_lastsib = 1;                                          151 +        kid->op_lastsib = 1;
18
+                                                                           152 +#endif
19
+149 +#endif                                                                153 +#endif
20
+150          cLISTOPx(cUNOPo->op_first)->op_last = kid;                    154          cLISTOPx(cUNOPo->op_first)->op_last = kid;
21
+151          if (kid->op_type == OP_NULL && inside)                        155          if (kid->op_type == OP_NULL && inside)
22
+152                  kid->op_flags &= ~OPf_SPECIAL;                        156                  kid->op_flags &= ~OPf_SPECIAL;
23
+153 @@ -2008,6 +2045,14 @@ STATIC OP *da_ck_entersub(pTHX_ OP *o) {        157 @@ -2008,6 +2049,14 @@ STATIC OP *da_ck_entersub(pTHX_ OP *o) {
24
+154          return o;                                                     158          return o;
25
+155  }                                                                     159  }
26
+156                                                                        160  
27
+@@ -165,7 +169,7 @@
28
+165                                                                        169  
29
+166  MODULE = Data::Alias  PACKAGE = Data::Alias                           170  MODULE = Data::Alias  PACKAGE = Data::Alias
30
+167                                                                        171  
31
+168 @@ -2025,6 +2070,10 @@ BOOT:                                           172 @@ -2025,6 +2074,10 @@ BOOT:
32
+169                  PL_check[OP_RV2CV] = da_ck_rv2cv;                     173                  PL_check[OP_RV2CV] = da_ck_rv2cv;
33
+170                  da_old_ck_entersub = PL_check[OP_ENTERSUB];           174                  da_old_ck_entersub = PL_check[OP_ENTERSUB];
34
+171                  PL_check[OP_ENTERSUB] = da_ck_entersub;               175                  PL_check[OP_ENTERSUB] = da_ck_entersub;