cln: Replace all uses of deprecated !include with include.

Also include a test which makes sure !include is still parsed.
This commit is contained in:
Stephen Morgan 2021-09-28 10:35:41 +10:00 committed by Simon Michael
parent d45311826b
commit 94d9c28a63
4 changed files with 20 additions and 10 deletions

View File

@ -1,8 +1,8 @@
; all years
!include 2006.journal
!include 2007.journal
!include 2008.journal
!include 2009.journal
!include 2010.journal
!include 2011.journal
include 2006.journal
include 2007.journal
include 2008.journal
include 2009.journal
include 2010.journal
include 2011.journal

View File

@ -1,4 +1,4 @@
; current/recent years
;!include 2010.journal
!include 2011.journal
;include 2010.journal
include 2011.journal

View File

@ -492,7 +492,7 @@ defaultyear_journal_txt = T.unlines
-- ]
-- journal4_str = unlines
-- ["!include \"somefile\""
-- ["include \"somefile\""
-- ,"2007/01/27 * joes diner"
-- ," expenses:food:dining $10.00"
-- ," assets:checking $-47.18"

View File

@ -1,5 +1,5 @@
# 1. nested includes in subdirectories
mkdir -p b/c/d ; printf '2010/1/1\n (D) 1\n' >b/c/d/d.journal ; printf '2010/1/1\n (C) 1\n!include d/d.journal\n' >b/c/c.journal ; printf '2010/1/1\n (B) 1\n!include c/c.journal\n' >b/b.journal ; printf '2010/1/1\n (A) 1\n!include b/b.journal\n' >a.journal ; hledger -f a.journal print; rm -rf a.journal b
mkdir -p b/c/d ; printf '2010/1/1\n (D) 1\n' >b/c/d/d.journal ; printf '2010/1/1\n (C) 1\ninclude d/d.journal\n' >b/c/c.journal ; printf '2010/1/1\n (B) 1\ninclude c/c.journal\n' >b/b.journal ; printf '2010/1/1\n (A) 1\ninclude b/b.journal\n' >a.journal ; hledger -f a.journal print; rm -rf a.journal bG
>>>
2010-01-01
(A) 1
@ -90,3 +90,13 @@ _c
_d
>>>2
>>>=0
# 9. include using old !include directive
printf '2018/01/01\n (A) 1\n' >f.journal; hledger -f - print; rm -f f.journal
<<<
!include f.journal
>>>
2018-01-01
(A) 1
>>>=0