"vs_sintax errors if input fasta file does not exist"
"vs_sintax errors if input database file does not exist"
"vs_sintax returns expected columns in classification"
"vs_sintax writes output to file if outfile is specified"
"vs_sintax creates logfile if specified"
"vs_sintax errors when database tibble lacks required columns"
"make_sintax_db errors when required columns are missing"
"taxonomy_tree errors when required columns are missing"
"vs_sintax returns empty data.frame when no classification match"
"vs_sintax works with database as tibble"

vs_sintax errors if input fasta file does not exist

Error in `expect_error(vs_sintax(fasta_input = fasta_input, database = fake_db), 
    paste("Cannot find input file:", normalizePath(fake_db, mustWork = FALSE)))`: Failed to compare error to `pattern`.
Caused by error in `grepl()`:
! invalid regular expression 'Cannot find input file: D:\temp\2025_09_19_15_20_17_23288\RtmpeeYHHs\file23f4c102b732f.fa', reason 'Invalid back reference'

vs_sintax errors if input database file does not exist

vs_sintax returns expected columns in classification

vs_sintax writes output to file if outfile is specified

vs_sintax errors when database tibble lacks required columns

vs_sintax returns empty data.frame when no classification match

test_that("vs_uchime_denovo errors if only one output file is given", {
"nonchimeras and chimeras must either both be specified or both unspecified.")
test_that("error when input file is missing", {
paste0("Cannot find input file: ", "some_fasta_file.fa"))
test_that("vs_uchime_denovo returns tibble with chimeras and stats", {
R1 <- test_path("testdata", "output", "R1_derep.fasta")
out <- vs_uchime_denovo(fasta_input = R1)
test_that("vs_uchime_denovo works with tibble input", {
R1 <- microseq::readFasta(test_path("testdata", "output", "R1_derep.fasta"))
test_that("vs_uchime_denovo writes output files when paths are specified", {
test_that("vs_uchime_denovo handles optional arguments", {
test_that("vs_uchime_denovo joins otu_id when present in input", {
out <- vs_uchime_denovo(fasta_input = fasta_input)
test_that("vs_uchime_denovo returns empty chimera table when none found", {
test_that("vs_uchime_denovo preserves all extra columns from input tibble", {
fasta_input$otu_id <- c("ParentA_otu", "ParentB_otu", "Chimera_otu")
fasta_input$sample_source <- c("Sample1", "Sample1", "Sample1")
fasta_input$qc_passed <- c(TRUE, TRUE, TRUE)
# 3. Verifisering: Hent ut begge resultat-tabellene
expected_cols <- c("Header", "Sequence", "otu_id", "sample_source", "qc_passed")
# Sjekk at alle ekstra kolonner finnes i nonchimeras-tabellen
# Sjekk at det finnes minst én kimære for å validere neste sjekk
# Sjekk at alle ekstra kolonner finnes i chimeras-tabellen