Skip to content

test(poster): achieve >85% package test coverage and resolve codebase TODOs - #174

Merged
adcondev merged 1 commit into
masterfrom
test/coverage-and-todo-hygiene
Oct 18, 2026
Merged

adcondev merged 1 commit into
masterfrom
test/coverage-and-todo-hygiene

Conversation

@adcondev

Copy link
Copy Markdown
Owner

Summary (Area 6 of 6, Final PR)

  • Comprehensive Package Test Coverage (all library packages >= 85%):
    • internal/calculate: 100.0%
    • internal/load: 93.9% (added internal/load/loaders_test.go)
    • internal/testutils: 100.0% (added internal/testutils/assertions_test.go)
    • pkg/commands/barcode: 100.0%
    • pkg/commands/bitimage: 87.1% (expanded bitimage_test.go)
    • pkg/commands/character: 94.5%
    • pkg/commands/linespacing: 100.0%
    • pkg/commands/mechanismcontrol: 95.7%
    • pkg/commands/print: 97.1%
    • pkg/commands/printposition: 100.0%
    • pkg/commands/qrcode: 100.0%
    • pkg/commands/shared: 100.0% (added pkg/commands/shared/shared_test.go)
    • pkg/composer: 100.0% (expanded escpos_composer_test.go)
    • pkg/connection: 87.6%
    • pkg/constants: 100.0% (added constants_test.go)
    • pkg/document/builder: 90.5%
    • pkg/document/executor: 85.2% (expanded handler tests)
    • pkg/document/schema: 96.7%
    • pkg/emulator: 86.9% (expanded printer_adapter_test.go)
    • pkg/emulator/fonts: 85.0% (added embed_test.go)
    • pkg/graphics: 86.0% (added qr_test.go, barcode_test.go, loaders_test.go)
    • pkg/profile: 98.8%
    • pkg/service: 90.2% (added printer_service_test.go)
    • pkg/tables: 92.6%
    • cmd/poster: 50.0% (expanded parsing_test.go)
  • Codebase Hygiene:
    • Removed all remaining 40 TODO and FIXME comments across cmd/, internal/, and pkg/ (0 remaining).
    • Aligned PrintLine with Print to use EncodeBytesSafe for consistent typography normalization, multi-codepage switching, and error handling.
    • Updated README.md and AGENTS.md with all architectural additions (transports, dithering, PDF417, magic encode, reverse ESC/POS parser, profile catalog, and coverage floor).

@github-actions

Copy link
Copy Markdown
Contributor

👋 Thanks for opening this PR, @adcondev!

Here's what will happen next:

  • 🤖 Automated checks will run
  • 🏷️ Labels will be added automatically
  • 👀 A maintainer will review your changes

Please make sure:

  • ✅ All tests pass
  • 📝 The PR title follows conventional commits
  • 📋 The PR template is filled out completely

@adcondev
adcondev merged commit 5dea88a into master Oct 18, 2026
10 of 12 checks passed
@adcondev
adcondev deleted the test/coverage-and-todo-hygiene branch October 18, 2026 20:53
@github-actions

Copy link
Copy Markdown
Contributor

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

@github-actions

Copy link
Copy Markdown
Contributor

⚡ Benchmark Results

📈 Performance Comparison

📊 Click to expand detailed results

Current Branch Results

