mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
tests: remove module main
from tests, that do not need to be internal
This commit is contained in:
parent
728b4cffc3
commit
94a36c5ca4
@ -1,5 +1,3 @@
|
||||
module main
|
||||
|
||||
type ALchar = char
|
||||
|
||||
fn test_alias_char_type_reference() {
|
||||
|
@ -1,5 +1,3 @@
|
||||
module main
|
||||
|
||||
fn test_anon_fn_with_nested_anon_fn_args() {
|
||||
mut xa := fn (x fn (int) string, y int) string {
|
||||
return x(y)
|
||||
|
@ -1,5 +1,3 @@
|
||||
module main
|
||||
|
||||
fn func(arg struct { foo string }) {
|
||||
assert arg.foo == 'foo'
|
||||
}
|
||||
|
@ -1,5 +1,3 @@
|
||||
module main
|
||||
|
||||
fn test_cast_bool_to_int() {
|
||||
i := true
|
||||
x := int(i)
|
||||
|
@ -1,5 +1,3 @@
|
||||
module main
|
||||
|
||||
type CEnum = int
|
||||
|
||||
enum Enum {
|
||||
|
@ -1,5 +1,3 @@
|
||||
module main
|
||||
|
||||
fn test_cast_to_anon_sumtype() {
|
||||
x := string|none(none)
|
||||
println(x)
|
||||
|
@ -1,5 +1,3 @@
|
||||
module main
|
||||
|
||||
fn test_cast_to_alias() {
|
||||
r1 := u8(u8(1))
|
||||
println(r1)
|
||||
|
@ -1,5 +1,3 @@
|
||||
module main
|
||||
|
||||
import datatypes
|
||||
|
||||
struct Item {
|
||||
|
@ -1,5 +1,3 @@
|
||||
module main
|
||||
|
||||
// exploring `decode` options with nested structs
|
||||
|
||||
struct Parent {
|
||||
|
@ -1,5 +1,3 @@
|
||||
module main
|
||||
|
||||
struct S1 {}
|
||||
|
||||
fn test_comptime_for_method_call_str() {
|
||||
|
@ -1,5 +1,3 @@
|
||||
module main
|
||||
|
||||
fn write[T](out T) string {
|
||||
$if T.typ is bool {
|
||||
println('FOO')
|
||||
|
@ -1,5 +1,3 @@
|
||||
module main
|
||||
|
||||
import term
|
||||
|
||||
fn abc() {
|
||||
|
@ -1,5 +1,3 @@
|
||||
module main
|
||||
|
||||
import os
|
||||
|
||||
const iterations = (os.getenv_opt('ITERATIONS') or { '5' }).int()
|
||||
|
@ -1,5 +1,3 @@
|
||||
module main
|
||||
|
||||
import rand
|
||||
import rand.wyrand
|
||||
import rand.splitmix64
|
||||
|
@ -1,5 +1,3 @@
|
||||
module main
|
||||
|
||||
fn test_fixed_array_of_threads() {
|
||||
mut avar := [8]thread string{}
|
||||
avar[0] = spawn printme()
|
||||
|
@ -1,5 +1,3 @@
|
||||
module main
|
||||
|
||||
import time
|
||||
|
||||
struct Game {
|
||||
|
@ -1,5 +1,3 @@
|
||||
module main
|
||||
|
||||
type VkPresentModeKHR = u32
|
||||
|
||||
fn create_c_array[T](len u32) &T {
|
||||
|
@ -1,5 +1,3 @@
|
||||
module main
|
||||
|
||||
fn get_value[T]() ?T {
|
||||
return none
|
||||
}
|
||||
|
@ -1,5 +1,3 @@
|
||||
module main
|
||||
|
||||
struct Empty {}
|
||||
|
||||
struct Node[T] {
|
||||
|
@ -1,5 +1,3 @@
|
||||
module main
|
||||
|
||||
struct None {}
|
||||
|
||||
pub type Maybe[T] = None | T
|
||||
|
@ -1,5 +1,3 @@
|
||||
module main
|
||||
|
||||
interface TypeFactory[T] {
|
||||
get_type(type_name string) T
|
||||
}
|
||||
|
@ -1,5 +1,3 @@
|
||||
module main
|
||||
|
||||
struct Container[T] {
|
||||
value T
|
||||
}
|
||||
|
@ -1,5 +1,3 @@
|
||||
module main
|
||||
|
||||
fn test_generics_method_with_sumtype_args() {
|
||||
mut me := CatDad{}
|
||||
ret := me.adopt[CatType, Cat](CatType.black, BlackCat{})
|
||||
|
@ -1,5 +1,3 @@
|
||||
module main
|
||||
|
||||
struct None {}
|
||||
|
||||
type OptError = None | string
|
||||
|
@ -1,5 +1,3 @@
|
||||
module main
|
||||
|
||||
pub struct Person {
|
||||
pub mut:
|
||||
id int
|
||||
|
@ -1,5 +1,3 @@
|
||||
module main
|
||||
|
||||
pub struct Maybe[T] {
|
||||
present bool
|
||||
val T
|
||||
|
@ -1,5 +1,3 @@
|
||||
module main
|
||||
|
||||
pub struct Randomizer[T] {
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,3 @@
|
||||
module main
|
||||
|
||||
pub struct Reptile {}
|
||||
|
||||
pub struct Insect {}
|
||||
|
@ -1,5 +1,3 @@
|
||||
module main
|
||||
|
||||
pub struct Vec[T] {
|
||||
mut:
|
||||
data &T
|
||||
|
@ -1,5 +1,3 @@
|
||||
module main
|
||||
|
||||
fn foo[T](val T) ?T {
|
||||
return val
|
||||
}
|
||||
|
@ -1,5 +1,3 @@
|
||||
module main
|
||||
|
||||
fn test_go_call_fn_using_map_value() {
|
||||
sum := fn (x int, y int) int {
|
||||
return x + y
|
||||
|
@ -1,5 +1,3 @@
|
||||
module main
|
||||
|
||||
import rand
|
||||
|
||||
interface Sample {
|
||||
|
@ -1,5 +1,3 @@
|
||||
module main
|
||||
|
||||
type ConfigValue = bool | int | string
|
||||
type ConfigMap = map[string]ConfigValue
|
||||
|
||||
|
@ -1,5 +1,3 @@
|
||||
module main
|
||||
|
||||
import geometry { Line, Point, PointCond, Shape, point_str }
|
||||
|
||||
fn point_is(p Point, cond PointCond) bool {
|
||||
|
@ -1,5 +1,3 @@
|
||||
module main
|
||||
|
||||
fn test_interface_embedding_call() {
|
||||
g1 := G1{}
|
||||
do_the_greet(g1)
|
||||
|
@ -1,5 +1,3 @@
|
||||
module main
|
||||
|
||||
pub interface IObject {
|
||||
mut:
|
||||
do_stuff()
|
||||
|
@ -1,5 +1,3 @@
|
||||
module main
|
||||
|
||||
interface Getter {
|
||||
get() string
|
||||
}
|
||||
|
@ -1,5 +1,3 @@
|
||||
module main
|
||||
|
||||
interface Speaker {
|
||||
say() string
|
||||
}
|
||||
|
@ -1,5 +1,3 @@
|
||||
module main
|
||||
|
||||
fn test_mark_as_referenced() {
|
||||
if true {
|
||||
a := Type{}
|
||||
|
@ -1,5 +1,3 @@
|
||||
module main
|
||||
|
||||
type Sum = Struct | int
|
||||
|
||||
struct Struct {
|
||||
|
@ -1,5 +1,3 @@
|
||||
module main
|
||||
|
||||
fn has_optional() ?int {
|
||||
return 51
|
||||
}
|
||||
|
@ -1,5 +1,3 @@
|
||||
module main
|
||||
|
||||
type Abc = int | rune | string | u32
|
||||
|
||||
fn cyz() (Abc, string) {
|
||||
|
@ -1,5 +1,3 @@
|
||||
module main
|
||||
|
||||
import time
|
||||
|
||||
struct Alarms {
|
||||
|
@ -1,5 +1,3 @@
|
||||
module main
|
||||
|
||||
fn test_shared_array_last() {
|
||||
shared a := []int{}
|
||||
lock {
|
||||
|
@ -1,5 +1,3 @@
|
||||
module main
|
||||
|
||||
import time
|
||||
|
||||
struct Alarms {
|
||||
|
@ -1,5 +1,3 @@
|
||||
module main
|
||||
|
||||
struct ABC {
|
||||
mut:
|
||||
s string
|
||||
|
@ -1,5 +1,3 @@
|
||||
module main
|
||||
|
||||
struct Aa {
|
||||
mut:
|
||||
b []int
|
||||
|
@ -1,5 +1,3 @@
|
||||
module main
|
||||
|
||||
[heap]
|
||||
pub struct Grid {
|
||||
pub mut:
|
||||
|
@ -1,5 +1,3 @@
|
||||
module main
|
||||
|
||||
struct Anything {
|
||||
mut:
|
||||
name string
|
||||
|
@ -1,5 +1,3 @@
|
||||
module main
|
||||
|
||||
struct Person {
|
||||
name string
|
||||
age int
|
||||
|
@ -1,5 +1,3 @@
|
||||
module main
|
||||
|
||||
struct Animal {
|
||||
Duck
|
||||
id int
|
||||
|
@ -1,5 +1,3 @@
|
||||
module main
|
||||
|
||||
struct Author {
|
||||
username string
|
||||
name string
|
||||
|
@ -1,5 +1,3 @@
|
||||
module main
|
||||
|
||||
interface Greeting {
|
||||
tt ?string
|
||||
}
|
||||
|
@ -1,5 +1,3 @@
|
||||
module main
|
||||
|
||||
fn string_none() string|none {
|
||||
return none
|
||||
}
|
||||
|
@ -1,5 +1,3 @@
|
||||
module main
|
||||
|
||||
struct PlotData {
|
||||
dates []string
|
||||
numerical_result []int
|
||||
|
@ -1,5 +1,3 @@
|
||||
module main
|
||||
|
||||
pub struct SomeThing {
|
||||
pub:
|
||||
m map[string]string
|
||||
|
@ -1,5 +1,3 @@
|
||||
module main
|
||||
|
||||
fn test_typeof_fn() {
|
||||
assert typeof[fn (s string, x u32) (int, f32)]().name == 'fn (string, u32) (int, f32)'
|
||||
}
|
||||
|
@ -1,5 +1,3 @@
|
||||
module main
|
||||
|
||||
fn test_autoprint_string_vargs() {
|
||||
add_s('a')
|
||||
assert true
|
||||
|
Loading…
x
Reference in New Issue
Block a user