File: test-fallback-syntax

package info (click to toggle)
triehash 0.3-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 168 kB
  • sloc: sh: 1,161; perl: 391; makefile: 10
file content (42 lines) | stat: -rwxr-xr-x 1,126 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/sh
. $(dirname $(readlink -f $0))/framework.sh

WORDS="Fallback ~   = -5"

# Check the fallback syntax works with spaces
testsuccessequal "#ifndef TRIE_HASH_PerfectHash
#define TRIE_HASH_PerfectHash
#include <stddef.h>
#include <stdint.h>
enum PerfectKey {
    Fallback = -5,
};
static enum PerfectKey PerfectHash(const char *string, size_t length);
static enum PerfectKey PerfectHash(const char *string, size_t length)
{
    switch (length) {
    default:
        return Fallback;
    }
}
#endif                       /* TRIE_HASH_PerfectHash */" triehash --multi-byte=0 /dev/stdin

WORDS="Fallback ~= -5"

# Check the fallback syntax works without spaces
testsuccessequal "#ifndef TRIE_HASH_PerfectHash
#define TRIE_HASH_PerfectHash
#include <stddef.h>
#include <stdint.h>
enum PerfectKey {
    Fallback = -5,
};
static enum PerfectKey PerfectHash(const char *string, size_t length);
static enum PerfectKey PerfectHash(const char *string, size_t length)
{
    switch (length) {
    default:
        return Fallback;
    }
}
#endif                       /* TRIE_HASH_PerfectHash */" triehash --multi-byte=0 /dev/stdin