• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

visgl / luma.gl / 16861129258

10 Aug 2025 12:01PM UTC coverage: 51.251% (-22.6%) from 73.868%
16861129258

Pull #2416

github

web-flow
Merge 98ff12c30 into f90a93cf3
Pull Request #2416: chore: Tests for texture reads

591 of 833 branches covered (70.95%)

Branch coverage included in aggregate %.

65 of 107 new or added lines in 7 files covered. (60.75%)

8551 existing lines in 130 files now uncovered.

18665 of 36739 relevant lines covered (50.8%)

11.48 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

40.63
/modules/shadertools/src/lib/preprocessor/preprocessor.ts
1
// luma.gl
1✔
2
// SPDX-License-Identifier: MIT
1✔
3
// Copyright (c) vis.gl contributors
1✔
4

1✔
5
const IFDEF_REGEXP = /^\s*\#\s*ifdef\s*([a-zA-Z_]+)\s*$/;
1✔
6
const ENDIF_REGEXP = /^\s*\#\s*endif\s*$/;
1✔
7

1✔
8
export type PreprocessorOptions = {
1✔
9
  defines?: Record<string, boolean>;
1✔
10
};
1✔
11

1✔
12
export function preprocess(source: string, options?: PreprocessorOptions): string {
1✔
UNCOV
13
  const lines = source.split('\n');
×
UNCOV
14
  const output: string[] = [];
×
UNCOV
15

×
UNCOV
16
  let conditional = true;
×
UNCOV
17
  let currentDefine: string | null = null;
×
UNCOV
18
  for (const line of lines) {
×
UNCOV
19
    const matchIf = line.match(IFDEF_REGEXP);
×
UNCOV
20
    const matchEnd = line.match(ENDIF_REGEXP);
×
UNCOV
21
    if (matchIf) {
×
UNCOV
22
      currentDefine = matchIf[1];
×
UNCOV
23
      conditional = Boolean(options?.defines?.[currentDefine]);
×
UNCOV
24
    } else if (matchEnd) {
×
UNCOV
25
      conditional = true;
×
UNCOV
26
    } else if (conditional) {
×
UNCOV
27
      output.push(line);
×
UNCOV
28
    }
×
UNCOV
29
  }
×
UNCOV
30
  return output.join('\n');
×
UNCOV
31
}
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc