content stringlengths 263 5.24M | pred_label stringclasses 1
value | pred_score_pos float64 0.6 1 |
|---|---|---|
// +build windows
package markedconn
import (
"net"
"testing"
. "github.com/smartystreets/goconvey/convey"
)
func TestStoreTake(t *testing.T) {
var nd *PlatformData
Convey("Given a ProxiedListener with a PlatformDataControl", t, func() {
proxiedListener := ProxiedListener{
netListener: nil,
mar... | __label__POS | 0.876137 |
// +build windows
package markedconn
import (
"fmt"
"net"
"sync"
)
// PlatformDataControl is for Windows.
// For proxied connections, we map the original ip/port to platform-specific data that needs to be retrieved
// when we make the real connection.
type PlatformDataControl struct {
platformData map[string]*Pl... | __label__POS | 0.889419 |
package iptablesctrl
import (
"net"
"strings"
"github.com/aporeto-inc/go-ipset/ipset"
provider "go.aporeto.io/enforcerd/trireme-lib/controller/pkg/aclprovider"
"go.aporeto.io/gaia/protocols"
)
const (
// IPv6DefaultIP is the default IP subnet of ipv6
IPv6DefaultIP = "::/0"
)
type ipv6 struct {
ipt p... | __label__POS | 0.959447 |
// +build !windows,!rhel6
package iptablesctrl
import "testing"
func Test_getICMPv6(t *testing.T) {
tests := []struct {
name string
want string
}{
{"icmpv6DefaultAllow", "(icmp6[0] == 133 and icmp6[1] == 0) or (icmp6[0] == 134 and icmp6[1] == 0) or (icmp6[0] == 135 and icmp6[1] == 0) or (icmp6[0] == 136 and ... | __label__POS | 0.933756 |
// +build !rhel6
package iptablesctrl
/*
#cgo linux LDFLAGS: -L/tmp -lpcap
#include<string.h>
#include<stdlib.h>
#include<pcap.h>
char bpf_program[1500];
char *compileBPF(const char *expr) {
struct bpf_program program;
struct bpf_insn *ins;
char buf[100];
int i, dlt = DLT_RAW;
if (pcap_compile_nopcap(6... | __label__POS | 0.881516 |
// +build !windows
package provider
import (
"testing"
"github.com/magiconair/properties/assert"
. "github.com/smartystreets/goconvey/convey"
)
const (
mangle = "mangle"
inputChain = "INPUT"
outputChain = "OUTPUT"
)
func NewTestProvider(batchTables []string, quote bool) *BatchProvider {
batchTablesMap... | __label__POS | 0.715103 |
// +build !windows
package pkiverifier
import (
"crypto/ecdsa"
"testing"
"time"
. "github.com/smartystreets/goconvey/convey"
"go.aporeto.io/enforcerd/trireme-lib/utils/crypto"
)
var (
keyPEM = `-----BEGIN EC PRIVATE KEY-----
MHcCAQEEIPkiHqtH372JJdAG/IxJlE1gv03cdwa8Lhg2b3m/HmbyoAoGCCqGSM49
AwEHoUQDQgAEAfAL+AfP... | __label__POS | 0.947545 |
// +build !windows
package fqconfig
import (
"testing"
. "github.com/smartystreets/goconvey/convey"
)
func TestFqDefaultConfig(t *testing.T) {
Convey("Given I create a new default filter queue config", t, func() {
fqc := NewFilterQueueWithDefaults()
Convey("Then I should see a config", func() {
So(fqc, ... | __label__POS | 0.999721 |
// +build !windows
package secrets
import (
"crypto/ecdsa"
"crypto/x509"
"testing"
. "github.com/smartystreets/goconvey/convey"
"go.aporeto.io/trireme-lib/controller/pkg/claimsheader"
"go.aporeto.io/trireme-lib/utils/crypto"
)
func TestNewCompactPKI(t *testing.T) {
txKey := CreateTxtToken()
// txkey is a to... | __label__POS | 0.736355 |
// +build !windows
package urisearch
import (
"testing"
. "github.com/smartystreets/goconvey/convey"
"go.aporeto.io/enforcerd/trireme-lib/policy"
)
func initTrieRules() []*policy.HTTPRule {
return []*policy.HTTPRule{
{
Methods: []string{"GET", "PUT"},
URIs: []string{
"/users/?/name",
"/things/?... | __label__POS | 0.983044 |
package dmesgparser
import (
"fmt"
"os/exec"
"strconv"
"strings"
"sync"
)
// Dmesg struct handle for the dmesg parser
type Dmesg struct {
chanSize int
lastProcessedTime float64
sync.Mutex
}
func getEntryTime(line string) float64 {
leftindex := strings.Index(line, "[")
rightIndex := strings.Index(l... | __label__POS | 0.625673 |
package counters
import (
"errors"
"testing"
. "github.com/smartystreets/goconvey/convey"
)
func Test_DefaultCounterError(t *testing.T) {
Convey("When I increment counter", t, func() {
err := CounterError(ErrInvalidProtocol, errors.New("unknown protocol"))
IncrementCounter(ErrInvalidProtocol)
So(err, Shou... | __label__POS | 0.998482 |
package counters
import (
"errors"
"testing"
. "github.com/smartystreets/goconvey/convey"
)
func Test_NewCounters(t *testing.T) {
Convey("When I create new error counters", t, func() {
ec := NewCounters()
So(ec, ShouldNotBeNil)
So(len(ec.counters), ShouldEqual, errMax+1)
})
}
func Test_CounterError(t *t... | __label__POS | 0.99834 |
package counters
import (
"sync/atomic"
"go.aporeto.io/enforcerd/trireme-lib/collector"
)
// NewCounters initializes new counters handler. Thread safe.
func NewCounters() *Counters {
return &Counters{}
}
// CounterNames returns an array of names
func CounterNames() []string {
names := make([]string, errMax+1)
... | __label__POS | 0.923582 |
// +build !windows
package claimsheader
import (
"testing"
. "github.com/smartystreets/goconvey/convey"
)
func TestHeader(t *testing.T) {
Convey("Given I create a new claims header", t, func() {
header := NewClaimsHeader(
OptionEncrypt(true),
OptionCompressionType(CompressionTypeV1),
OptionDatapathVe... | __label__POS | 0.916044 |
using System.Collections.Generic;
using System.Text.Json.Serialization;
namespace GameProject {
public class DrawingData {
public Cam Camera { get; set; } = new Cam();
public int NextId { get; set; } = 0;
public Color BackgroundColor { get; set; } = new Color { R = 0, G = 0, B = 0 };
... | __label__POS | 0.908304 |
using Microsoft.Xna.Framework;
namespace GameProject {
/// <summary>
/// Preview the colors: https://tailwindcss.com/docs/customizing-colors#color-palette-reference
/// </summary>
public class TWColor {
/// <summary>Black color (R:0,G:0,B:0,A:255).</summary>
public static readonly Color... | __label__POS | 0.822857 |
using System.Text.Json.Serialization;
namespace GameProject {
public class Palette {
public Color[][] Colors { get; set; } = [
[TWColor.White, TWColor.Black],
[TWColor.Slate050, TWColor.Slate100, TWColor.Slate200, TWColor.Slate300, TWColor.Slate400, TWColor.Slate500, TWColor.Slate60... | __label__POS | 0.657478 |
package statscollector
import (
"testing"
. "github.com/smartystreets/goconvey/convey"
"go.aporeto.io/enforcerd/trireme-lib/collector"
"go.aporeto.io/enforcerd/trireme-lib/controller/pkg/packet"
)
func TestNewCollector(t *testing.T) {
Convey("When I create a new collector", t, func() {
c := NewCollector()
C... | __label__POS | 0.865865 |
package statscollector
import (
"go.aporeto.io/enforcerd/trireme-lib/collector"
)
// Count returns the current number of records collected.
func (c *collectorImpl) Count() int {
c.Lock()
defer c.Unlock()
return len(c.Flows)
}
// GetFlowRecords should return all flow records stashed so far.
func (c *collectorImp... | __label__POS | 0.836594 |
// +build !windows
package cache
import (
"testing"
"time"
"github.com/rs/xid"
. "github.com/smartystreets/goconvey/convey"
)
func TestConstructorNewCache(t *testing.T) {
// t.Parallel()
Convey("Given I call the method NewCache, I should a new cache", t, func() {
c := &Cache{
name: "cache",
}
So(... | __label__POS | 0.940192 |
// +build !windows
package nfqparser
import (
"fmt"
"io/ioutil"
"testing"
. "github.com/smartystreets/goconvey/convey"
)
const (
testFilePath = "/tmp/nfqdrops"
testNFQData = ` 0 13206 0 2 65531 0 0 0 1
1 3333107750 0 2 65531 0 0 0 1
2 3881398569 0 2 6... | __label__POS | 0.94953 |
package ipprefix
import (
"encoding/binary"
"net"
"sync"
)
// FuncOnLpmIP is the type of func which will operate on the value associated with the lpm ip.
type FuncOnLpmIP func(val interface{}) bool
// FuncOnVals is the type of the func which will operate on each value and will return a new value
// for each assoc... | __label__POS | 0.762939 |
// +build !windows
package portcache
import (
"testing"
. "github.com/smartystreets/goconvey/convey"
"go.aporeto.io/enforcerd/trireme-lib/utils/portspec"
)
func TestNewPortCache(t *testing.T) {
Convey("When I creat a new port cache", t, func() {
p := NewPortCache("test")
Convey("The cache must be initilized... | __label__POS | 0.82912 |
// +build !windows
package portspec
import (
"testing"
. "github.com/smartystreets/goconvey/convey"
)
func TestNewPortSpec(t *testing.T) {
Convey("When I create a new port spec", t, func() {
p, err := NewPortSpec(0, 10, "portspec")
So(err, ShouldBeNil)
Convey("The correct values must be set", func() {
S... | __label__POS | 0.881811 |
package portspec
// This package manages all port spec functions and validations and can
// be reused by all other packages.
import (
"errors"
"strconv"
"strings"
)
// PortSpec is the specification of a port or port range
type PortSpec struct {
Min uint16 `json:"Min,omitempty"`
Max uint16 `json:"Max,omitemp... | __label__POS | 0.800675 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Fast RTPS: Class Me... | __label__POS | 0.819655 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Fast RTPS: Class Me... | __label__POS | 0.804172 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Fast RTPS: Class Me... | __label__POS | 0.93525 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Fast RTPS: Class Me... | __label__POS | 0.642021 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Fast RTPS: Class Me... | __label__POS | 0.942813 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Fast RTPS: Class Me... | __label__POS | 0.83498 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Fast RTPS: Namespac... | __label__POS | 0.837327 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Fast RTPS: Class Me... | __label__POS | 0.70155 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Fast RTPS: Class Me... | __label__POS | 0.935817 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Fast RTPS: Namespac... | __label__POS | 0.602675 |
package com.artemis;
import junit.framework.Assert;
import org.junit.Test;
import com.artemis.systems.EntityProcessingSystem;
public class ParentMapperTest {
static class TestComponent implements Component {
int test;
@Override
public void reset() {
}
}
static class ... | __label__POS | 0.950801 |
package com.artemis.managers;
import junit.framework.Assert;
import org.junit.Test;
import com.artemis.Entity;
import com.artemis.World;
public class SingletonEntityManagerTest {
private static final String PLAYER = "player";
private static final String BOSS = "boss";
@Test
public void testSimple(... | __label__POS | 0.973896 |
package com.artemis.managers;
import junit.framework.Assert;
import org.junit.Test;
import com.artemis.Component;
import com.artemis.ComponentMapper;
import com.artemis.Entity;
import com.artemis.Filter;
import com.artemis.World;
import com.artemis.systems.EntitySystem;
import com.badlogic.gdx.utils.Array;
public c... | __label__POS | 0.747961 |
package com.artemis.managers;
import junit.framework.Assert;
import org.junit.Test;
import com.artemis.Entity;
import com.artemis.World;
public class PlayerManagerTest {
private static final String PLAYER_1 = "p1";
private static final String PLAYER_2 = "p2";
private static final String PLAYER_3 = "p3"... | __label__POS | 0.956828 |
package com.artemis.managers;
import junit.framework.Assert;
import org.junit.Test;
import com.artemis.World;
public class TeamManagerTest {
private static final String PLAYER_1 = "p1";
private static final String PLAYER_2 = "p2";
private static final String PLAYER_3 = "p3";
private static final S... | __label__POS | 0.992917 |
package com.artemis.systems;
import junit.framework.Assert;
import org.junit.Test;
import com.artemis.Component;
import com.artemis.Entity;
import com.artemis.Filter;
import com.artemis.World;
import com.badlogic.gdx.utils.ObjectIntMap;
public class SkipEntityProcessingSystemTest {
private static final int DEL... | __label__POS | 0.764122 |
package com.artemis.systems;
import junit.framework.Assert;
import org.junit.Test;
import com.artemis.Component;
import com.artemis.Entity;
import com.artemis.Filter;
import com.artemis.World;
public class EntityProcessingSystemTest {
static class ComponentA implements Component {
@Override
pub... | __label__POS | 0.956894 |
package com.artemis.utils;
import com.badlogic.gdx.utils.Array;
import org.junit.*;
public class IdentifierTest {
private IdentifierPool identifierPool;
private static int ID_COUNT = 3;
@BeforeClass
public static void beforeClass() {
}
@AfterClass
public static void afterClass() {
... | __label__POS | 0.913807 |
package com.artemis.systems.event;
import junit.framework.Assert;
import org.junit.Test;
import com.artemis.Component;
import com.artemis.Entity;
import com.artemis.Filter;
import com.artemis.World;
import com.artemis.systems.VoidEntitySystem;
public class EventProcessingSystemTest {
private static class TestE... | __label__POS | 0.928367 |
package com.artemis.systems.event;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import com.artemis.World;
import com.artemis.systems.VoidEntitySystem;
import com.badlogic.gdx.utils.Array;
import com.badlogic.gdx.utils.IntArray;
/**
* Tests out the basic event system, with simple send/rec... | __label__POS | 0.868315 |
package com.artemis;
/**
* DEPRECATED in favor of Aspect, which is much clearer description of what an Aspect is.
*
* @author Arni Arent
*
*/
@Deprecated
public class Aspect extends Filter {
/**
* Access Aspect creation through static factory methods.
*/
protected Aspect() {
}
/**
... | __label__POS | 0.733747 |
package com.artemis.managers;
import com.artemis.Entity;
import com.artemis.EntityObserver;
import com.artemis.World;
import com.badlogic.gdx.utils.Disposable;
/**
* A parent class for all managers in the World.
*
* @author Arni Arent
*
*/
public abstract class Manager implements EntityObserver, Disposable {
... | __label__POS | 0.981036 |
package com.artemis.managers;
import com.artemis.Entity;
import com.artemis.utils.IdentifierPool;
import com.artemis.utils.SafeArray;
import com.badlogic.gdx.utils.Array;
import com.badlogic.gdx.utils.Pool;
import java.util.BitSet;
/**
* A class that is responsible for managing the life cycle of entities.
* Used f... | __label__POS | 0.679059 |
package com.artemis.managers;
import com.artemis.Entity;
import com.badlogic.gdx.utils.ObjectMap;
import com.badlogic.gdx.utils.ObjectMap.Entry;
import com.badlogic.gdx.utils.ObjectMap.Keys;
/**
* This Manager helps manage singleton entities such as Player or Boss.
* An entity can be assigned a name and use that n... | __label__POS | 0.749626 |
package com.artemis.managers;
import com.badlogic.gdx.utils.Array;
import com.badlogic.gdx.utils.ObjectMap;
import com.badlogic.gdx.utils.Pool;
/**
* Use this class together with PlayerManager.
*
* You may sometimes want to create teams in your game, so that
* some players are teammates.
*
* A player can onl... | __label__POS | 0.912223 |
package com.artemis.managers;
import com.artemis.Entity;
import com.badlogic.gdx.utils.ObjectMap;
import com.badlogic.gdx.utils.ObjectMap.Values;
/**
* DEPRECATED Use SingletonEntityManager instead.
*
* The name of this manager is a bit of a misnomer. It is not a standard tag
* implementation. If you need that,... | __label__POS | 0.839664 |
package com.artemis.managers;
import com.artemis.Entity;
import com.badlogic.gdx.utils.Array;
import com.badlogic.gdx.utils.ObjectMap;
import com.badlogic.gdx.utils.Pool;
/**
* Abstract Generic Group Manager allows to group entities together.
* The group identifier type is generic. If you are planning to use String... | __label__POS | 0.843548 |
### ADC
create_bd_port -dir I -from 13 -to 0 adc_dat_a_i
create_bd_port -dir I -from 13 -to 0 adc_dat_b_i
create_bd_port -dir I adc_clk_p_i
create_bd_port -dir I adc_clk_n_i
create_bd_port -dir O adc_enc_p_o
create_bd_port -dir O adc_enc_n_o
create_bd_port -dir O adc_csn_o
### DAC
create_bd_port -dir O -from 13 ... | __label__POS | 0.899606 |
package com.artemis.managers;
import com.artemis.Entity;
import com.badlogic.gdx.utils.Array;
import com.badlogic.gdx.utils.ObjectMap;
import com.badlogic.gdx.utils.Pool;
/**
* You may sometimes want to specify to which player an entity belongs to.
*
* An entity can only belong to a single player at a time.
*
... | __label__POS | 0.892876 |
package com.artemis.utils;
import com.badlogic.gdx.utils.Pool.Poolable;
/**
* Helper class allowing to execute a certain action after
* an elapsed delay.
*
*/
public abstract class Timer implements Poolable {
protected float delay;
protected boolean repeat;
protected float acc;
protected boolean... | __label__POS | 0.884045 |
package com.artemis.systems.event;
import com.artemis.systems.EntitySystem;
import com.badlogic.gdx.utils.Array;
import com.badlogic.gdx.utils.Pool.Poolable;
import com.badlogic.gdx.utils.Pools;
/**
* Abstract class all events should extend.
*
* @author apotapov
*
*/
public abstract class SystemEvent implements... | __label__POS | 0.912604 |
require "test_helper"
require "disposable/expose"
require "disposable/composition"
# Disposable::Expose.
class ExposeTest < Minitest::Spec
module Model
Album = Struct.new(:id, :name)
end
module Twin
class Album < Disposable::Twin
property :id
property :title, from: :name
end
end
cla... | __label__POS | 0.662954 |
`timescale 1 ns / 1 ps
module axi_cfg_register #
(
parameter integer CFG_DATA_WIDTH = 1024,
parameter integer AXI_DATA_WIDTH = 32,
parameter integer AXI_ADDR_WIDTH = 32
)
(
// System signals
input wire aclk,
input wire aresetn,
// Configuration bits
out... | __label__POS | 0.696007 |
require "test_helper"
require "disposable/callback"
class CallbackGroupTest < Minitest::Spec
class Group < Disposable::Callback::Group
attr_reader :output
on_change :change!
collection :songs do
on_add :notify_album!
on_add :reset_song!
# on_delete :notify_deleted_author! # in Update... | __label__POS | 0.712491 |
require 'test_helper'
class RenderTest < MiniTest::Spec
include Apotomo::TestCaseMethods::TestController
describe "#render" do
before do
@mum = mouse('mum')
end
it "per default display the state content framed in a div" do
assert_equal '<div id="mum">burp!</div>', @mum.invoke(:eating)
... | __label__POS | 0.959709 |
require 'minitest/autorun'
ENV['RAILS_ENV'] = 'test'
require "dummy/config/environment"
require "rails/test_help" # sets up ActionController::TestCase's @routes
require 'cells'
require 'apotomo'
Apotomo::Widget.append_view_path(File.expand_path(File.dirname(__FILE__) + "/widgets"))
require "test_case_methods" # Loa... | __label__POS | 0.801361 |
require 'test_helper'
class JavascriptGeneratorTest < MiniTest::Spec
describe "The JavascriptGenerator" do
describe "constructor" do
it "accept framework name and return an correct instance" do
@gen = Apotomo::JavascriptGenerator.new(:Jquery)
assert_kind_of Apotomo::JavascriptGenerator, @g... | __label__POS | 0.644912 |
require 'test_helper'
class TreeNodeTest < MiniTest::Spec
include Apotomo::TestCaseMethods::TestController
describe "initialization" do
before do
@mum = mouse('mum')
@mum << mouse_mock(:kid)
@kid = @mum[:kid]
@kid << mouse_mock(:grandchild)
@grandchild = @kid[:grandch... | __label__POS | 0.856246 |
require "test_helper"
class UnnestTest < Minitest::Spec
class Twin < Disposable::Twin
property :content do
property :id, nice: "yes"
collection :ids, status: "healthy"
property :email do
end
end
unnest :id, from: :content
unnest :ids, from: :content
unnest :email, f... | __label__POS | 0.731238 |
require 'test_helper'
class EventHandlerTest < MiniTest::Spec
include Apotomo::TestCaseMethods::TestController
describe "EventHandler" do
before do
@mum = mouse
@mum << mouse_mock(:kid)
end
it "respond to #process_event" do
h = Apotomo::EventHandler.new
e = Apotomo::Event.ne... | __label__POS | 0.782813 |
module Apotomo
module TestCaseMethods
def root_mock
MouseWidget.new(parent_controller, :root)
end
def mouse(id=nil, &block)
MouseWidget.new(parent_controller, id || :mouse).tap do |widget|
widget.instance_eval &block if block_given?
end
end
def mouse_mock(id='mo... | __label__POS | 0.721877 |
require 'test_helper'
class EventMethodsTest < MiniTest::Spec
include Apotomo::TestCaseMethods::TestController
def handler(id, state)
Apotomo::InvokeEventHandler.new(:widget_id => id, :state => state)
end
describe "#respond_to_event and #fire" do
before do
mum_and_kid!
end
it "alert @m... | __label__POS | 0.797278 |
require 'test_helper'
# TODO: there are *many* things in Apotomo::Widget *isn't* tested here
class WidgetTest < MiniTest::Spec
include Apotomo::TestCaseMethods::TestController
describe "The constructor" do
it "accept the parent_controller as first arg" do
assert_kind_of ActionController::Base, @control... | __label__POS | 0.6382 |
require "test_helper"
class PropertyProcessorTest < Minitest::Spec
Album = Struct.new(:title, :artist, :songs)
Artist = Struct.new(:name)
Song = Struct.new(:id)
class AlbumTwin < Disposable::Twin
property :title
property :artist do
property :name
end
collection :songs do
property ... | __label__POS | 0.960794 |
require "test_helper"
class InheritanceTest < Minitest::Spec
let (:song) { OpenStruct.new(id: 0) }
module Id
def id
super - 1
end
def id=(v)
super(v+1)
end
end
class Twin < Disposable::Twin
property :id
include Id
end
it do
twin = Twin.new(song)
expect(twin.i... | __label__POS | 0.996485 |
require 'test_helper'
class ControllerMethodsTest < MiniTest::Spec
include Apotomo::TestCaseMethods::TestController
describe "A Rails controller" do
describe "responding to #apotomo_root" do
it "initially return a root widget" do
assert_equal 1, @controller.apotomo_root.size
end
it ... | __label__POS | 0.843111 |
require 'action_view/helpers/javascript_helper'
module Apotomo
class JavascriptGenerator
def initialize(framework)
raise "No JS framework specified" if framework.blank?
extend "apotomo/javascript_generator/#{framework}".camelize.constantize
end
def <<(javascript)
"#{javascript}"
... | __label__POS | 0.99098 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Fast RTPS: Class Me... | __label__POS | 0.942463 |
// Provides markup, a Nunjucks helper and styles for a simple pager,
// used for pagination both on the front end and the back end.
module.exports = {
options: { alias: 'pager' },
helpers(self) {
return {
// Generate the right range of page numbers to display in the pager.
// Just a little too much... | __label__POS | 0.697564 |
;(function($){$.ui={plugin:{add:function(module,option,set){var proto=$.ui[module].prototype;for(var i in set){proto.plugins[i]=proto.plugins[i]||[];proto.plugins[i].push([option,set[i]]);}},call:function(instance,name,args){var set=instance.plugins[name];if(!set){return;}
for(var i=0;i<set.length;i++){if(instance.opti... | __label__POS | 0.653502 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Fast RTPS: Class Me... | __label__POS | 0.935629 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Fast RTPS: Class Me... | __label__POS | 0.915066 |
ENV['RAILS_ENV'] ||= 'test'
require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'
require "minitest/autorun"
require "trailblazer/rails/test/integration"
Rails.backtrace_cleaner.remove_silencers!
Minitest::Spec.class_eval do
after :each do
# DatabaseCleaner.clean
Thing.de... | __label__POS | 0.924928 |
class Comment::Cell < Cell::Concept
property :created_at
property :body
property :user
include Gemgem::Cell::GridCell
self.classes = ["comment", "large-4", "columns"]
include Gemgem::Cell::CreatedAt
def show
render
end
private
def nice?
model.weight == 0
end
class Grid < Cell::Concep... | __label__POS | 0.917493 |
module API::V1
module Thing
class Create < ::Thing::Create
include Trailblazer::Operation::Representer, Responder
representer Representer::Create
end
class Show < ::Thing::Show
include Trailblazer::Operation::Representer
representer Representer::Show
def process(*)
... | __label__POS | 0.87915 |
require "test_helper"
class InstanceHooksTest < HooksTest
describe "#define_hook" do
let(:klass) { Class.new(TestClass) do
include Hooks::InstanceHooks
end }
subject { klass.new.tap do |obj|
obj.instance_eval do
def dine; executed << :dine; end
end
end }
it "adds hook ... | __label__POS | 0.936262 |
require 'test_helper'
class IgnoreTest < StatusTest
let (:config) { Nit::Config.new }
after do
config.send(:file).rm!
end
it "ignores invalid indexes" do
Nit::Command::Ignore.new(config).call(["z"], output)
config.ignored_files.must_equal []
end
it "what" do
config.ignored_files.must_equa... | __label__POS | 0.921922 |
require 'test_helper'
class NitFileTest < MiniTest::Spec
it { Nit::File.new("new.rb", "<line 1>").to_s.must_equal "new.rb" }
end
class FilesTest < MiniTest::Spec
subject { Nit::Files.new(["on_stage.rb", "stage.rb", "stagedive.mk"]) }
describe "#[]" do
it { subject[100].must_equal nil }
it { subject[0].... | __label__POS | 0.885642 |
module Nit
class Lines < Array
def initialize(text)
super(text.split("\n").collect { |ln| Line.new(ln, self) })
end
def find(pattern)
each do |ln|
next unless matches = ln.match(pattern)
yield ln, matches
end
end
def files
files = []
for type, patt... | __label__POS | 0.938693 |
require 'test_helper'
class EventTableTest < Test::Unit::TestCase
context "An EventTable" do
setup do
@head = Onfire::EventTable.new
end
should "return an empty array when it can't find handlers" do
@head.add_handler :drink, :from => :stomach, :event_type => :thirsty
assert... | __label__POS | 0.810893 |
require 'test_helper'
class EventTest < Test::Unit::TestCase
context "An event" do
should "accept type and source in the constructor" do
event = Onfire::Event.new(:click, :source)
assert_equal :click, event.type
assert_equal :source, event.source
assert_nil event.data
end
... | __label__POS | 0.681921 |
require 'test_helper'
class OnfireTest < Test::Unit::TestCase
context "including Onfire" do
should "provide event_table accessors to an emtpy table" do
table = mock.event_table
assert_kind_of Onfire::EventTable, table
assert_equal 0, table.size
end
end
context "In the bar" do
set... | __label__POS | 0.807047 |
import { Field, ObjectType } from '@nestjs/graphql';
import { Node } from '../node/node.types';
@ObjectType()
export class MessageType {
@Field({ nullable: true })
message: string;
}
@ObjectType()
export class InvoicePayment {
@Field({ nullable: true })
canceled_at: string;
@Field({ nullable: true })
conf... | __label__POS | 0.977691 |
import { Field, ObjectType } from '@nestjs/graphql';
@ObjectType()
export class Utxo {
@Field()
address: string;
@Field()
address_format: string;
@Field()
confirmation_count: number;
@Field()
output_script: string;
@Field()
tokens: number;
@Field()
transaction_id: string;
@Field()
transacti... | __label__POS | 0.977358 |
import { Field, ObjectType } from '@nestjs/graphql';
export type RebalanceResponseType = { rebalance: [any, any, any] };
@ObjectType()
class BosIncrease {
@Field()
increased_inbound_on: string;
@Field()
liquidity_inbound: string;
@Field({ nullable: true })
liquidity_inbound_opening: string;
@Field({ nul... | __label__POS | 0.981155 |
import { Field, InputType, ObjectType } from '@nestjs/graphql';
import { Node } from '../node/node.types';
@ObjectType()
export class PendingResume {
@Field()
incoming_tokens: number;
@Field()
outgoing_tokens: number;
@Field()
incoming_amount: number;
@Field()
outgoing_amount: number;
@Field()
tota... | __label__POS | 0.741461 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Fast RTPS: Namespac... | __label__POS | 0.982171 |
import { createUnionType, Field, ObjectType } from '@nestjs/graphql';
@ObjectType()
export class PayRequest {
@Field({ nullable: true })
callback: string;
@Field({ nullable: true })
maxSendable: string;
@Field({ nullable: true })
minSendable: string;
@Field({ nullable: true })
metadata: string;
@Fiel... | __label__POS | 0.915667 |
import { Field, ObjectType } from '@nestjs/graphql';
@ObjectType()
export class NodeType {
@Field()
alias: string;
@Field()
public_key: string;
}
@ObjectType()
export class Node {
@Field(() => NodeType, { nullable: true })
node: NodeType;
}
@ObjectType()
export class NodeInfo {
@Field(() => [String])
... | __label__POS | 0.986207 |
import { Field, InputType, ObjectType } from '@nestjs/graphql';
@InputType()
export class NetworkInfoInput {
@Field()
is_ok_to_adjust_peers: boolean;
@Field()
is_ok_to_create_chain_addresses: boolean;
@Field()
is_ok_to_create_invoices: boolean;
@Field()
is_ok_to_create_macaroons: boolean;
@Field()
... | __label__POS | 0.800028 |
import { Field, ObjectType } from '@nestjs/graphql';
import { Node } from '../node/node.types';
@ObjectType()
export class Route {
@Field({ nullable: true })
base_fee_mtokens: string;
@Field({ nullable: true })
channel: string;
@Field({ nullable: true })
cltv_delta: number;
@Field({ nullable: true })
f... | __label__POS | 0.989042 |
import { Injectable, CanActivate, ExecutionContext } from '@nestjs/common';
import { Reflector } from '@nestjs/core';
import { GqlExecutionContext } from '@nestjs/graphql';
import { IS_PUBLIC_KEY, Role, ROLES_KEY } from '../security.decorators';
import { UserId } from '../security.types';
@Injectable()
export class Ro... | __label__POS | 0.818989 |
const url = $request.url;
const method = $request.method;
const notifyTitle = "bilibili-json";
console.log(`b站json-2023.10.22`);
if (!$response.body) {
// 有undefined的情况
console.log(`$response.body为undefined:${url}`);
$done({});
}
if (method !== "GET") {
$notification.post(notifyTitle, "method错误:", metho... | __label__POS | 0.85777 |
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-verbose
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
-keep public class * extends android.app.Activity
-keep public class * extends android.app.Application
-keep public class * extends android... | __label__POS | 0.999965 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.