#!/bin/sh -e
# http://dep.debian.net/deps/dep8/

pkg=fastp
if [ "$AUTOPKGTEST_TMP" = "" ] ; then
  AUTOPKGTEST_TMP=`mktemp -d /tmp/${pkg}-test.XXXXXX`
fi
cd $AUTOPKGTEST_TMP
cp -a /usr/share/doc/${pkg}/examples/* $AUTOPKGTEST_TMP

# Test for single end data (not compressed)
fastp -i R1.fq -o out.R1.fq

# Test for paired end data (gzip compressed)
gzip --keep R*.fq
fastp -i R1.fq.gz -I R2.fq.gz -o out.R1.fq.gz -O out.R2.fq.gz

# Test for Unique Molecular Identifier (UMI) processing
fastp -i R2.fq -o out.R2.fq -U --umi_loc=read1 --umi_len=8

rm -f $AUTOPKGTEST_TMP/*
