@@ -26,8 +26,10 @@ def read_win_file_if_exists(path)
2626
2727describe 'deferred values with dsc_lite' do
2828 let ( :control_manifest ) { read_fixture ( '01_file_deferred.pp' ) }
29+ let ( :dsc_control_manifest_epp ) { read_fixture ( '01b_file_deferred_with_epp.pp' ) }
2930 let ( :dsc_deferred_direct ) { read_fixture ( '02_dsc_deferred_direct.pp' ) }
3031 let ( :dsc_deferred_inline ) { read_fixture ( '02b_dsc_deferred_inline.pp' ) } # ← NEW
32+ let ( :dsc_deferred_epp_inline ) { read_fixture ( '02c_dsc_deferred_epp_inline.pp' ) } # ← NEW
3133 let ( :dsc_deferred_stringified ) { read_fixture ( '03a_dsc_deferred_stringified.pp' ) }
3234 let ( :dsc_deferred_bad_unwrap ) { read_fixture ( '03b_dsc_deferred_bad_unwrap.pp' ) }
3335
@@ -39,6 +41,14 @@ def read_win_file_if_exists(path)
3941 expect ( out [ :content ] . strip ) . to eq ( 'hello-file' )
4042 end
4143
44+ it 'control (01b): native file + Deferred resolves to hello-file (EPP)' do
45+ result = idempotent_apply_debug ( dsc_control_manifest_epp )
46+ expect ( result . exit_code ) . to eq ( 0 )
47+ out = read_win_file_if_exists ( 'C:/Temp/deferred_ok.txt' )
48+ expect ( out [ :exists ] ) . to be ( true )
49+ expect ( out [ :content ] . strip ) . to eq ( 'hello-file' )
50+ end
51+
4252 it '02: passing Deferred via variable to DSC resolves to hello-dsc (otherwise flag bug)' do
4353 apply = apply_manifest_debug ( dsc_deferred_direct )
4454 out = read_win_file_if_exists ( 'C:/Temp/from_dsc.txt' )
@@ -66,6 +76,20 @@ def read_win_file_if_exists(path)
6676 end
6777 end
6878
79+ # NEW 02c: inline Deferred on the DSC property (no variable intermediary)
80+ it '02c: passing a Deferred inline while calling an epp' do
81+ apply = apply_manifest_debug ( dsc_deferred_epp_inline )
82+ out = read_win_file_if_exists ( 'C:/Temp/from_dsc_inline.txt' )
83+ content = out [ :content ] . strip
84+ if out [ :exists ] && content == 'hello-dsc-epp'
85+ expect ( true ) . to be ( true )
86+ elsif out [ :exists ] && content =~ %r{Deferred\s *\( |Puppet::Pops::Types::Deferred}i
87+ raise "BUG: 02c wrote stringified Deferred: #{ content . inspect } \n Apply:\n #{ apply . stdout } #{ apply . stderr } "
88+ else
89+ raise "Unexpected 02c outcome. Exists=#{ out [ :exists ] } Content=#{ content . inspect } \n Apply:\n #{ apply . stdout } #{ apply . stderr } "
90+ end
91+ end
92+
6993 it '03a: stringifying a Deferred writes the function form (reproduces customer report)' do
7094 apply_manifest_debug ( dsc_deferred_stringified )
7195 out = read_win_file_if_exists ( 'C:/Temp/from_dsc_var_string.txt' )
0 commit comments