Sha256: dd7cbe2906f5029ae10526aa6c4ab3a0fbaf37f42e7566b1e81f3c70624896e2

Contents?: true

Size: 1.78 KB

Versions: 379

Compression:

Stored size: 1.78 KB

Contents

pending :-
    current_prolog_flag(argv, ['--all'|_]).
pending :-
    write('\nA TEST IS PENDING!\n'),
    fail.

:- begin_tests(hamming).

    test(identical_strands, condition(true)) :-
        hamming_distance("A", "A", Result),
            Result == 0.

    test(long_identical_strands, condition(pending)) :-
        hamming_distance("GGACTGA", "GGACTGA", 0).

    test(complete_distance_in_single_nucleotide_strands, condition(pending)) :-
        hamming_distance("A", "G", 1).

    test(complete_distance_in_small_strands, condition(pending)) :-
        hamming_distance("AG", "CT", 2).

    test(small_distance_in_small_strands, condition(pending)) :-
        hamming_distance("AT", "CT", 1).

    test(small_distance, condition(pending)) :-
        hamming_distance("GGACG", "GGTCG", 1).

    test(small_distance_in_long_strands, condition(pending)) :-
        hamming_distance("ACCAGGG", "ACTATGG", 2).

    test(nonunique_character_in_first_strand, condition(pending)) :-
        hamming_distance("AGA", "AGG", 1).

    test(nonunique_character_in_second_strand, condition(pending)) :-
        hamming_distance("AGG", "AGA", 1).

    test(same_nucleotides_in_different_positions, condition(pending)) :-
        hamming_distance("TAG", "GAT", 2).

    test(large_distance, condition(pending)) :-
        hamming_distance("GATACA", "GCATAA", 4).

    test(large_distance_in_offbyone_strand, condition(pending)) :-
        hamming_distance("GGACGGATTCTG", "AGGACGGATTCT", 9).

    test(empty_strands, condition(pending)) :-
        hamming_distance("", "", 0).

    test(disallow_first_strand_longer, [fail, condition(pending)]) :-
        hamming_distance("AATG", "AAA", _).

    test(disallow_second_strand_longer, [fail, condition(pending)]) :-
        hamming_distance("ATA", "AGTG", _).

:- end_tests(hamming).

Version data entries

379 entries across 379 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/prolog/exercises/hamming/hamming_tests.plt
trackler-2.2.1.179 tracks/prolog/exercises/hamming/hamming_tests.plt
trackler-2.2.1.178 tracks/prolog/exercises/hamming/hamming_tests.plt
trackler-2.2.1.177 tracks/prolog/exercises/hamming/hamming_tests.plt
trackler-2.2.1.176 tracks/prolog/exercises/hamming/hamming_tests.plt
trackler-2.2.1.175 tracks/prolog/exercises/hamming/hamming_tests.plt
trackler-2.2.1.174 tracks/prolog/exercises/hamming/hamming_tests.plt
trackler-2.2.1.173 tracks/prolog/exercises/hamming/hamming_tests.plt
trackler-2.2.1.172 tracks/prolog/exercises/hamming/hamming_tests.plt
trackler-2.2.1.171 tracks/prolog/exercises/hamming/hamming_tests.plt
trackler-2.2.1.170 tracks/prolog/exercises/hamming/hamming_tests.plt
trackler-2.2.1.169 tracks/prolog/exercises/hamming/hamming_tests.plt
trackler-2.2.1.167 tracks/prolog/exercises/hamming/hamming_tests.plt
trackler-2.2.1.166 tracks/prolog/exercises/hamming/hamming_tests.plt
trackler-2.2.1.165 tracks/prolog/exercises/hamming/hamming_tests.plt
trackler-2.2.1.164 tracks/prolog/exercises/hamming/hamming_tests.plt
trackler-2.2.1.163 tracks/prolog/exercises/hamming/hamming_tests.plt
trackler-2.2.1.162 tracks/prolog/exercises/hamming/hamming_tests.plt
trackler-2.2.1.161 tracks/prolog/exercises/hamming/hamming_tests.plt
trackler-2.2.1.160 tracks/prolog/exercises/hamming/hamming_tests.plt