Functional Weave
Code in Rust

legal.limitation-date@1.0.1

vectors.json

6,694 bytes · view raw

[
 {
  "name": "a contract breached on 15 March 2020 may be sued on until 15 March 2026",
  "args": [
   "contract",
   "2020-03-15",
   null
  ],
  "expect": {
   "claimType": "contract",
   "years": 6,
   "section": "s.5",
   "runsFrom": "2020-03-15",
   "expiry": "2026-03-15"
  }
 },
 {
  "name": "the anniversary, not 6 x 365 days (which lands on 14 March 2026)",
  "args": [
   "tort",
   "2020-03-15",
   null
  ],
  "expect": {
   "claimType": "tort",
   "years": 6,
   "section": "s.2",
   "runsFrom": "2020-03-15",
   "expiry": "2026-03-15"
  }
 },
 {
  "name": "accrued on 29 February: no corresponding date in 2026, so the end of February",
  "args": [
   "contract",
   "2020-02-29",
   null
  ],
  "expect": {
   "claimType": "contract",
   "years": 6,
   "section": "s.5",
   "runsFrom": "2020-02-29",
   "expiry": "2026-02-28"
  }
 },
 {
  "name": "accrued on 28 February: the anniversary, not 29 February in a leap year",
  "args": [
   "tort",
   "2019-02-28",
   null
  ],
  "expect": {
   "claimType": "tort",
   "years": 6,
   "section": "s.2",
   "runsFrom": "2019-02-28",
   "expiry": "2025-02-28"
  }
 },
 {
  "name": "accrued on 31 December: expires 31 December, not 30th or 1 January",
  "args": [
   "deed",
   "2014-12-31",
   null
  ],
  "expect": {
   "claimType": "deed",
   "years": 12,
   "section": "s.8(1)",
   "runsFrom": "2014-12-31",
   "expiry": "2026-12-31"
  }
 },
 {
  "name": "personal injury with no later knowledge: 3 years from the accident",
  "args": [
   "personal-injury",
   "2023-06-01",
   null
  ],
  "expect": {
   "claimType": "personal-injury",
   "years": 3,
   "section": "s.11(4)",
   "runsFrom": "2023-06-01",
   "expiry": "2026-06-01"
  }
 },
 {
  "name": "personal injury: a later date of knowledge starts the clock",
  "args": [
   "personal-injury",
   "2015-01-10",
   "2024-11-30"
  ],
  "expect": {
   "claimType": "personal-injury",
   "years": 3,
   "section": "s.11(4)",
   "runsFrom": "2024-11-30",
   "expiry": "2027-11-30"
  }
 },
 {
  "name": "personal injury: a knowledge date before accrual changes nothing",
  "args": [
   "personal-injury",
   "2023-06-01",
   "2023-05-01"
  ],
  "expect": {
   "claimType": "personal-injury",
   "years": 3,
   "section": "s.11(4)",
   "runsFrom": "2023-06-01",
   "expiry": "2026-06-01"
  }
 },
 {
  "name": "fatal accident: 3 years from the date of death",
  "args": [
   "fatal-accident",
   "2024-02-29",
   null
  ],
  "expect": {
   "claimType": "fatal-accident",
   "years": 3,
   "section": "s.12(2)",
   "runsFrom": "2024-02-29",
   "expiry": "2027-02-28"
  }
 },
 {
  "name": "defamation: one year from publication",
  "args": [
   "defamation",
   "2025-10-01",
   null
  ],
  "expect": {
   "claimType": "defamation",
   "years": 1,
   "section": "s.4A",
   "runsFrom": "2025-10-01",
   "expiry": "2026-10-01"
  }
 },
 {
  "name": "defamation accruing on the day the 1996 Act's one-year period began",
  "args": [
   "defamation",
   "1996-09-04",
   null
  ],
  "expect": {
   "claimType": "defamation",
   "years": 1,
   "section": "s.4A",
   "runsFrom": "1996-09-04",
   "expiry": "1997-09-04"
  }
 },
 {
  "name": "malicious falsehood: one year",
  "args": [
   "malicious-falsehood",
   "2026-01-31",
   null
  ],
  "expect": {
   "claimType": "malicious-falsehood",
   "years": 1,
   "section": "s.4A",
   "runsFrom": "2026-01-31",
   "expiry": "2027-01-31"
  }
 },
 {
  "name": "contribution: two years from the judgment",
  "args": [
   "contribution",
   "2025-07-14",
   null
  ],
  "expect": {
   "claimType": "contribution",
   "years": 2,
   "section": "s.10(1)",
   "runsFrom": "2025-07-14",
   "expiry": "2027-07-14"
  }
 },
 {
  "name": "recovery of land: twelve years",
  "args": [
   "recovery-of-land",
   "2010-04-06",
   null
  ],
  "expect": {
   "claimType": "recovery-of-land",
   "years": 12,
   "section": "s.15(1)",
   "runsFrom": "2010-04-06",
   "expiry": "2022-04-06"
  }
 },
 {
  "name": "rent arrears: six years from the day each instalment fell due",
  "args": [
   "rent-arrears",
   "2021-03-25",
   null
  ],
  "expect": {
   "claimType": "rent-arrears",
   "years": 6,
   "section": "s.19",
   "runsFrom": "2021-03-25",
   "expiry": "2027-03-25"
  }
 },
 {
  "name": "mortgage principal: twelve years",
  "args": [
   "mortgage-principal",
   "2016-08-31",
   null
  ],
  "expect": {
   "claimType": "mortgage-principal",
   "years": 12,
   "section": "s.20(1)",
   "runsFrom": "2016-08-31",
   "expiry": "2028-08-31"
  }
 },
 {
  "name": "mortgage interest arrears: six years",
  "args": [
   "mortgage-interest",
   "2016-08-31",
   null
  ],
  "expect": {
   "claimType": "mortgage-interest",
   "years": 6,
   "section": "s.20(5)",
   "runsFrom": "2016-08-31",
   "expiry": "2022-08-31"
  }
 },
 {
  "name": "an action on a judgment: six years from when it became enforceable",
  "args": [
   "judgment",
   "2020-01-15",
   null
  ],
  "expect": {
   "claimType": "judgment",
   "years": 6,
   "section": "s.24(1)",
   "runsFrom": "2020-01-15",
   "expiry": "2026-01-15"
  }
 },
 {
  "name": "judgment interest arrears: six years",
  "args": [
   "judgment-interest",
   "2020-01-15",
   null
  ],
  "expect": {
   "claimType": "judgment-interest",
   "years": 6,
   "section": "s.24(2)",
   "runsFrom": "2020-01-15",
   "expiry": "2026-01-15"
  }
 },
 {
  "name": "sums recoverable by statute: six years",
  "args": [
   "statute-sum",
   "1981-05-01",
   null
  ],
  "expect": {
   "claimType": "statute-sum",
   "years": 6,
   "section": "s.9(1)",
   "runsFrom": "1981-05-01",
   "expiry": "1987-05-01"
  }
 },
 {
  "name": "an unknown claim type is an error",
  "args": [
   "negligence",
   "2020-01-01",
   null
  ],
  "expectError": "unknown claim type \"negligence\""
 },
 {
  "name": "a knowledge date for a contract claim is an error, not ignored",
  "args": [
   "contract",
   "2020-01-01",
   "2021-01-01"
  ],
  "expectError": "knowledgeDate must be null"
 },
 {
  "name": "defamation accruing before 4 September 1996 is not carried",
  "args": [
   "defamation",
   "1996-09-03",
   null
  ],
  "expectError": "no limitation rule for defamation accruing on 1996-09-03"
 },
 {
  "name": "a cause of action before the Act came into force is not carried",
  "args": [
   "contract",
   "1981-04-30",
   null
  ],
  "expectError": "no limitation rule for contract accruing on 1981-04-30"
 },
 {
  "name": "an impossible accrual date is an error",
  "args": [
   "contract",
   "2021-02-29",
   null
  ],
  "expectError": "not a real calendar date"
 },
 {
  "name": "an impossible knowledge date is an error",
  "args": [
   "personal-injury",
   "2021-02-01",
   "2021-13-01"
  ],
  "expectError": "2021-13-01"
 }
]