BenchmarkNewDocument-4    	1000000000	         0.3118 ns/op	       0 B/op	       0 allocs/op
BenchmarkBuildSimple-4    	 3614272	       335.2 ns/op	     240 B/op	       4 allocs/op
BenchmarkBuildComplex-4   	  390684	      2976 ns/op	    1856 B/op	      29 allocs/op
BenchmarkToJSON-4         	  503034	      2081 ns/op	     592 B/op	       3 allocs/op
BenchmarkParseDocument_Minimal-4    	  493898	      2318 ns/op	     568 B/op	      14 allocs/op
BenchmarkParseDocument_Receipt-4    	   92494	     12777 ns/op	    2392 B/op	      34 allocs/op
BenchmarkCommandUnmarshal_Text-4    	  412550	      2747 ns/op	     568 B/op	      19 allocs/op
BenchmarkCommandUnmarshal_Table-4   	  271966	      4304 ns/op	     952 B/op	      22 allocs/op
BenchmarkTextCommandParsing-4       	  517328	      2159 ns/op	     544 B/op	      16 allocs/op
BenchmarkTableCommandParsing-4      	  237054	      4896 ns/op	    1000 B/op	      31 allocs/op
BenchmarkParseHexString-4           	 8465854	       139.8 ns/op	      48 B/op	       2 allocs/op
BenchmarkCleanHexString-4           	 7452882	       165.9 ns/op	      64 B/op	       2 allocs/op
BenchmarkContainsSequence-4         	296221904	         4.066 ns/op	       0 B/op	       0 allocs/op
BenchmarkCheckCriticalCommands-4    	35752399	        39.62 ns/op	       0 B/op	       0 allocs/op
BenchmarkDocument_Validate-4       	14552775	        82.74 ns/op	       0 B/op	       0 allocs/op
BenchmarkParseDocument_Simple-4    	  489682	      2411 ns/op	     568 B/op	      14 allocs/op
BenchmarkParseDocument_Complex-4   	  137690	      8555 ns/op	    1352 B/op	      26 allocs/op
BenchmarkPrintImage_Small-4             	     608	   1983063 ns/op	 3469950 B/op	      24 allocs/op
BenchmarkPrintImage_Medium-4            	     316	   3794483 ns/op	 5481085 B/op	      24 allocs/op
BenchmarkPrintImage_ThermalPreview-4    	     138	   8534619 ns/op	 5231180 B/op	  230423 allocs/op

Base Branch Results

BenchmarkNewDocument-4    	1000000000	         0.3126 ns/op	       0 B/op	       0 allocs/op
BenchmarkBuildSimple-4    	 3597248	       334.9 ns/op	     240 B/op	       4 allocs/op
BenchmarkBuildComplex-4   	  368043	      2913 ns/op	    1856 B/op	      29 allocs/op
BenchmarkToJSON-4         	  529432	      2096 ns/op	     592 B/op	       3 allocs/op
BenchmarkParseDocument_Minimal-4    	  489033	      2352 ns/op	     568 B/op	      14 allocs/op
BenchmarkParseDocument_Receipt-4    	   95470	     12479 ns/op	    2392 B/op	      34 allocs/op
BenchmarkCommandUnmarshal_Text-4    	  403315	      2826 ns/op	     568 B/op	      19 allocs/op
BenchmarkCommandUnmarshal_Table-4   	  264301	      4353 ns/op	     952 B/op	      22 allocs/op
BenchmarkTextCommandParsing-4       	  502298	      2221 ns/op	     544 B/op	      16 allocs/op
BenchmarkTableCommandParsing-4      	  237940	      4918 ns/op	    1000 B/op	      31 allocs/op
BenchmarkParseHexString-4           	 7840002	       152.6 ns/op	      48 B/op	       2 allocs/op
BenchmarkCleanHexString-4           	 7067659	       169.7 ns/op	      64 B/op	       2 allocs/op
BenchmarkContainsSequence-4         	295463491	         4.062 ns/op	       0 B/op	       0 allocs/op
BenchmarkCheckCriticalCommands-4    	32975506	        37.01 ns/op	       0 B/op	       0 allocs/op
BenchmarkDocument_Validate-4       	14516366	        83.24 ns/op	       0 B/op	       0 allocs/op
BenchmarkParseDocument_Simple-4    	  491850	      2421 ns/op	     568 B/op	      14 allocs/op
BenchmarkParseDocument_Complex-4   	  137174	      8620 ns/op	    1352 B/op	      26 allocs/op
BenchmarkPrintImage_Small-4             	     597	   1979382 ns/op	 3469941 B/op	      24 allocs/op
BenchmarkPrintImage_Medium-4            	     321	   3696051 ns/op	 5481103 B/op	      24 allocs/op
BenchmarkPrintImage_ThermalPreview-4    	     138	   8869940 ns/op	 5231182 B/op	  230423 allocs/op

💡 Note: Use benchstat for statistical comparison

🎯 Summary

  • Total Benchmarks: 32
  • Average Speed: 2637980 ns/op
  • Average Memory: 2396769 B/op
  • Average Allocations: 41077 allocs/op

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant