테스트: 맥OS 스타일 코드박스 적용 확인

깃헙 블로그에 맥OS 스타일 코드박스가 잘 적용되었는지 확인하기 위한 테스트 글입니다.

1. Bash 터미널 코드 테스트

이미지로 보여주셨던 시스템 도구 설치 명령어를 그대로 작성해 보았습니다. 상단에 빨강, 노랑, 초록색 윈도우 버튼과 어두운 배경이 잘 나오는지 확인해 보세요.

sudo apt update && sudo apt upgrade -y
sudo apt install git curl build-essential -y
def fetch_stock_data(ticker):
    # 주식 데이터를 가져오는 가상의 API 호출 함수입니다.
    print(f"[{ticker}] 데이터를 불러오는 중입니다...")
    url = f"[https://api.example.com/stock/](https://api.example.com/stock/){ticker}"
    
    data = {
        "ticker": ticker,
        "price": 85000,
        "status": "success"
    }
    return data

if __name__ == "__main__":
    my_stock = fetch_stock_data("삼성전자")
    print("결과:", my_stock)

2. Verilog/SystemVerilog/VHDL 코드 블록 테스트

비동기 리셋을 포함한 간단한 D 플립플롭(D Flip-Flop) 모듈입니다. 상단 패널에 ‘Verilog’ 제목이 출력되는지와 module, wire, reg, always 키워드가 정상적으로 강조되는지 확인합니다.

module d_ff (
    input wire clk,
    input wire rst_n,
    input wire d,
    output reg q
);

    always @(posedge clk or negedge rst_n) begin
        if (!rst_n) begin
            q <= 1'b0;
        end else begin
            q <= d;
        end
    end

endmodule

인터페이스(Interface)와 always_ff 구문을 활용한 레지스터 모듈입니다. 상단 패널에 ‘SystemVerilog’ 제목이 출력되는지와 logic, interface, modport, always_ff 등 SystemVerilog 전용 키워드가 정상적으로 인식되는지 확인합니다.

interface bus_if (input logic clk);
    logic [7:0]  addr;
    logic [31:0] data;
    logic        valid;

    modport master (output addr, data, valid, input clk);
    modport slave  (input addr, data, valid, clk);
endinterface

module data_reg (
    input  logic clk,
    input  logic rst_n,
    input  logic [31:0] d_in,
    output logic [31:0] q_out
);

    always_ff @(posedge clk or negedge rst_n) begin
        if (!rst_n)
            q_out <= '0;
        else
            q_out <= d_in;
    end

endmodule
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;

entity d_ff is
    Port ( clk : in STD_LOGIC;
           d   : in STD_LOGIC;
           q   : out STD_LOGIC);
end d_ff;

architecture Behavioral of d_ff is
begin
    process(clk)
    begin
        if rising_edge(clk) then
            q <= d;
        end if;
    end process;
end Behavioral;