-
-
Notifications
You must be signed in to change notification settings - Fork 344
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed a bug where we could end up with lists of nulls.
This also means I can now install firespitter. :)
- Loading branch information
Showing
7 changed files
with
138 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
using NUnit.Framework; | ||
using Tests; | ||
using System.Collections.Generic; | ||
|
||
namespace CKANTests | ||
{ | ||
[TestFixture()] | ||
public class ModuleInstallDescriptor | ||
{ | ||
[Test()] | ||
// NOTE: I've *never* got these to fail. The problem I'm trying to reproduce | ||
// seems to involve saving to the registry and back. It's now fixed in | ||
// JsonSingleOrArrayConverter.cs, but these tests remain, because tests are good. | ||
public void Null_Filters() | ||
{ | ||
// We had a bug whereby we could end up with a filter list of a single null. | ||
// Make sure that doesn't happen ever again. | ||
|
||
// We want a module that doesn't specify filters. | ||
CKAN.CkanModule mod = TestData.kOS_014_module(); | ||
|
||
test_filter(mod.install[0].filter, "kOS/filter"); | ||
test_filter(mod.install[0].filter_regexp, "kOS/filter_regexp"); | ||
|
||
// And Firespitter seems to trigger it. | ||
|
||
CKAN.CkanModule firespitter = TestData.FireSpitterModule(); | ||
|
||
foreach (var stanza in firespitter.install) | ||
{ | ||
test_filter(stanza.filter, "Firespitter/filter"); | ||
test_filter(stanza.filter_regexp, "Firespitter/filter_regexp"); | ||
} | ||
} | ||
|
||
private void test_filter(List<string> filter, string message) | ||
{ | ||
if (filter != null) | ||
{ | ||
Assert.IsFalse(filter.Contains(null), message); | ||
} | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"spec_version" : 1, | ||
"identifier" : "Firespitter", | ||
"$kref" : "#/ckan/kerbalstuff/63", | ||
"license" : "restricted", | ||
"comment" : "Our version really depends on FirespitterCore", | ||
"ksp_version_min" : "0.24.2", | ||
"resources" : { | ||
"github" : { | ||
"url" : "https://github.com/snjo/Firespitter" | ||
} | ||
}, | ||
"depends" : [ { | ||
"name" : "FirespitterCore", | ||
"min_version" : "7.0.5398.27328" | ||
} ], | ||
"x_supports" : [ { "name" : "PartCatalog" } ], | ||
"install" : [ | ||
{ | ||
"file" : "Firespitter", | ||
"install_to" : "GameData", | ||
"filter" : "Firespitter.dll", | ||
"comment" : "The DLL is installed from FirespitterCore" | ||
}, | ||
{ | ||
"file" : "PartCatalog", | ||
"install_to" : "GameData", | ||
"comment" : "Firespitter graphics for PartCatalog" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{ | ||
"spec_version": 1, | ||
"identifier": "Firespitter", | ||
"license": "restricted", | ||
"comment": "Our version really depends on FirespitterCore", | ||
"ksp_version_min": "0.24.2", | ||
"resources": { | ||
"github": { | ||
"url": "https://github.com/snjo/Firespitter" | ||
}, | ||
"kerbalstuff": { | ||
"url": "https://kerbalstuff.com/mod/63/Firespitter" | ||
}, | ||
"homepage": "http://forum.kerbalspaceprogram.com/showthread.php/24551-Firespitter" | ||
}, | ||
"depends": [ | ||
{ | ||
"name": "FirespitterCore", | ||
"min_version": "7.0.5398.27328" | ||
} | ||
], | ||
"x_supports": [ | ||
{ | ||
"name": "PartCatalog" | ||
} | ||
], | ||
"install": [ | ||
{ | ||
"file": "Firespitter", | ||
"install_to": "GameData", | ||
"filter": "Firespitter.dll", | ||
"comment": "The DLL is installed from FirespitterCore" | ||
}, | ||
{ | ||
"file": "PartCatalog", | ||
"install_to": "GameData", | ||
"comment": "Firespitter graphics for PartCatalog" | ||
} | ||
], | ||
"name": "Firespitter", | ||
"abstract": "Propeller plane and helicopter parts", | ||
"author": "Snjo", | ||
"version": "6.3.5", | ||
"download": "https://kerbalstuff.com/mod/63/Firespitter/download/6.3.5", | ||
"x_generated_by": "netkan", | ||
"download_size": 37457313 | ||
} |