QR tests MUST use native language libraries, not qrencode CLI. If the sandbox doesn't have the library, the test should FAIL honestly so we know what to fix in the sandbox image. Also adds CLAUDE.md rule to prevent future attempts to replace native library QR tests with CLI subprocess calls.
11 lines
365 B
Haskell
11 lines
365 B
Haskell
import Codec.QRCode
|
|
import Codec.QRCode.JuicyPixels
|
|
|
|
main :: IO ()
|
|
main = do
|
|
let mqr = encodeText defaultQRCodeOptions Iso8859_1OrUtf8WithoutECI "unsandbox-qr-ok"
|
|
case mqr of
|
|
Nothing -> putStrLn "QR encode failed"
|
|
Just img -> do
|
|
let matrix = toMatrix True False img :: [[Bool]]
|
|
putStrLn $ "QR:unsandbox-qr-ok:ROWS:" ++ show (length matrix)
|