| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 1cb96b4 commit 658f5b7
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -83,7 +83,7 @@ describe("Filter", function() { | |||
| 83 | 83 | .then(function(emptyRepo) { | |
| 84 | 84 | test.emptyRepo = emptyRepo; | |
| 85 | 85 | return fse.writeFile( | |
| 86 | - path.join(reposPath, ".gitattributes"), | ||
| 86 | + path.join(reposPath, ".gitattributes"), | ||
| 87 | 87 | "*.md filter=" + filterName + " -text", | |
| 88 | 88 | { encoding: "utf-8" } | |
| 89 | 89 | ); | |
@@ -153,7 +153,7 @@ describe("Filter", function() { | |||
| 153 | 153 | ||
| 154 | 154 | it("cannot unregister the filter twice", function() { | |
| 155 | 155 | return Registry.unregister(filterName) | |
| 156 | - .then(function(result) { | ||
| 156 | + .then(function(result) { | ||
| 157 | 157 | assert.strictEqual(result, NodeGit.Error.CODE.OK); | |
| 158 | 158 | return Registry.unregister(filterName); | |
| 159 | 159 | }) | |
@@ -185,7 +185,7 @@ describe("Filter", function() { | |||
| 185 | 185 | }) | |
| 186 | 186 | .then(function() { | |
| 187 | 187 | return fse.writeFile( | |
| 188 | - packageJsonPath, | ||
| 188 | + packageJsonPath, | ||
| 189 | 189 | "Changing content to trigger checkout" | |
| 190 | 190 | ); | |
| 191 | 191 | }) | |
@@ -219,7 +219,7 @@ describe("Filter", function() { | |||
| 219 | 219 | global.gc(); | |
| 220 | 220 | ||
| 221 | 221 | return fse.writeFile( | |
| 222 | - packageJsonPath, | ||
| 222 | + packageJsonPath, | ||
| 223 | 223 | "Changing content to trigger checkout" | |
| 224 | 224 | ); | |
| 225 | 225 | }) | |
@@ -253,7 +253,7 @@ describe("Filter", function() { | |||
| 253 | 253 | }) | |
| 254 | 254 | .then(function() { | |
| 255 | 255 | return fse.writeFile( | |
| 256 | - packageJsonPath, | ||
| 256 | + packageJsonPath, | ||
| 257 | 257 | "Changing content to trigger checkout" | |
| 258 | 258 | ); | |
| 259 | 259 | }) | |
@@ -289,7 +289,7 @@ describe("Filter", function() { | |||
| 289 | 289 | .then(function(result) { | |
| 290 | 290 | assert.strictEqual(result, NodeGit.Error.CODE.OK); | |
| 291 | 291 | return fse.writeFile( | |
| 292 | - packageJsonPath, | ||
| 292 | + packageJsonPath, | ||
| 293 | 293 | "Changing content to trigger checkout", | |
| 294 | 294 | { encoding: "utf-8" } | |
| 295 | 295 | ); | |
@@ -309,7 +309,7 @@ describe("Filter", function() { | |||
| 309 | 309 | assert.strictEqual(shutdown, true); | |
| 310 | 310 | }); | |
| 311 | 311 | }); | |
| 312 | - | ||
| 312 | + | ||
| 313 | 313 | it("filter successfully shuts down on garbage collect", function() { | |
| 314 | 314 | var test = this; | |
| 315 | 315 | var shutdown = false; | |
@@ -325,7 +325,7 @@ describe("Filter", function() { | |||
| 325 | 325 | .then(function(result) { | |
| 326 | 326 | assert.strictEqual(result, NodeGit.Error.CODE.OK); | |
| 327 | 327 | return fse.writeFile( | |
| 328 | - packageJsonPath, | ||
| 328 | + packageJsonPath, | ||
| 329 | 329 | "Changing content to trigger checkout", | |
| 330 | 330 | { encoding: "utf-8" } | |
| 331 | 331 | ); | |
@@ -363,7 +363,7 @@ describe("Filter", function() { | |||
| 363 | 363 | .then(function(result) { | |
| 364 | 364 | assert.strictEqual(result, NodeGit.Error.CODE.OK); | |
| 365 | 365 | return fse.writeFile( | |
| 366 | - packageJsonPath, | ||
| 366 | + packageJsonPath, | ||
| 367 | 367 | "Changing content to trigger checkout", | |
| 368 | 368 | { encoding: "utf-8" } | |
| 369 | 369 | ); | |
@@ -389,7 +389,7 @@ describe("Filter", function() { | |||
| 389 | 389 | }); | |
| 390 | 390 | ||
| 391 | 391 | describe("Apply", function() { | |
| 392 | - before(function() { | ||
| 392 | + before(function() { | ||
| 393 | 393 | var test = this; | |
| 394 | 394 | return fse.readFile(readmePath, "utf8") | |
| 395 | 395 | .then((function(content) { | |
@@ -410,7 +410,7 @@ describe("Filter", function() { | |||
| 410 | 410 | it("should not apply when check returns GIT_PASSTHROUGH", function(){ | |
| 411 | 411 | var test = this; | |
| 412 | 412 | var applied = false; | |
| 413 | - | ||
| 413 | + | ||
| 414 | 414 | return Registry.register(filterName, { | |
| 415 | 415 | apply: function() { | |
| 416 | 416 | applied = true; | |
@@ -422,7 +422,7 @@ describe("Filter", function() { | |||
| 422 | 422 | .then(function(result) { | |
| 423 | 423 | assert.strictEqual(result, NodeGit.Error.CODE.OK); | |
| 424 | 424 | return fse.writeFile( | |
| 425 | - packageJsonPath, | ||
| 425 | + packageJsonPath, | ||
| 426 | 426 | "Changing content to trigger checkout", | |
| 427 | 427 | { encoding: "utf-8" } | |
| 428 | 428 | ); | |
@@ -454,8 +454,8 @@ describe("Filter", function() { | |||
| 454 | 454 | .then(function(result) { | |
| 455 | 455 | assert.strictEqual(result, NodeGit.Error.CODE.OK); | |
| 456 | 456 | return fse.writeFile( | |
| 457 | - packageJsonPath, | ||
| 458 | - "Changing content to trigger checkout", | ||
| 457 | + packageJsonPath, | ||
| 458 | + "Changing content to trigger checkout", | ||
| 459 | 459 | { encoding: "utf-8" } | |
| 460 | 460 | ); | |
| 461 | 461 | }) | |
@@ -490,13 +490,13 @@ describe("Filter", function() { | |||
| 490 | 490 | }) | |
| 491 | 491 | .then(function() { | |
| 492 | 492 | var readmeContent = fse.readFileSync( | |
| 493 | - packageJsonPath, | ||
| 493 | + packageJsonPath, | ||
| 494 | 494 | "utf-8" | |
| 495 | 495 | ); | |
| 496 | 496 | assert.notStrictEqual(readmeContent, message); | |
| 497 | 497 | ||
| 498 | 498 | return fse.writeFile( | |
| 499 | - packageJsonPath, | ||
| 499 | + packageJsonPath, | ||
| 500 | 500 | "Changing content to trigger checkout" | |
| 501 | 501 | ); | |
| 502 | 502 | }) | |
@@ -509,7 +509,7 @@ describe("Filter", function() { | |||
| 509 | 509 | }) | |
| 510 | 510 | .then(function() { | |
| 511 | 511 | var postInitializeReadmeContents = fse.readFileSync( | |
| 512 | - readmePath, | ||
| 512 | + readmePath, | ||
| 513 | 513 | "utf-8" | |
| 514 | 514 | ); | |
| 515 | 515 | ||
@@ -536,7 +536,7 @@ describe("Filter", function() { | |||
| 536 | 536 | }) | |
| 537 | 537 | .then(function() { | |
| 538 | 538 | var readmeContent = fse.readFileSync( | |
| 539 | - readmePath, | ||
| 539 | + readmePath, | ||
| 540 | 540 | "utf-8" | |
| 541 | 541 | ); | |
| 542 | 542 | assert.notStrictEqual(readmeContent, message); | |
@@ -550,30 +550,33 @@ describe("Filter", function() { | |||
| 550 | 550 | }) | |
| 551 | 551 | .then(function() { | |
| 552 | 552 | var postInitializeReadmeContents = fse.readFileSync( | |
| 553 | - readmePath, | ||
| 553 | + readmePath, | ||
| 554 | 554 | "utf-8" | |
| 555 | 555 | ); | |
| 556 | 556 | ||
| 557 | 557 | assert.strictEqual(postInitializeReadmeContents, message); | |
| 558 | 558 | }); | |
| 559 | 559 | }); | |
| 560 | 560 | ||
| 561 | - it("applies the massive filter data on checkout", function() { | ||
| 562 | - this.timeout(350000); | ||
| 563 | - var test = this; | ||
| 564 | - var largeBuffer = Buffer.alloc(largeBufferSize, "a"); | ||
| 565 | - | ||
| 566 | - return Registry.register(filterName, { | ||
| 567 | - apply: function(to, from, source) { | ||
| 568 | - return to.set(largeBuffer, largeBufferSize) | ||
| 561 | + // this test is useless on 32 bit CI, because we cannot construct | ||
| 562 | + // a buffer big enough to test anything of significance :)... | ||
| 563 | + if (process.arch === "x64") { | ||
| 564 | + it("applies the massive filter data on checkout", function() { | ||
| 565 | + this.timeout(350000); | ||
| 566 | + var test = this; | ||
| 567 | + var largeBuffer = Buffer.alloc(largeBufferSize, "a"); | ||
| 568 | + | ||
| 569 | + return Registry.register(filterName, { | ||
| 570 | + apply: function(to, from, source) { | ||
| 571 | + return to.set(largeBuffer, largeBufferSize) | ||
| 569 | 572 | .then(function() { | |
| 570 | 573 | return NodeGit.Error.CODE.OK; | |
| 571 | 574 | }); | |
| 572 | - }, | ||
| 573 | - check: function(src, attr) { | ||
| 574 | - return NodeGit.Error.CODE.OK; | ||
| 575 | - } | ||
| 576 | - }, 0) | ||
| 575 | + }, | ||
| 576 | + check: function(src, attr) { | ||
| 577 | + return NodeGit.Error.CODE.OK; | ||
| 578 | + } | ||
| 579 | + }, 0) | ||
| 577 | 580 | .then(function(result) { | |
| 578 | 581 | assert.strictEqual(result, 0); | |
| 579 | 582 | }) | |
@@ -615,7 +618,8 @@ describe("Filter", function() { | |||
| 615 | 618 | largeBufferSize | |
| 616 | 619 | ); | |
| 617 | 620 | }); | |
| 618 | - }); | ||
| 621 | + }); | ||
| 622 | + } | ||
| 619 | 623 | ||
| 620 | 624 | it("applies the filter data on checkout with gc", function() { | |
| 621 | 625 | var test = this; | |
@@ -636,7 +640,7 @@ describe("Filter", function() { | |||
| 636 | 640 | }) | |
| 637 | 641 | .then(function() { | |
| 638 | 642 | var readmeContent = fse.readFileSync( | |
| 639 | - readmePath, | ||
| 643 | + readmePath, | ||
| 640 | 644 | "utf-8" | |
| 641 | 645 | ); | |
| 642 | 646 | assert.notStrictEqual(readmeContent, message); | |
@@ -651,7 +655,7 @@ describe("Filter", function() { | |||
| 651 | 655 | }) | |
| 652 | 656 | .then(function() { | |
| 653 | 657 | var postInitializeReadmeContents = fse.readFileSync( | |
| 654 | - readmePath, | ||
| 658 | + readmePath, | ||
| 655 | 659 | "utf-8" | |
| 656 | 660 | ); | |
| 657 | 661 | ||
@@ -670,7 +674,7 @@ describe("Filter", function() { | |||
| 670 | 674 | }); | |
| 671 | 675 | }, | |
| 672 | 676 | check: function(src, attr) { | |
| 673 | - return src.path() === "README.md" ? | ||
| 677 | + return src.path() === "README.md" ? | ||
| 674 | 678 | 0 : NodeGit.Error.CODE.PASSTHROUGH; | |
| 675 | 679 | }, | |
| 676 | 680 | cleanup: function() {} | |
@@ -680,14 +684,14 @@ describe("Filter", function() { | |||
| 680 | 684 | }) | |
| 681 | 685 | .then(function() { | |
| 682 | 686 | var readmeContent = fse.readFileSync( | |
| 683 | - readmePath, | ||
| 687 | + readmePath, | ||
| 684 | 688 | "utf-8" | |
| 685 | 689 | ); | |
| 686 | 690 | assert.notStrictEqual(readmeContent, "testing commit contents"); | |
| 687 | 691 | }) | |
| 688 | 692 | .then(function() { | |
| 689 | - return commitFile(test.repository, "README.md", | ||
| 690 | - "testing commit contents", | ||
| 693 | + return commitFile(test.repository, "README.md", | ||
| 694 | + "testing commit contents", | ||
| 691 | 695 | "test commit" | |
| 692 | 696 | ); | |
| 693 | 697 | }) | |
@@ -696,7 +700,7 @@ describe("Filter", function() { | |||
| 696 | 700 | }) | |
| 697 | 701 | .then(function(commit) { | |
| 698 | 702 | var postInitializeReadmeContents = fse.readFileSync( | |
| 699 | - readmePath, | ||
| 703 | + readmePath, | ||
| 700 | 704 | "utf-8" | |
| 701 | 705 | ); | |
| 702 | 706 | ||
@@ -738,14 +742,14 @@ describe("Filter", function() { | |||
| 738 | 742 | }) | |
| 739 | 743 | .then(function() { | |
| 740 | 744 | var readmeContent = fse.readFileSync( | |
| 741 | - readmePath, | ||
| 745 | + readmePath, | ||
| 742 | 746 | "utf-8" | |
| 743 | 747 | ); | |
| 744 | 748 | assert.notStrictEqual(readmeContent, "testing commit contents"); | |
| 745 | 749 | }) | |
| 746 | 750 | .then(function() { | |
| 747 | - return commitFile(test.repository, "README.md", | ||
| 748 | - "testing commit contents", | ||
| 751 | + return commitFile(test.repository, "README.md", | ||
| 752 | + "testing commit contents", | ||
| 749 | 753 | "test commit" | |
| 750 | 754 | ); | |
| 751 | 755 | }) | |
@@ -755,7 +759,7 @@ describe("Filter", function() { | |||
| 755 | 759 | }) | |
| 756 | 760 | .then(function(commit) { | |
| 757 | 761 | var postInitializeReadmeContents = fse.readFileSync( | |
| 758 | - readmePath, | ||
| 762 | + readmePath, | ||
| 759 | 763 | "utf-8" | |
| 760 | 764 | ); | |
| 761 | 765 | ||
@@ -806,7 +810,7 @@ describe("Filter", function() { | |||
| 806 | 810 | assert.notEqual(packageContent, ""); | |
| 807 | 811 | ||
| 808 | 812 | return fse.writeFile( | |
| 809 | - packageJsonPath, | ||
| 813 | + packageJsonPath, | ||
| 810 | 814 | "Changing content to trigger checkout", | |
| 811 | 815 | { encoding: "utf-8" } | |
| 812 | 816 | ); | |
@@ -845,14 +849,14 @@ describe("Filter", function() { | |||
| 845 | 849 | }) | |
| 846 | 850 | .then(function() { | |
| 847 | 851 | var packageContent = fse.readFileSync( | |
| 848 | - packageJsonPath, | ||
| 852 | + packageJsonPath, | ||
| 849 | 853 | "utf-8" | |
| 850 | 854 | ); | |
| 851 | 855 | assert.notEqual(packageContent, ""); | |
| 852 | 856 | ||
| 853 | 857 | global.gc(); | |
| 854 | 858 | return fse.writeFile( | |
| 855 | - packageJsonPath, | ||
| 859 | + packageJsonPath, | ||
| 856 | 860 | "Changing content to trigger checkout", | |
| 857 | 861 | { encoding: "utf-8" } | |
| 858 | 862 | ); | |
@@ -892,11 +896,11 @@ describe("Filter", function() { | |||
| 892 | 896 | }) | |
| 893 | 897 | .then(function() { | |
| 894 | 898 | var packageContent = fse.readFileSync( | |
| 895 | - packageJsonPath, | ||
| 899 | + packageJsonPath, | ||
| 896 | 900 | "utf-8" | |
| 897 | 901 | ); | |
| 898 | 902 | var readmeContent = fse.readFileSync( | |
| 899 | - readmePath, | ||
| 903 | + readmePath, | ||
| 900 | 904 | "utf-8" | |
| 901 | 905 | ); | |
| 902 | 906 | ||
@@ -905,7 +909,7 @@ describe("Filter", function() { | |||
| 905 | 909 | }) | |
| 906 | 910 | .then(function() { | |
| 907 | 911 | return fse.writeFile( | |
| 908 | - packageJsonPath, | ||
| 912 | + packageJsonPath, | ||
| 909 | 913 | "Changing content to trigger checkout", | |
| 910 | 914 | { encoding: "utf-8" } | |
| 911 | 915 | ); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments