@@ -126,7 +126,7 @@ Anti-triggers: 0
126126 ⚠️ body-structure: Advisory 17: body structure quality — body lacks actionable instructions (no code blocks, numbered steps, or commands); no examples section found; no error handling or troubleshooting section found
127127 ✅ progressive-disclosure: Content structure supports progressive disclosure
128128`
129- require . Equal (t , expected , buf .String ())
129+ requireOutputMatch (t , expected , buf .String (), skill . Tokens )
130130}
131131
132132func TestDevLoop_ScoreProgressionPath (t * testing.T ) {
@@ -199,6 +199,9 @@ Already meets Medium-High target.
199199 err := runDevLoop (cfg )
200200 require .NoError (t , err )
201201
202+ sk , err := readSkillFile (filepath .Join (skillDir , "SKILL.md" ))
203+ require .NoError (t , err )
204+
202205 expected := `Skill: compliant-skill
203206Score: High
204207Tokens: 94
@@ -236,7 +239,7 @@ MCP Integration: 1/4
236239
237240✅ Target adherence level High reached!
238241`
239- require . Equal (t , expected , buf .String ())
242+ requireOutputMatch (t , expected , buf .String (), sk . Tokens )
240243}
241244
242245func TestDevLoop_RunDevLoop_MaxIterationsHit (t * testing.T ) {
@@ -254,6 +257,9 @@ description: "Short"
254257`
255258 require .NoError (t , os .WriteFile (filepath .Join (skillDir , "SKILL.md" ), []byte (skillContent ), 0o644 ))
256259
260+ initialSkill , err := readSkillFile (filepath .Join (skillDir , "SKILL.md" ))
261+ require .NoError (t , err )
262+
257263 var buf bytes.Buffer
258264 cfg := & devConfig {
259265 SkillDir : skillDir ,
@@ -264,7 +270,7 @@ description: "Short"
264270 In : & bytes.Buffer {},
265271 }
266272
267- err : = runDevLoop (cfg )
273+ err = runDevLoop (cfg )
268274 require .NoError (t , err )
269275
270276 expected := `
@@ -324,7 +330,7 @@ Short. Provides comprehensive support for common use cases and edge cases. Provi
324330║ TOKEN STATUS: ✅ Under budget (66 < 500) ║
325331╚══════════════════════════════════════════════════════════════════╝
326332`
327- require . Equal (t , expected , buf .String ())
333+ requireOutputMatch (t , expected , buf .String (), initialSkill . Tokens )
328334}
329335
330336func TestDevConfig_Defaults (t * testing.T ) {
@@ -365,6 +371,9 @@ description: "Short"
365371`
366372 require .NoError (t , os .WriteFile (filepath .Join (skillDir , "SKILL.md" ), []byte (skillContent ), 0o644 ))
367373
374+ initialSkill , err := readSkillFile (filepath .Join (skillDir , "SKILL.md" ))
375+ require .NoError (t , err )
376+
368377 var buf bytes.Buffer
369378 cfg := & devConfig {
370379 SkillDir : skillDir ,
@@ -375,7 +384,7 @@ description: "Short"
375384 In : & bytes.Buffer {},
376385 }
377386
378- err : = runDevLoop (cfg )
387+ err = runDevLoop (cfg )
379388 require .NoError (t , err )
380389
381390 expected := `
@@ -552,7 +561,7 @@ Anti-triggers: 2
552561║ TOKEN STATUS: ✅ Under budget (162 < 500) ║
553562╚══════════════════════════════════════════════════════════════════╝
554563`
555- require . Equal (t , expected , buf .String ())
564+ requireOutputMatch (t , expected , buf .String (), initialSkill . Tokens )
556565
557566 final , err := readSkillFile (filepath .Join (skillDir , "SKILL.md" ))
558567 require .NoError (t , err )
@@ -580,6 +589,9 @@ description: "Short"
580589`
581590 require .NoError (t , os .WriteFile (filepath .Join (skillDir , "SKILL.md" ), []byte (skillContent ), 0o644 ))
582591
592+ initialSkill , err := readSkillFile (filepath .Join (skillDir , "SKILL.md" ))
593+ require .NoError (t , err )
594+
583595 var buf bytes.Buffer
584596 cfg := & devConfig {
585597 SkillDir : skillDir ,
@@ -590,7 +602,7 @@ description: "Short"
590602 In : strings .NewReader ("" ),
591603 }
592604
593- err : = runDevLoop (cfg )
605+ err = runDevLoop (cfg )
594606 require .NoError (t , err )
595607
596608 expected := `
@@ -641,5 +653,5 @@ USE FOR: declined-skill, declined-skill help, use declined-skill, how to decline
641653
642654No improvements applied.
643655`
644- require . Equal (t , expected , buf .String ())
656+ requireOutputMatch (t , expected , buf .String (), initialSkill . Tokens )
645657}
0 commit comments