From 241a75387964cb75a208926e1199df34a8e41e36 Mon Sep 17 00:00:00 2001 From: Rory Hinnen Date: Tue, 8 Sep 2026 16:38:09 -0500 Subject: [PATCH] fix tests --- Bunch O' Dice.xctestplan | 36 +++++++++++++++++++ DieHammer.xcodeproj/project.pbxproj | 12 ++++--- .../xcschemes/Bunch O' Dice.xcscheme | 32 +++++------------ .../xcschemes/xcschememanagement.plist | 13 +++++++ DieHammerTests/Bunch_O__DiceTests.swift | 6 ++-- 5 files changed, 68 insertions(+), 31 deletions(-) create mode 100644 Bunch O' Dice.xctestplan diff --git a/Bunch O' Dice.xctestplan b/Bunch O' Dice.xctestplan new file mode 100644 index 0000000..490e3ac --- /dev/null +++ b/Bunch O' Dice.xctestplan @@ -0,0 +1,36 @@ +{ + "configurations" : [ + { + "id" : "3E4A1B2C-5D6E-7F8A-9B0C-1D2E3F4A5B6C", + "name" : "Test Scheme Action", + "options" : { + + } + } + ], + "defaultOptions" : { + + }, + "testTargets" : [ + { + "target" : { + "containerPath" : "container:DieHammer.xcodeproj", + "identifier" : "981AD0C927C30E32005A6492", + "name" : "Bunch O' DiceTests" + } + }, + { + "target" : { + "containerPath" : "container:DieHammer.xcodeproj", + "identifier" : "981AD0D327C30E32005A6492", + "name" : "Bunch O' DiceUITests" + }, + "uiTargetApp" : { + "containerPath" : "container:DieHammer.xcodeproj", + "identifier" : "981AD0B927C30E31005A6492", + "name" : "DieHammer" + } + } + ], + "version" : 1 +} diff --git a/DieHammer.xcodeproj/project.pbxproj b/DieHammer.xcodeproj/project.pbxproj index 40389f7..7ae6662 100644 --- a/DieHammer.xcodeproj/project.pbxproj +++ b/DieHammer.xcodeproj/project.pbxproj @@ -63,7 +63,7 @@ 98225DE02A3527160019DE8E /* dice.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = dice.swift; sourceTree = ""; }; 98325A2D2839BE4B0006DF4B /* RollState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RollState.swift; sourceTree = ""; }; 98745CA52870CC670031166A /* SettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsView.swift; sourceTree = ""; }; - 988997FF285814AB00B07E09 /* Bunch-O--Dice-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Bunch-O--Dice-Info.plist"; sourceTree = SOURCE_ROOT; }; + 988997FF285814AB00B07E09 /* DieHammer.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = DieHammer.plist; sourceTree = SOURCE_ROOT; }; 988B150E2854E9160082C2C5 /* HistoryView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HistoryView.swift; sourceTree = ""; }; 988B1516285565610082C2C5 /* Onboarding.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Onboarding.swift; sourceTree = ""; }; 988B1518285566AD0082C2C5 /* OnboardingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnboardingView.swift; sourceTree = ""; }; @@ -130,7 +130,7 @@ isa = PBXGroup; children = ( 7692E8422BD55CDE005BDD76 /* PrivacyInfo.xcprivacy */, - 988997FF285814AB00B07E09 /* Bunch-O--Dice-Info.plist */, + 988997FF285814AB00B07E09 /* DieHammer.plist */, 981AD0BD27C30E31005A6492 /* DieHammerApp.swift */, 981AD0BF27C30E31005A6492 /* ContentView.swift */, 988B1518285566AD0082C2C5 /* OnboardingView.swift */, @@ -158,7 +158,8 @@ children = ( 981AD0CE27C30E32005A6492 /* Bunch_O__DiceTests.swift */, ); - path = "Bunch O' DiceTests"; + name = "Bunch O' DiceTests"; + path = DieHammerTests; sourceTree = ""; }; 981AD0D727C30E32005A6492 /* Bunch O' DiceUITests */ = { @@ -167,7 +168,8 @@ 981AD0D827C30E32005A6492 /* Bunch_O__DiceUITests.swift */, 981AD0DA27C30E32005A6492 /* Bunch_O__DiceUITestsLaunchTests.swift */, ); - path = "Bunch O' DiceUITests"; + name = "Bunch O' DiceUITests"; + path = DieHammerUITests; sourceTree = ""; }; 981AD0E727C311DA005A6492 /* Model */ = { @@ -537,6 +539,7 @@ ); MARKETING_VERSION = 1.2; PRODUCT_BUNDLE_IDENTIFIER = "com.chartreusenecktie.Bunch-O--Dice"; + PRODUCT_MODULE_NAME = DieHammer; PRODUCT_NAME = "Bunch O' Dice"; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; @@ -568,6 +571,7 @@ ); MARKETING_VERSION = 1.2; PRODUCT_BUNDLE_IDENTIFIER = "com.chartreusenecktie.Bunch-O--Dice"; + PRODUCT_MODULE_NAME = DieHammer; PRODUCT_NAME = "Bunch O' Dice"; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; diff --git a/DieHammer.xcodeproj/xcshareddata/xcschemes/Bunch O' Dice.xcscheme b/DieHammer.xcodeproj/xcshareddata/xcschemes/Bunch O' Dice.xcscheme index 14862e0..35cfdee 100644 --- a/DieHammer.xcodeproj/xcshareddata/xcschemes/Bunch O' Dice.xcscheme +++ b/DieHammer.xcodeproj/xcshareddata/xcschemes/Bunch O' Dice.xcscheme @@ -1,7 +1,7 @@ + version = "1.8"> - - - - - - - - - - + shouldAutocreateTestPlan = "NO"> + + + + orderHint 0 + Bunch O' DiceUITests.xcscheme_^#shared#^_ + + orderHint + 1 + + + SuppressBuildableAutocreation + + 981AD0D327C30E32005A6492 + + primary + + diff --git a/DieHammerTests/Bunch_O__DiceTests.swift b/DieHammerTests/Bunch_O__DiceTests.swift index c30b1b5..9572efe 100644 --- a/DieHammerTests/Bunch_O__DiceTests.swift +++ b/DieHammerTests/Bunch_O__DiceTests.swift @@ -203,8 +203,8 @@ struct RerollTests { var d = Dice() d.one = 2; d.two = 2; d.three = 2; d.six = 4 d.rerollBelow(cutoff: 4) - // The 4 sixes were not in the reroll range and should be unchanged - #expect(d.six == 4) + // Sixes were not in the reroll range; rerolled dice may also produce sixes + #expect(d.six >= 4) } @Test("applyReroll: none mode leaves hasRerolled false") @@ -266,7 +266,7 @@ struct RerollTests { let total = roll.dice.one + roll.dice.two + roll.dice.three + roll.dice.four + roll.dice.five + roll.dice.six #expect(total == 5) - #expect(roll.dice.six == 2) // dice above cutoff are untouched + #expect(roll.dice.six >= 2) // dice above cutoff are untouched; rerolls may also produce sixes } @Test("resetPool: clears hitHasRerolled flag")