@@ -317,6 +317,45 @@ describe('include - error messages', () => {
317317 ` ) ;
318318 } ) ;
319319 } ) ;
320+
321+ describe ( 'infinite recursion of instruction' , ( ) => {
322+ const includes = makeIncludes (
323+ [ 'self_reference_1' , '{{includes.self_reference_1}}' ] ,
324+ [ 'self_reference_2' , 'include self_reference_2' ] ,
325+ ) ;
326+
327+ it ( 'includes placeholder should give meaningful error message about self-referencing instructions BUT DOES NOT' , ( ) => {
328+ const query = createQuery ( '{{includes.self_reference_1}}' , includes ) ;
329+ expect ( query . error ) . toMatchInlineSnapshot ( `
330+ "Could not interpret the following instruction as a Boolean combination:
331+ {{includes.self_reference_1}}
332+
333+ The error message is:
334+ couldn't parse sub-expression 'includes.self_reference_1'
335+
336+ The instruction was converted to the following simplified line:
337+ ((f1))
338+
339+ Where the sub-expressions in the simplified line are:
340+ 'f1': 'includes.self_reference_1'
341+ => ERROR:
342+ do not understand query
343+
344+ For help, see:
345+ https://publish.obsidian.md/tasks/Queries/Combining+Filters
346+
347+ Problem line: "{{includes.self_reference_1}}""
348+ ` ) ;
349+ } ) ;
350+
351+ it ( 'include instruction should give meaningful error message about self-referencing instructions BUT DOES NOT' , ( ) => {
352+ const query = createQuery ( 'include self_reference_2' , includes ) ;
353+ expect ( query . error ) . toMatchInlineSnapshot ( `
354+ "Maximum call stack size exceeded
355+ Problem line: "include self_reference_2""
356+ ` ) ;
357+ } ) ;
358+ } ) ;
320359} ) ;
321360
322361describe ( 'include settings tests' , ( ) => {
0 commit comments