↓ Skip to main content

Test Code Post

·118 words·1 min·
lrweck
Author
lrweck
Developer writing about tech, observations, and experiments.
Table of Contents
layout-testing - This article is part of a series.
Part 2: This Article

This post checks the code copy button and syntax highlighting across languages.

Go
#

package main

import "fmt"

func main() {
    m := map[string]int{"a": 1, "b": 2}
    for k, v := range m {
        fmt.Printf("%s=%d\n", k, v)
    }
}

Bash
#

#!/bin/bash
for f in *.md; do
    echo "Processing $f"
    wc -l "$f"
done

SQL
#

SELECT user_id, count(*) AS total
FROM events
WHERE created_at > NOW() - interval '1 day'
GROUP BY user_id
ORDER BY total DESC
LIMIT 10;

Inline
#

Wrap code like docker compose up and go test ./... to see inline styles.

JSON
#

{
  "site": "posts",
  "build": { "hugo": "0.165.0", "docker": true },
  "theme": "blowfish"
}
graph LR
    A[Build] --> B[Test] --> C[Deploy]
layout-testing - This article is part of a series.
Part 2: This Article

Related