#!/usr/bin/env perl
# POD spell-check via Test::Spelling. Skipped unless RELEASE_TESTING=1
# and aspell/hunspell are available; protects against accidental typos
# accumulating in the user-facing documentation.
use strict;
use warnings;
use Test::More;

plan skip_all => 'set RELEASE_TESTING=1 to run spelling tests'
    unless $ENV{RELEASE_TESTING};

eval { require Test::Spelling; Test::Spelling->import };
plan skip_all => 'Test::Spelling not installed' if $@;

# Project-specific terms the spell-checker shouldn't flag.
add_stopwords(qw(
    arrayref hashref filehandle backtrace
    Native ClickHouse encoder decoder Decoder
    XS XSUB Perl Perl-side
    UTF UTF-8 utf8 ASCII
    Int8 Int16 Int32 Int64 UInt UInt8 UInt16 UInt32 UInt64
    Float32 Float64 BFloat16
    DateTime DateTime64 ISO Decimal Decimals
    Enum8 Enum16 IPv4 IPv6 UUID UUIDs
    LowCardinality FixedString Nullable
    SimpleAggregateFunction
    Tuple Variant Map
    LineString MultiLineString MultiPolygon
    SQL TabSeparated tsv csv NDJSON JSONL
    HTTP Tiny PerlIO POSIX
    zstd gzip lz4
    backpressure cardinality compressor compressors
    croaks croaking croak's
    iter iterator iterators
    perlio Perl5 perl5
    pre-aggregate prefixed coderef coderefs
    rolled-up rollup nullable
    sub-column sub-columns sub-second
    Time::Piece Time::Moment
    coderef SvIV SvUV SvNV SvPV SvPVutf8
    ETL CTE TSV TabSeparated
    cpan CPAN PAUSE
    de_DE LC_NUMERIC
    Devel::Cover gv_fetchmeth ctype.h memcpy memcmp llround
    config wal_tailer
    UnitedStates
    blib autogenerated
    submatching pre-allocate roundtrip
    api APIs
    vividsnow
    SV TCP
    async env
    INSERTs firehose
    BRPOP XREADGROUP
    lossily schemas unparseable
    passthrough
    scalarref subcolumns SvNOK SvIOK SvIsBOOL
    CTEs POSTs SELECTs backoff TLS AVs
    CityHash cityhash CompressedReadBuffer
    hasher impl compat vendored Digest::CityHash Inline::C
    transactionally incompressible CompressedWriteBuffer
    uint uint64
    Liveness WKT inserter inserters params
    RowBinary DDL deduplicated framings interop
    jitter resynchronise backQuote
    varint varuint LEB codecs undecoded misparse
));

all_pod_files_spelling_ok('lib');
