<commit_before>module Bounds where
import CLaSH.Prelude

(expected,actual) = unzip $
        (   0, toInteger (minBound :: Index 43))
     :> (  42, toInteger (maxBound :: Index 43))
     :> (-256, toInteger (minBound :: Signed 9))
     :> ( 255, toInteger (maxBound :: Signed 9))
     :> (   0, toInteger (minBound :: Unsigned 9))
     :> ( 511, toInteger (maxBound :: Unsigned 9))
     :> ( -64, toInteger $ unFixed (minBound :: SFixed 4 3))
     :> (  63, toInteger $ unFixed (maxBound :: SFixed 4 3))
     :> (   0, toInteger $ unFixed (minBound :: UFixed 3 4))
     :> ( 127, toInteger $ unFixed (maxBound :: UFixed 3 4))
     :> Nil

topEntity :: Signal () -> Signal Integer
topEntity = mealy loop actual

loop :: Vec (n+2) a -> () -> (Vec (n+2) a, a)
--loop (x:>xs) _ = (xs <: last xs, x)
loop xs _ = (xs <<+ last xs, head xs)


expectedOutput :: Signal Integer -> Signal Bool
expectedOutput = outputVerifier expected

-- create the right number of inputs
stimuli = map (const ()) actual

testInput = stimuliGenerator stimuli<commit_msg>Separate the vectors in the Bounds test<commit_after>module Bounds where
import CLaSH.Prelude


expected
    =     0 :>  42
    :> -256 :> 255
    :>    0 :> 511
    :>  -64 :>  63
    :>    0 :> 127
    :> (Nil::Vec 0 Integer)

actual
    =  toInteger (minBound :: Index 43)             :> toInteger (maxBound :: Index 43)
    :> toInteger (minBound :: Signed 9)             :> toInteger (maxBound :: Signed 9)
    :> toInteger (minBound :: Unsigned 9)           :> toInteger (maxBound :: Unsigned 9)
    :> toInteger (unFixed (minBound :: SFixed 4 3)) :> toInteger (unFixed (maxBound :: SFixed 4 3))
    :> toInteger (unFixed (minBound :: UFixed 3 4)) :> toInteger (unFixed (maxBound :: UFixed 3 4))
    :> Nil

topEntity :: Signal () -> Signal Integer
topEntity = mealy loop actual

loop :: Vec (n+2) a -> () -> (Vec (n+2) a, a)
--loop (x:>xs) _ = (xs <: last xs, x)
loop xs _ = (xs <<+ last xs, head xs)


expectedOutput :: Signal Integer -> Signal Bool
expectedOutput = outputVerifier expected


testInput :: Signal ()
testInput  = signal ()
{'fraction_non_alphanumeric': 0.15119617224880383, 'fraction_numerical': 0.03779904306220096, 'mean_word_length': 2.8794063079777366, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 43, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7538721', 'n_tokens_mistral': 794, 'n_tokens_neox': 703, 'n_words': 231}