#!/bin/bash
set -e

echo "Testing JupyterLab installation..."

# 1. Check that jupyterlab command exists
if ! command -v jupyter-lab >/dev/null 2>&1; then
  echo "❌ jupyter-lab not found"
  exit 1
fi
echo "✔ jupyter-lab command found"

{
jupyter console --simple-prompt 2>/dev/null <<'EOF'
1234+5678
EOF
} | grep -qE '\b6912\b'


if [ $? -eq 0 ]; then
  echo "✔ Kernel executed correctly (1234+5678=6912)"
else
  echo "❌ Kernel test failed"
  exit 1
fi

exit 0
