<commit_before>#!/bin/sh

BASEDIR="`dirname $0`/.."

FULLVER="$1"

case $FULLVER in
  2.10.2)
    VER=2.10
    ;;
  2.10.3)
    VER=2.10
    ;;
  2.10.4)
    VER=2.10
    ;;
  2.11.0)
    VER=2.11
    ;;
  2.11.1)
    VER=2.11
    ;;
  2.11.2)
    VER=2.11
    ;;
esac

REVERSI_PREOPT_SIZE=$(stat '-c%s' "$BASEDIR/examples/reversi/target/scala-$VER/reversi-fastopt.js")
REVERSI_OPT_SIZE=$(stat '-c%s' "$BASEDIR/examples/reversi/target/scala-$VER/reversi-opt.js")

case $FULLVER in
  2.10.2)
    REVERSI_PREOPT_EXPECTEDSIZE=1004000
    REVERSI_OPT_EXPECTEDSIZE=159000
    ;;
  2.10.3)
    REVERSI_PREOPT_EXPECTEDSIZE=999000
    REVERSI_OPT_EXPECTEDSIZE=159000
    ;;
  2.10.4)
    REVERSI_PREOPT_EXPECTEDSIZE=999000
    REVERSI_OPT_EXPECTEDSIZE=159000
    ;;
  2.11.0)
    REVERSI_PREOPT_EXPECTEDSIZE=939000
    REVERSI_OPT_EXPECTEDSIZE=150000
    ;;
  2.11.1)
    REVERSI_PREOPT_EXPECTEDSIZE=939000
    REVERSI_OPT_EXPECTEDSIZE=150000
    ;;
  2.11.2)
    REVERSI_PREOPT_EXPECTEDSIZE=937000
    REVERSI_OPT_EXPECTEDSIZE=149000
    ;;
esac

echo "Reversi preopt size = $REVERSI_PREOPT_SIZE (expected $REVERSI_PREOPT_EXPECTEDSIZE)"
echo "Reversi opt size = $REVERSI_OPT_SIZE (expected $REVERSI_OPT_EXPECTEDSIZE)"

[ "$REVERSI_PREOPT_SIZE" -le "$REVERSI_PREOPT_EXPECTEDSIZE" ] && \
  [ "$REVERSI_OPT_SIZE" -le "$REVERSI_OPT_EXPECTEDSIZE" ]<commit_msg>Fix #1172: Also run checksizes over gzipped sizes<commit_after>#!/bin/sh

BASEDIR="`dirname $0`/.."

FULLVER="$1"

case $FULLVER in
  2.10.2)
    VER=2.10
    ;;
  2.10.3)
    VER=2.10
    ;;
  2.10.4)
    VER=2.10
    ;;
  2.11.0)
    VER=2.11
    ;;
  2.11.1)
    VER=2.11
    ;;
  2.11.2)
    VER=2.11
    ;;
esac

REVERSI_PREOPT="$BASEDIR/examples/reversi/target/scala-$VER/reversi-fastopt.js"
REVERSI_OPT="$BASEDIR/examples/reversi/target/scala-$VER/reversi-opt.js"

REVERSI_PREOPT_SIZE=$(stat '-c%s' "$REVERSI_PREOPT")
REVERSI_OPT_SIZE=$(stat '-c%s' "$REVERSI_OPT")

gzip "$REVERSI_PREOPT"
gzip "$REVERSI_OPT"

REVERSI_PREOPT_GZ_SIZE=$(stat '-c%s' "$REVERSI_PREOPT.gz")
REVERSI_OPT_GZ_SIZE=$(stat '-c%s' "$REVERSI_OPT.gz")

case $FULLVER in
  2.10.2)
    REVERSI_PREOPT_EXPECTEDSIZE=1004000
    REVERSI_OPT_EXPECTEDSIZE=159000
    REVERSI_PREOPT_GZ_EXPECTEDSIZE=108000
    REVERSI_OPT_GZ_EXPECTEDSIZE=42000
    ;;
  2.10.3)
    REVERSI_PREOPT_EXPECTEDSIZE=999000
    REVERSI_OPT_EXPECTEDSIZE=159000
    REVERSI_PREOPT_GZ_EXPECTEDSIZE=108000
    REVERSI_OPT_GZ_EXPECTEDSIZE=42000
    ;;
  2.10.4)
    REVERSI_PREOPT_EXPECTEDSIZE=999000
    REVERSI_OPT_EXPECTEDSIZE=159000
    REVERSI_PREOPT_GZ_EXPECTEDSIZE=108000
    REVERSI_OPT_GZ_EXPECTEDSIZE=42000
    ;;
  2.11.0)
    REVERSI_PREOPT_EXPECTEDSIZE=939000
    REVERSI_OPT_EXPECTEDSIZE=150000
    REVERSI_PREOPT_GZ_EXPECTEDSIZE=103000
    REVERSI_OPT_GZ_EXPECTEDSIZE=38000
    ;;
  2.11.1)
    REVERSI_PREOPT_EXPECTEDSIZE=939000
    REVERSI_OPT_EXPECTEDSIZE=150000
    REVERSI_PREOPT_GZ_EXPECTEDSIZE=103000
    REVERSI_OPT_GZ_EXPECTEDSIZE=38000
    ;;
  2.11.2)
    REVERSI_PREOPT_EXPECTEDSIZE=937000
    REVERSI_OPT_EXPECTEDSIZE=149000
    REVERSI_PREOPT_GZ_EXPECTEDSIZE=103000
    REVERSI_OPT_GZ_EXPECTEDSIZE=38000
    ;;
esac

echo "Checksizes: Scala version: $FULLVER"
echo "Reversi preopt size = $REVERSI_PREOPT_SIZE (expected $REVERSI_PREOPT_EXPECTEDSIZE)"
echo "Reversi opt size = $REVERSI_OPT_SIZE (expected $REVERSI_OPT_EXPECTEDSIZE)"
echo "Reversi preopt gzip size = $REVERSI_PREOPT_GZ_SIZE (expected $REVERSI_PREOPT_GZ_EXPECTEDSIZE)"
echo "Reversi opt gzip size = $REVERSI_OPT_GZ_SIZE (expected $REVERSI_OPT_GZ_EXPECTEDSIZE)"

[ "$REVERSI_PREOPT_SIZE" -le "$REVERSI_PREOPT_EXPECTEDSIZE" ] && \
  [ "$REVERSI_OPT_SIZE" -le "$REVERSI_OPT_EXPECTEDSIZE" ] && \
  [ "$REVERSI_PREOPT_GZ_SIZE" -le "$REVERSI_PREOPT_GZ_EXPECTEDSIZE" ] && \
  [ "$REVERSI_OPT_GZ_SIZE" -le "$REVERSI_OPT_GZ_EXPECTEDSIZE" ]
{'fraction_non_alphanumeric': 0.1199475065616798, 'fraction_numerical': 0.09238845144356955, 'mean_word_length': 4.263812154696133, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4463904', 'n_tokens_mistral': 1912, 'n_tokens_neox': 1755, 'n_words': 194}