Skip to content

Commit 311fd28

Browse files
committed
fix #522: sourceSubpop is always NULL in modifyChild()
1 parent c9339b7 commit 311fd28

3 files changed

Lines changed: 59 additions & 46 deletions

File tree

VERSIONS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ development head (in the master branch):
1212
write "chromosomes" and "this_chromosome" keys out to provenance as well as metadata (#520)
1313
fix an annoying autoindent cursor position bug that I suspect is a Qt 6 regression in QPlainTextEdit
1414
add a define of TSK_TRACE_ERRORS in Xcode for slim and SLiMguiLegacy, in DEBUG only, for easier tskit debugging; break on _tsk_trace_error()
15+
fix a regression that caused the sourceSubpop pseudo-parameter to be NULL in modifyChild() clabbacks in all cases; add tests, improve documentation (#522)
1516

1617

1718
version 5.0 (Eidos version 4.0):

core/slim_test_core.cpp

Lines changed: 53 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -2200,6 +2200,9 @@ void _RunSLiMEidosBlockTests(void)
22002200
// Test callbacks; we don't attempt to test their functionality here, just their declaration and the fact that they get called
22012201
// Their actual functionality gets tested by the R test suite and the recipes; we want to probe error cases here, more
22022202
// Things to be careful of: declaration syntax, return value types, special optimized cases, pseudo-parameter definitions
2203+
static std::string gen1_setup_p1p2p3_nonWF(nonWF_prefix + "initialize() { initializeSex(); initializeMutationRate(1e-7); initializeMutationType('m1', 0.5, 'f', 0.0); initializeGenomicElementType('g1', m1, 1.0); initializeGenomicElement(g1, 0, 99999); initializeRecombinationRate(1e-8); } " + "1 early() { sim.addSubpop('p1', 10); sim.addSubpop('p2', 10); sim.addSubpop('p3', 10); } " + "late() { sim.subpopulations.fitnessScaling = 20 / sim.subpopulations.individualCount; } ");
2204+
static std::string gen1_setup_p1p2p3_nonWF_cross(gen1_setup_p1p2p3_nonWF + "reproduction(NULL, 'F') { mate = subpop.sampleIndividuals(1, sex='M'); if (mate.size() == 1) subpop.addCrossed(individual, mate); } ");
2205+
static std::string gen1_setup_p1p2p3_nonWF_clone(gen1_setup_p1p2p3_nonWF + "reproduction() { subpop.addCloned(individual); } ");
22032206

22042207
// fitnessEffect() callbacks
22052208
SLiMAssertScriptStop(gen1_setup_p1p2p3 + "fitnessEffect() { return 1.0; } 100 early() { stop(); }", __LINE__);
@@ -2211,6 +2214,10 @@ void _RunSLiMEidosBlockTests(void)
22112214
SLiMAssertScriptSuccess(gen1_setup_p1p2p3 + "early() { s1.active = 0; } s1 fitnessEffect(p1) { stop(); } 100 early() { ; }", __LINE__);
22122215
SLiMAssertScriptRaise(gen1_setup_p1p2p3 + "fitnessEffect(m1) { stop(); } 100 early() { ; }", "identifier prefix 'p' was expected", __LINE__);
22132216

2217+
SLiMAssertScriptStop(gen1_setup_p1p2p3 + "fitnessEffect(p1) { if (!isNULL(individual) & !isNULL(subpop)) return 1.0; } 100 early() { stop(); }", __LINE__);
2218+
SLiMAssertScriptStop(gen1_setup_p1p2p3_nonWF_cross + "fitnessEffect(p1) { if (!isNULL(individual) & !isNULL(subpop)) return 1.0; } 100 early() { stop(); }", __LINE__);
2219+
SLiMAssertScriptStop(gen1_setup_p1p2p3_nonWF_clone + "fitnessEffect(p1) { if (!isNULL(individual) & !isNULL(subpop)) return 1.0; } 100 early() { stop(); }", __LINE__);
2220+
22142221
// mutationEffect() callbacks
22152222
SLiMAssertScriptStop(gen1_setup_p1p2p3 + "mutationEffect(m1) { return effect; } 100 early() { stop(); }", __LINE__);
22162223
SLiMAssertScriptStop(gen1_setup_p1p2p3 + "mutationEffect(m1) { stop(); } 100 early() { ; }", __LINE__);
@@ -2246,7 +2253,9 @@ void _RunSLiMEidosBlockTests(void)
22462253
SLiMAssertScriptRaise(gen1_setup_p1p2p3 + "mutationEffect(m1) { mut; return 'a'; } 100 early() { ; }", "return value", __LINE__);
22472254
SLiMAssertScriptRaise(gen1_setup_p1p2p3 + "mutationEffect(m1) { mut; return mut; } 100 early() { ; }", "return value", __LINE__);
22482255

2249-
SLiMAssertScriptStop(gen1_setup_p1p2p3 + "mutationEffect(m1) { mut; homozygous; individual; subpop; return effect; } 100 early() { stop(); }", __LINE__);
2256+
SLiMAssertScriptStop(gen1_setup_p1p2p3 + "mutationEffect(m1) { if (!isNULL(mut) & !isNULL(homozygous) & !isNULL(effect) & !isNULL(individual) & !isNULL(subpop)) return effect; } 100 early() { stop(); }", __LINE__);
2257+
SLiMAssertScriptStop(gen1_setup_p1p2p3_nonWF_cross + "mutationEffect(m1) { if (!isNULL(mut) & !isNULL(homozygous) & !isNULL(effect) & !isNULL(individual) & !isNULL(subpop)) return effect; } 100 early() { stop(); }", __LINE__);
2258+
SLiMAssertScriptStop(gen1_setup_p1p2p3_nonWF_clone + "mutationEffect(m1) { if (!isNULL(mut) & !isNULL(homozygous) & !isNULL(effect) & !isNULL(individual) & !isNULL(subpop)) return effect; } 100 early() { stop(); }", __LINE__);
22502259

22512260
// mateChoice() callbacks
22522261
SLiMAssertScriptStop(gen1_setup_p1p2p3 + "mateChoice() { return weights; } 10 early() { stop(); }", __LINE__);
@@ -2278,7 +2287,7 @@ void _RunSLiMEidosBlockTests(void)
22782287
SLiMAssertScriptRaise(gen1_setup_p1p2p3 + "mateChoice(p1) { subpop; return 'a'; } 10 early() { ; }", "return value", __LINE__);
22792288
SLiMAssertScriptRaise(gen1_setup_p1p2p3 + "mateChoice(p1) { subpop; return individual.haploidGenome1; } 10 early() { ; }", "return value", __LINE__);
22802289

2281-
SLiMAssertScriptStop(gen1_setup_p1p2p3 + "mateChoice(p1) { individual; subpop; sourceSubpop; return weights; } 10 early() { stop(); }", __LINE__);
2290+
SLiMAssertScriptStop(gen1_setup_p1p2p3 + "mateChoice(p1) { if (!isNULL(individual) & !isNULL(subpop) & !isNULL(sourceSubpop) & !isNULL(weights)) return weights; } 10 early() { stop(); }", __LINE__);
22822291

22832292
// modifyChild() callbacks
22842293
SLiMAssertScriptStop(gen1_setup_p1p2p3 + "modifyChild() { return T; } 10 early() { stop(); }", __LINE__);
@@ -2308,7 +2317,9 @@ void _RunSLiMEidosBlockTests(void)
23082317
SLiMAssertScriptRaise(gen1_setup_p1p2p3 + "modifyChild(p1) { subpop; return 'a'; } 10 early() { ; }", "return value", __LINE__);
23092318
SLiMAssertScriptRaise(gen1_setup_p1p2p3 + "modifyChild(p1) { subpop; return child; } 10 early() { ; }", "return value", __LINE__);
23102319

2311-
SLiMAssertScriptStop(gen1_setup_p1p2p3 + "modifyChild(p1) { child; parent1; isCloning; isSelfing; parent2; subpop; sourceSubpop; return T; } 10 early() { stop(); }", __LINE__);
2320+
SLiMAssertScriptStop(gen1_setup_p1p2p3 + "modifyChild(p1) { if (!isNULL(child) & !isNULL(isCloning) & !isNULL(isSelfing) & !isNULL(parent1) & !isNULL(parent2) & !isNULL(subpop) & !isNULL(sourceSubpop)) return T; } 10 early() { stop(); }", __LINE__);
2321+
SLiMAssertScriptStop(gen1_setup_p1p2p3_nonWF_cross + "modifyChild(p1) { if (!isNULL(child) & !isNULL(isCloning) & !isNULL(isSelfing) & !isNULL(parent1) & !isNULL(parent2) & !isNULL(subpop) & isNULL(sourceSubpop)) return T; } 10 early() { stop(); }", __LINE__);
2322+
SLiMAssertScriptStop(gen1_setup_p1p2p3_nonWF_clone + "modifyChild(p1) { if (!isNULL(child) & !isNULL(isCloning) & !isNULL(isSelfing) & !isNULL(parent1) & !isNULL(parent2) & !isNULL(subpop) & !isNULL(sourceSubpop)) return T; } 10 early() { stop(); }", __LINE__);
23122323

23132324
// recombination() callbacks
23142325
SLiMAssertScriptStop(gen1_setup_p1p2p3 + "recombination() { return F; } 10 early() { stop(); }", __LINE__);
@@ -2340,7 +2351,9 @@ void _RunSLiMEidosBlockTests(void)
23402351
SLiMAssertScriptRaise(gen1_setup_p1p2p3 + "recombination(p1) { subpop; return 'a'; } 10 early() { ; }", "return value", __LINE__);
23412352
SLiMAssertScriptRaise(gen1_setup_p1p2p3 + "recombination(p1) { subpop; return subpop; } 10 early() { ; }", "return value", __LINE__);
23422353

2343-
SLiMAssertScriptStop(gen1_setup_p1p2p3 + "recombination(p1) { individual; haplosome1; haplosome2; subpop; breakpoints; return T; } 10 early() { stop(); }", __LINE__);
2354+
SLiMAssertScriptStop(gen1_setup_p1p2p3 + "recombination(p1) { if (!isNULL(individual) & !isNULL(haplosome1) & !isNULL(haplosome2) & !isNULL(subpop) & !isNULL(breakpoints)) return T; } 10 early() { stop(); }", __LINE__);
2355+
SLiMAssertScriptStop(gen1_setup_p1p2p3_nonWF_cross + "recombination(p1) { if (!isNULL(individual) & !isNULL(haplosome1) & !isNULL(haplosome2) & !isNULL(subpop) & !isNULL(breakpoints)) return T; } 10 early() { stop(); }", __LINE__);
2356+
SLiMAssertScriptStop(gen1_setup_p1p2p3_nonWF_clone + "recombination(p1) { if (!isNULL(individual) & !isNULL(haplosome1) & !isNULL(haplosome2) & !isNULL(subpop) & !isNULL(breakpoints)) return T; } 10 early() { stop(); }", __LINE__);
23442357

23452358
// interaction() callbacks
23462359
static std::string gen1_setup_p1p2p3_i1(gen1_setup_p1p2p3 + "initialize() { initializeInteractionType('i1', ''); } early() { i1.evaluate(sim.subpopulations); i1.strength(p1.individuals[0]); } ");
@@ -2379,11 +2392,9 @@ void _RunSLiMEidosBlockTests(void)
23792392
SLiMAssertScriptRaise(gen1_setup_p1p2p3_i1 + "interaction(i1) { exerter; return 'a'; } 10 early() { ; }", "return value", __LINE__);
23802393
SLiMAssertScriptRaise(gen1_setup_p1p2p3_i1 + "interaction(i1) { exerter; return exerter; } 10 early() { ; }", "return value", __LINE__);
23812394

2382-
SLiMAssertScriptStop(gen1_setup_p1p2p3_i1 + "interaction(i1) { distance; strength; receiver; exerter; return 1.0; } 10 early() { stop(); }", __LINE__);
2395+
SLiMAssertScriptStop(gen1_setup_p1p2p3_i1 + "interaction(i1) { if (!isNULL(distance) & !isNULL(strength) & !isNULL(exerter) & !isNULL(receiver)) return 1.0; } 10 early() { stop(); }", __LINE__);
23832396

23842397
// reproduction() callbacks
2385-
static std::string gen1_setup_p1p2p3_nonWF(nonWF_prefix + gen1_setup_sex_p1 + "1 early() { sim.addSubpop('p2', 10); sim.addSubpop('p3', 10); } " + "late() { sim.subpopulations.individuals.fitnessScaling = 0.0; } ");
2386-
23872398
SLiMAssertScriptStop(gen1_setup_p1p2p3_nonWF + "reproduction() { subpop.addCloned(individual); } 10 early() { stop(); }", __LINE__);
23882399
SLiMAssertScriptStop(gen1_setup_p1p2p3_nonWF + "reproduction() { stop(); } 10 early() { ; }", __LINE__);
23892400
SLiMAssertScriptStop(gen1_setup_p1p2p3_nonWF + "reproduction(p1) { subpop.addCloned(individual); } 10 early() { stop(); }", __LINE__);
@@ -2421,7 +2432,7 @@ void _RunSLiMEidosBlockTests(void)
24212432
SLiMAssertScriptRaise(gen1_setup_p1p2p3_nonWF + "reproduction(p1) { subpop; return 'a'; } 10 early() { ; }", "must return void", __LINE__);
24222433
SLiMAssertScriptRaise(gen1_setup_p1p2p3_nonWF + "reproduction(p1) { subpop; return subpop; } 10 early() { ; }", "must return void", __LINE__);
24232434

2424-
SLiMAssertScriptStop(gen1_setup_p1p2p3_nonWF + "reproduction(p1) { individual; subpop; subpop.addCloned(individual); } 10 early() { stop(); }", __LINE__);
2435+
SLiMAssertScriptStop(gen1_setup_p1p2p3_nonWF + "reproduction(p1) { if (!isNULL(individual) & !isNULL(subpop)) subpop.addCloned(individual); else foo; } 10 early() { stop(); }", __LINE__);
24252436

24262437
// mutation() callbacks
24272438
SLiMAssertScriptStop(gen1_setup_p1p2p3 + "mutation(m1) { return T; } 100 early() { stop(); }", __LINE__);
@@ -2467,41 +2478,42 @@ void _RunSLiMEidosBlockTests(void)
24672478
SLiMAssertScriptRaise(gen1_setup_p1p2p3 + "mutation(m1) { mut; return 1.0; } 100 early() { ; }", "return value", __LINE__);
24682479
SLiMAssertScriptRaise(gen1_setup_p1p2p3 + "mutation(m1) { mut; return 'a'; } 100 early() { ; }", "return value", __LINE__);
24692480

2470-
SLiMAssertScriptStop(gen1_setup_p1p2p3 + "mutation(m1) { mut; haplosome; element; originalNuc; parent; subpop; return T; } 100 early() { stop(); }", __LINE__);
2481+
SLiMAssertScriptStop(gen1_setup_p1p2p3 + "mutation(m1) { if (!isNULL(mut) & !isNULL(haplosome) & !isNULL(element) & !isNULL(originalNuc) & !isNULL(parent) & !isNULL(subpop)) return T; } 100 early() { stop(); }", __LINE__);
2482+
SLiMAssertScriptStop(gen1_setup_p1p2p3_nonWF_cross + "mutation(m1) { if (!isNULL(mut) & !isNULL(haplosome) & !isNULL(element) & !isNULL(originalNuc) & !isNULL(parent) & !isNULL(subpop)) return T; } 100 early() { stop(); }", __LINE__);
2483+
SLiMAssertScriptStop(gen1_setup_p1p2p3_nonWF_clone + "mutation(m1) { if (!isNULL(mut) & !isNULL(haplosome) & !isNULL(element) & !isNULL(originalNuc) & !isNULL(parent) & !isNULL(subpop)) return T; } 100 early() { stop(); }", __LINE__);
24712484

24722485
// survival() callbacks
2473-
static std::string gen1_setup_p1p2p3_nonWF_clonal(gen1_setup_p1p2p3_nonWF + "reproduction() { subpop.addCloned(individual); } ");
2474-
2475-
SLiMAssertScriptStop(gen1_setup_p1p2p3_nonWF_clonal + "survival() { return F; } 10 early() { if (p1.individualCount == 0) stop(); }", __LINE__);
2476-
SLiMAssertScriptStop(gen1_setup_p1p2p3_nonWF_clonal + "survival() { return T; } 10 early() { if (p1.individualCount == 5120) stop(); }", __LINE__);
2477-
SLiMAssertScriptStop(gen1_setup_p1p2p3_nonWF_clonal + "survival() { return NULL; } 10 early() { stop(); }", __LINE__);
2478-
//SLiMAssertScriptStop(gen1_setup_p1p2p3_nonWF_clonal + "survival() { if (subpop == p1) return p2; return NULL; } 10 early() { stop(); }", __LINE__);
2479-
SLiMAssertScriptStop(gen1_setup_p1p2p3_nonWF_clonal + "survival() { stop(); } 10 early() { ; }", __LINE__);
2480-
SLiMAssertScriptStop(gen1_setup_p1p2p3_nonWF_clonal + "survival(p1) { return F; } 10 early() { if (p1.individualCount == 0) stop(); }", __LINE__);
2481-
SLiMAssertScriptStop(gen1_setup_p1p2p3_nonWF_clonal + "survival(p1) { return T; } 10 early() { if (p1.individualCount == 5120) stop(); }", __LINE__);
2482-
SLiMAssertScriptStop(gen1_setup_p1p2p3_nonWF_clonal + "survival(p1) { return NULL; } 10 early() { stop(); }", __LINE__);
2483-
//SLiMAssertScriptStop(gen1_setup_p1p2p3_nonWF_clonal + "survival(p1) { return p2; } 10 early() { stop(); }", __LINE__);
2484-
SLiMAssertScriptStop(gen1_setup_p1p2p3_nonWF_clonal + "survival(p1) { stop(); } 10 early() { ; }", __LINE__);
2485-
2486-
SLiMAssertScriptSuccess(gen1_setup_p1p2p3_nonWF_clonal + "survival(p4) { stop(); } 10 early() { ; }", __LINE__);
2487-
2488-
SLiMAssertScriptSuccess(gen1_setup_p1p2p3_nonWF_clonal + "early() { s1.active = 0; } s1 survival(p1) { stop(); } 10 early() { ; }", __LINE__);
2489-
2490-
SLiMAssertScriptRaise(gen1_setup_p1p2p3_nonWF_clonal + "survival(m1) { stop(); } 10 early() { ; }", "identifier prefix 'p' was expected", __LINE__);
2491-
SLiMAssertScriptRaise(gen1_setup_p1p2p3_nonWF_clonal + "survival(p1, p1) { stop(); } 10 early() { ; }", "unexpected token", __LINE__);
2492-
SLiMAssertScriptRaise(gen1_setup_p1p2p3_nonWF_clonal + "survival(NULL) { stop(); } 10 early() { ; }", "identifier prefix 'p' was expected", __LINE__);
2493-
2494-
SLiMAssertScriptRaise(gen1_setup_p1p2p3_nonWF_clonal + "survival(p1) { ; } 10 early() { ; }", "return value", __LINE__);
2495-
SLiMAssertScriptRaise(gen1_setup_p1p2p3_nonWF_clonal + "survival(p1) { return 1; } 10 early() { ; }", "return value", __LINE__);
2496-
SLiMAssertScriptRaise(gen1_setup_p1p2p3_nonWF_clonal + "survival(p1) { return 1.0; } 10 early() { ; }", "return value", __LINE__);
2497-
SLiMAssertScriptRaise(gen1_setup_p1p2p3_nonWF_clonal + "survival(p1) { return 'a'; } 10 early() { ; }", "return value", __LINE__);
2498-
2499-
SLiMAssertScriptRaise(gen1_setup_p1p2p3_nonWF_clonal + "survival(p1) { subpop; ; } 10 early() { ; }", "return value", __LINE__);
2500-
SLiMAssertScriptRaise(gen1_setup_p1p2p3_nonWF_clonal + "survival(p1) { subpop; return 1; } 10 early() { ; }", "return value", __LINE__);
2501-
SLiMAssertScriptRaise(gen1_setup_p1p2p3_nonWF_clonal + "survival(p1) { subpop; return 1.0; } 10 early() { ; }", "return value", __LINE__);
2502-
SLiMAssertScriptRaise(gen1_setup_p1p2p3_nonWF_clonal + "survival(p1) { subpop; return 'a'; } 10 early() { ; }", "return value", __LINE__);
2503-
2504-
SLiMAssertScriptStop(gen1_setup_p1p2p3_nonWF_clonal + "survival(p1) { individual; subpop; fitness; draw; return T; } 10 early() { stop(); }", __LINE__);
2486+
SLiMAssertScriptStop(gen1_setup_p1p2p3_nonWF_clone + "survival() { return F; } 10 early() { if (p1.individualCount == 0) stop(); }", __LINE__);
2487+
SLiMAssertScriptStop(gen1_setup_p1p2p3_nonWF_clone + "survival() { return T; } 10 early() { if (p1.individualCount == 5120) stop(); }", __LINE__);
2488+
SLiMAssertScriptStop(gen1_setup_p1p2p3_nonWF_clone + "survival() { return NULL; } 10 early() { stop(); }", __LINE__);
2489+
//SLiMAssertScriptStop(gen1_setup_p1p2p3_nonWF_clone + "survival() { if (subpop == p1) return p2; return NULL; } 10 early() { stop(); }", __LINE__);
2490+
SLiMAssertScriptStop(gen1_setup_p1p2p3_nonWF_clone + "survival() { stop(); } 10 early() { ; }", __LINE__);
2491+
SLiMAssertScriptStop(gen1_setup_p1p2p3_nonWF_clone + "survival(p1) { return F; } 10 early() { if (p1.individualCount == 0) stop(); }", __LINE__);
2492+
SLiMAssertScriptStop(gen1_setup_p1p2p3_nonWF_clone + "survival(p1) { return T; } 10 early() { if (p1.individualCount == 5120) stop(); }", __LINE__);
2493+
SLiMAssertScriptStop(gen1_setup_p1p2p3_nonWF_clone + "survival(p1) { return NULL; } 10 early() { stop(); }", __LINE__);
2494+
//SLiMAssertScriptStop(gen1_setup_p1p2p3_nonWF_clone + "survival(p1) { return p2; } 10 early() { stop(); }", __LINE__);
2495+
SLiMAssertScriptStop(gen1_setup_p1p2p3_nonWF_clone + "survival(p1) { stop(); } 10 early() { ; }", __LINE__);
2496+
2497+
SLiMAssertScriptSuccess(gen1_setup_p1p2p3_nonWF_clone + "survival(p4) { stop(); } 10 early() { ; }", __LINE__);
2498+
2499+
SLiMAssertScriptSuccess(gen1_setup_p1p2p3_nonWF_clone + "early() { s1.active = 0; } s1 survival(p1) { stop(); } 10 early() { ; }", __LINE__);
2500+
2501+
SLiMAssertScriptRaise(gen1_setup_p1p2p3_nonWF_clone + "survival(m1) { stop(); } 10 early() { ; }", "identifier prefix 'p' was expected", __LINE__);
2502+
SLiMAssertScriptRaise(gen1_setup_p1p2p3_nonWF_clone + "survival(p1, p1) { stop(); } 10 early() { ; }", "unexpected token", __LINE__);
2503+
SLiMAssertScriptRaise(gen1_setup_p1p2p3_nonWF_clone + "survival(NULL) { stop(); } 10 early() { ; }", "identifier prefix 'p' was expected", __LINE__);
2504+
2505+
SLiMAssertScriptRaise(gen1_setup_p1p2p3_nonWF_clone + "survival(p1) { ; } 10 early() { ; }", "return value", __LINE__);
2506+
SLiMAssertScriptRaise(gen1_setup_p1p2p3_nonWF_clone + "survival(p1) { return 1; } 10 early() { ; }", "return value", __LINE__);
2507+
SLiMAssertScriptRaise(gen1_setup_p1p2p3_nonWF_clone + "survival(p1) { return 1.0; } 10 early() { ; }", "return value", __LINE__);
2508+
SLiMAssertScriptRaise(gen1_setup_p1p2p3_nonWF_clone + "survival(p1) { return 'a'; } 10 early() { ; }", "return value", __LINE__);
2509+
2510+
SLiMAssertScriptRaise(gen1_setup_p1p2p3_nonWF_clone + "survival(p1) { subpop; ; } 10 early() { ; }", "return value", __LINE__);
2511+
SLiMAssertScriptRaise(gen1_setup_p1p2p3_nonWF_clone + "survival(p1) { subpop; return 1; } 10 early() { ; }", "return value", __LINE__);
2512+
SLiMAssertScriptRaise(gen1_setup_p1p2p3_nonWF_clone + "survival(p1) { subpop; return 1.0; } 10 early() { ; }", "return value", __LINE__);
2513+
SLiMAssertScriptRaise(gen1_setup_p1p2p3_nonWF_clone + "survival(p1) { subpop; return 'a'; } 10 early() { ; }", "return value", __LINE__);
2514+
2515+
SLiMAssertScriptStop(gen1_setup_p1p2p3_nonWF_cross + "survival(p1) { if (!isNULL(individual) & !isNULL(subpop) & !isNULL(surviving) & !isNULL(fitness) & !isNULL(draw)) return T; } 10 early() { stop(); }", __LINE__);
2516+
SLiMAssertScriptStop(gen1_setup_p1p2p3_nonWF_clone + "survival(p1) { if (!isNULL(individual) & !isNULL(subpop) & !isNULL(surviving) & !isNULL(fitness) & !isNULL(draw)) return T; } 10 early() { stop(); }", __LINE__);
25052517

25062518
// Test tick range expressions
25072519
SLiMAssertScriptStop("initialize() { defineConstant('N', 5); } 1 early() {} early() { if (community.tick == 1) stop(); }", __LINE__);

0 commit comments

Comments
 (0)