#!/bin/sh
set -e

DATA=debian/tests/data
echo "testing NDBM reading..."

for db in $DATA/*-ndbm.dir; do
    base=$(echo $db | sed 's/\.dir$//')
    perl -MFcntl -MNDBM_File -le 'tie %h, q(NDBM_File), shift, O_RDWR, 0640 or die "opening NDBM file failed: $!"; die "contents of NDBM file not found?" if !$h{foo}; print $h{foo}' $base | grep OK
done

